You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
library(gt)
gtcars |>
dplyr::select(mfr, model, msrp) |>
dplyr::slice(1:5) |>
gt() |>
tab_header(
title = "\\textbf{gtcars}",
subtitle = md("`gtcars` is an R dataset")
) |>
as_latex() |>
as.character()
Actual result
"\\begin{table}[!t]\n\\caption*{\n{\\large \\textbackslash{}textbf\\{gtcars\\}} \\\\ \n{\\small \\texttt{gtcars} is an R dataset}\n} \n\\fontsize{12.0pt}{14.4pt}\\selectfont\n\\begin{tabular*}{\\linewidth}{@{\\extracolsep{\\fill}}llr}\n\\toprule\nmfr & model & msrp \\\\ \n\\midrule\\addlinespace[2.5pt]\nFord & GT & 447000 \\\\ \nFerrari & 458 Speciale & 291744 \\\\ \nFerrari & 458 Spider & 263553 \\\\ \nFerrari & 458 Italia & 233509 \\\\ \nFerrari & 488 GTB & 245400 \\\\ \n\\bottomrule\n\\end{tabular*}\n\\end{table}\n"
As you can see, \ was converted into \\textbackslash{}
Expected result
There should be a escape option, like there is for knitr::kable, that prevents escaping.
Yes, I know I can use md("**my title**"), but my aim is to output raw LaTeX code that do not have a corresponding Markdown code, in particular for newlines in cell outputs for example.
Yes, I know I can use md("my title"), but my aim is to output raw LaTeX code that do not have a corresponding Markdown code, in particular for ddsjoberg/gtsummary#2047 for example.
Prework
Description
THe function
as_latex
is converting\
into\\textbackslash{}
,{
into\{
and does other latex-escaping that can't be avoidedReproducible example
Actual result
As you can see,
\
was converted into\\textbackslash{}
Expected result
There should be a
escape
option, like there is for knitr::kable, that prevents escaping.Yes, I know I can use
md("**my title**")
, but my aim is to output raw LaTeX code that do not have a corresponding Markdown code, in particular for newlines in cell outputs for example.Session info
The text was updated successfully, but these errors were encountered: