For certain pieces of text (like in column labels or table headings) we may
want to express them as raw LaTeX. In fact, with LaTeX, so much more can be done for formatting.
The latex()
function will guard the input LaTeX from being escaped.
Value
A character object of class latex
. It's tagged as an latex fragment
that is not to be sanitized.
Examples
Use the exibble
dataset to create a gt table. When adding a title
through tab_header()
, we'll use the latex()
helper to signify to gt
that we're using LaTeX formatting.
exibble |>
dplyr::select(currency, char) |>
gt() |>
tab_header(title = latex("\\emph{LaTeX}"))
See also
Other helper functions:
adjust_luminance()
,
cell_borders()
,
cell_fill()
,
cell_text()
,
currency()
,
default_fonts()
,
escape_latex()
,
from_column()
,
google_font()
,
gt_latex_dependencies()
,
html()
,
md()
,
nanoplot_options()
,
pct()
,
px()
,
random_id()
,
row_group()
,
stub()
,
system_fonts()
,
unit_conversion()