-1

Here is a minimal example.

library(huxtable)

model1 <- lm(mpg ~ cyl + disp, data = mtcars)

huxreg1<-huxreg("This is a tool long title \n for one row"= model1)

print_latex(huxreg1)

When looking at the html output, the line break works. However not when exported to Latex.

Any simple Solutions for this behaviour?

Thank you very much in advance.

Edit:

This is a screenshot form the Latex Output: enter image description here

SKupek
  • 63
  • 6
  • Interestingly same behaviour for varaible names. But no solution. – SKupek Jun 22 '23 at 14:27
  • Could you provide a screenshot of of the table? When I copy the output into latex the table looks horrible. Instead of proper spacing/lines i see +1em everywhere. –  Jun 22 '23 at 19:44
  • Of course, happy to do so – SKupek Jun 23 '23 at 07:45

1 Answers1

1

This line in the output contains the column name

\multicolumn{1}{c!{\huxvb{0, 0, 0}{0}}}{\huxtpad{6pt}\centering \hspace{6pt} This is a tool long title  \newline  for one row \hspace{6pt}\huxbpad{6pt}} \tabularnewline[-0.5pt]

you can replace the \multicolumn{1}{c... with \multicolumn{1}{p{4cm}...which causes the column with the title to be 4cm wide (you can replace this by any other length. The fields with the variable names can be edited in the same fashion.

Alternatively you can use the one of the answers presented at this related question.