Hi all,

I am doing a LaTeX document with R, so .Rnw file, which I 'Sweave' to 
get the .tex file I will 'LaTeX' to .pdf.

In that document, I want to include a small data.frame, let's call 
`data`, therefore I use the xtable package and include something like

<<echo=FALSE,results=tex>>=
print(xtable(data))
@

One of the names of data is too long, let's say 'This column has a long 
name' and I want it to be displayed in two rows. Therefore, among other 
things, in the tex file the two rows should be separated by '\\', so it 
should appear, for example, as  'This column\\ has a long name'.

If in the .Rnw file I include \\ in the name, it is (S)weaved to 
$\backslash$. I I include \textbackslash, Sweave returns extbackslash.

Therefore, my question is how can I do to get column name in multiple 
rows. I am open to use other packages than xtable, but I want this 
working with Sweave (so no Rmarkdown/knitr solutions, please).

Thanks!

Iago
        [[alternative HTML version deleted]]

______________________________________________
[email protected] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide https://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to