-
-
Notifications
You must be signed in to change notification settings - Fork 877
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
Table captions are mismatched when kable and rmarkdown table styles are interleaved in RStudio #895
Comments
Reproduced on Win7
|
The problem does NOT occur when echo=TRUE |
Sorry I cannot do anything on knitr's side. This is a pandoc issue, and I do not think it is a pandoc bug, either, since the caption can be placed either above or below the table. It is ambiguous which table the second caption
|
It's not simply that the output is visually ambiguous, but rather that the caption actually jumps from one table to another under certain conditions. Given
I think the screenshot, below, demonstrates that (a) the captions are appearing below the tables in the generated PDF and that (b) what should be the caption for table 3 has been incorrectly labeled as table 2 and attached to table 2. I don't think there's any question that the caption is attached to the wrong table. The ambiguity would seem to be introduced in the intermediate .md file (which is pre-pandoc, of course):
It's ambiguous in the above .md with which table the We can see this definitively in this excerpt from the intermediate .tex file:
SOLUTION...? (hack!!)
I believe that forces the |
Yep, when I said "put something after the second table", |
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. |
There seems to be an issue with table numbering when a mixture of knitr::kable(...) and either the |:---| table format or the ----- ----- table formatting are interleaved.
In the example below, the second table (alpha-beta) gets the "Third table" caption; the third table gets the fourth table's caption; and the fourth table, which should have a caption, doesn't.
Note that knitting to PDF, DOCX, or HTML all produce the same mismatched tables and captions.
Reproducible Example
Sample output
The text was updated successfully, but these errors were encountered: