hughjonesd / huxtable

An R package to create styled tables in multiple output formats, with a friendly, modern interface.
http://hughjonesd.github.io/huxtable
Other
322 stars 28 forks source link

change to_latex so tabularnewline takes a parameter #249

Closed JEAN71 closed 1 year ago

JEAN71 commented 1 year ago

Hello there, Is it possible to change to__latex to take a parameter that can be given to tabularnewline ? I am thinking something like to_latex<-function(.., tnewline=0.5, ..){..}

content_rows <- apply(contents, 1, function (x) { x <- x[nzchar(x)] row <- paste(x, collapse = " &\n") paste(row, paste("\tabularnewline[-",tnewline,"pt]", sep="")) })

for the content_rows function (line 463 in the latex.R file). I did try to change it myself but it seems to be getting a problem to work. The reason why this would be beneficial is because the border_padding does not affect the rowspans if I want the font size small. Thanks

hughjonesd commented 1 year ago

I'm very loth to allow parameters to change individual bits of LaTeX; once you start down that track you can go on adding complexity forever.

  1. Is there a reason you can't use gsub() on the result of to_latex()?

  2. Can you clarify exactly why you want this? Last sentence isn't too clear. I.e. what is the underlying bug here?

hughjonesd commented 1 year ago

Closing. Feel free to reopen if you have comments.