Closed writezhe closed 5 months ago
Well yes, I understand this may be surprising, but you are asking tinytable
to escape the content of every cell with that command. So of course the \\
will also be escaped.
One alternative would be to use the i
and j
arguments in format_tt()
to only escape the cells that need escaping, and not the ones where you have linebreaks.
I feel this falls under "intended behavior."
Gotcha, much appreciated! It didn't cross my mind that I could also use the i
and j
arguments just like in the other functions alongside the escape =
option. Thanks, appreciate the time!
Hi there, thanks for all the work on this package and modelsummary! I've been shifting my work over to these two packages. And my apologies in advance if I've missed something simple here.
I'm trying to add a few linebreaks to regression and summary tables. I've seen in the documentation (link) and in recent Github issues (link) the suggestion to use
{\\\\}
to ensure the latex output receives the correct\\
in the .tex file.However, in my testing, this doesn't work correctly if
format_tt(escape = "latex")
is used. Instead, the\\\\
gets converted to\textbackslash{}
twice.Is this intended? I find this causes a conflict when I want to use a special character in my text, e.g. the
%
symbol. I can only do one or the other.I can see why this would be ambiguous — e.g. does the user want two backslashes or do they want a linebreak? I looked through StackExchange and the Github issues, if there's an alternative that I missed, I appreciate it! Thanks in advance!
Replication example:
The first chunk modelsummary chunk outputs the following. The
\\
is correct but the% change
becomes a comment instead.The second outputs the following. The issues are now reversed, the
\\
becomes\textbackslash{}
instead but the% change
is formatted correctly:PS
\newline
doesn't seem to work either because the\
still gets replaced by\textbackslash{}
when using latex escape.