Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] knitr kable not work with caption with _ symbol in latex format #1527

Closed
borisalmonacid opened this issue Mar 18, 2018 · 3 comments
Closed
Milestone

Comments

@borisalmonacid
Copy link

Work:
knitr::kable(head(mtcars, 1), format = "latex", caption = "First sample caption")
screenshot 2018-03-18 11 32 41

Not work:
knitr::kable(head(mtcars, 1), format = "latex", caption = "First sample caption _")
knitr::kable(head(mtcars, 1), format = "latex", caption = "First sample caption _5 ")
knitr::kable(head(mtcars, 1), format = "latex", caption = "First sample caption _ 5")

screenshot 2018-03-18 11 32 37

@haozhu233
Copy link
Contributor

Saw this randomly. kable doesn't escape caption. You need to manually escape that knitr::kable(head(mtcars, 1), format = "latex", caption = "First sample caption \\_")

@yihui yihui added this to the v1.21 milestone Aug 2, 2018
@yihui
Copy link
Owner

yihui commented Aug 2, 2018

Thanks @haozhu233! I was just waiting for someone to type out the answer in my mind. 😁

@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants