Column Italic Text Format

I need to paste xtableview names into a table created in my Rnw file, and I want to convert the relative column to italic format. Is this possible without manual intervention?

My call:

xtable(cklist, caption="Checklist...", align='lllc',label = 'tab:ckzygo')
+4
source share
1 answer

To type a column in italics (or any other non-standard font form), you must use the syntax >{\cmd}for the Specification column.

Assigning a column type >{\itshape}lcreates a left-selected column in italics.

, iris$Species <- paste0("\\textit{", iris$Species, "}"), , , .

:

\documentclass{article}
\usepackage{array}
\begin{document}
<<xtableItalics, results = "asis">>=
library(xtable)

print(xtable(head(iris), align = c(rep("l", 5), ">{\\itshape}l")))
@
\end{document}

PDF : enter image description here

, array.

EDIT. , :

print(xtable(head(iris), align = c(rep("l", 5), ">{\\textit\\bgroup}l<{\\egroup}")))
print(xtable(head(iris), align = c(rep("l", 5), ">{\\textcolor{red}\\bgroup}l<{\\egroup}")))

\itshape \textit{}, . \textit{} , , . ( wikibooks.org, .)

, , . lrbox, .

+2

Source: https://habr.com/ru/post/1606181/


All Articles