Closed mjsmith037 closed 7 months ago
Yes I believe we are trimming whitespace, no matter the escape settings... 🤔
https://github.com/yihui/knitr/blob/4b47d2a57bd6ac31712d0afafbc4fe968b663c92/R/table.R#L156
@yihui do you think we could have some specific handling in some case ? Either trimming when escape = TRUE
only ?
with additional check on whitespace espace sequence depending on format ? 🤔
Or maybe we need a specific marked string to not trim....
Like
data.frame(x=I("\\ "))
Trailing spaces escaped by \
are no longer trimmed. Thanks!
This old thread has been automatically locked. If you think you have found something related to this, please open a new issue by following the issue guide (https://yihui.org/issue/), and link to this old issue if necessary.
Describe the bug
When a table cell ends with an explicit space, specified in latex as "\ ",
kable
inappropriately prunes the space, resulting in erroneous latex code that cannot be compiled.To reproduce
produces:
Note that line 5 of the output should be "\ \\" (with a space between the first and second backslashes).
When attempting to compile this, an erroneous
.pdf
is produced:test.pdf
Session info
Note this issue was previously, erroneously posted in the
kableExtra
repo.By filing an issue to this repo, I promise that
I understand that my issue may be closed if I don't fulfill my promises.