-
-
Notifications
You must be signed in to change notification settings - Fork 969
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
References \ref{fig:chunk_label}
in markdown with pdf_document
output are only resolved when specifying chunk options in addition to fig.cap
#2391
Comments
Referencing mechanism for all figure with caption is available through Without In the first case, knitr will generate markdown code Using bookdown feature would get use labelling and numbering for both PDF and HTML. @yihui is this explain better somewhere ? |
That's a clear enough explanation. I don't remember if this is documented anywhere, although I have explained it a few times before in various places. |
Thank you both for your time! I did not know about |
I think the fact you ask the question here is part of the documentation for those having the same question. Using bookdown is the really the good way in that case. Thank for asking ! |
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. |
Consider the following example markdown:
Rendering with
rmarkdown::render()
shows that only the second reference is resolved:The markdown generated for the plots is the following:
and
Reading the documentation of the plot specific chunk options, especially of
fig.lp
, I would expect that the label would also be generated for the first chunk.Checklist
When filing a bug report, please check the boxes below to confirm that you have provided us with the information we need. Have you:
formatted your issue so it is easier for us to read?
included a minimal, self-contained, and reproducible example?
pasted the output from
xfun::session_info('rmarkdown')
in your issue?upgraded all your packages to their latest versions (including your versions of R, the RStudio IDE, and relevant R packages)?
installed and tested your bug with the development version of the rmarkdown package using
remotes::install_github("rstudio/rmarkdown")
?The text was updated successfully, but these errors were encountered: