-
-
Notifications
You must be signed in to change notification settings - Fork 872
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
fix disappearance of figure captions when a chunk generates multiple figures continuously #1760
base: master
Are you sure you want to change the base?
Conversation
I see I need some improvements. Current implementation tries to split sub-figures when fig.cap is specified. Also, in |
We've been focus on other subject and did not have time to look into it yet. I'll try to look at this issue and suggested fix later this week. Sorry for the delay. |
Don't worry :) I'm not rush about this. |
Knitr generates multiple figures in one line when a chunk generates multiple figures continuously.
For example,
becomes something like
In such case, Pandoc will suppress figure captions.
Yihui pointed out this in #1756 and I did in #1755 .
These issues were about office formats, but the issue occurs also in HTML and PDF.
I think users expect figure captions be shown rather than figures stay in one line.
This PR fixes this problem by adding blank lines between captioned figures.
The current implementation requires
fig.show='hold'
orecho=FALSE
, which is maybe too strict becauseis still like
Unfortunately, I have no idea how to detect such a case.
A workaround is to add blank lines regardless of what is specified to
fig.show
andecho
.A disadvantage of the workaround is that needless blank lines will be added when multiple figures are generated by a chunk but are separated from each other by something, i.e.
will be like
IMO, For the most of the formats, this is okay because the markdown format is just the intermediate format.
Some may dislike the needless blank lines when they want the markdown format as the output format.
Any thoughts?
Example Rmd