-
Notifications
You must be signed in to change notification settings - Fork 218
Closed
Milestone
Description
As discussed here, an open paren cannot follow \midrule in a longtable latex environment. This causes things like (Intercept), produced by broom::tidy() |> gt() to produce latex errors.
A simpler example is shown below.
tibble::tribble(
~ a, ~b,
"(a)", "b") |>
gt::gt() |>
gt::as_latex() |>
cat()
#> \begin{longtable}{ll}
#> \toprule
#> a & b \\
#> \midrule
#> (a) & b \\
#> \bottomrule
#> \end{longtable}Created on 2023-01-09 with reprex v2.0.2
The latex error produced if we stop at gt::gt() is
compilation failed- error
Undefined control sequence.
<argument> ...al \expandafter \let \cmrsideswitch
\@tempa \fi \fi
It looks like one solution would be to use \midrule\relax in place of \midrule to prevent \midrule from trying to apply (a) as an optional argument.
I'm pretty sure the same issue would arise for a paren after \toprule, but that doesn't happen in my broom::tidy() use case.
Metadata
Metadata
Assignees
Type
Projects
Status
Done