-
Notifications
You must be signed in to change notification settings - Fork 335
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
How to have pkgdown
use figure numbers and cross-references in vignettes?
#2201
Comments
Does this pkgdown issue solution help:
#323 (comment) ?
…On 02/10/2022 1:23 p.m., Michael Friendly wrote:
This is a question I posted on SO,
https://stackoverflow.com/questions/73911723/how-to-have-pkgdown-use-figure-numbers-and-cross-references-in-vignettes
<https://stackoverflow.com/questions/73911723/how-to-have-pkgdown-use-figure-numbers-and-cross-references-in-vignettes>
but without any response, so I'm hoping that someone here can suggest a
solution. Or if not, perhaps this is something that the |pkgdown| team
can consider as an enhancement.
I refer to the new pkgdown site for my |heplots| package,
http://friendly.github.io/heplots/ <http://friendly.github.io/heplots/>
, with the source at
https://github.com/friendly/heplots <https://github.com/friendly/heplots>
My description in the SO post:
I've created several vignettes for a package, with figures I want to
reference in the text.
Using the template for a |.Rmd| vignette, I can do this by using
|bookdown::html_document2| as follows in my yaml header:
|output: bookdown::html_document2: base_format: rmarkdown::html_vignette
fig_caption: yes toc: true |
Yet, when I build the associated |pkgdown| site, I don't get figure
numbers or cross-references,
done with ***@***.***(fig:chunk_name)|.
What I see in the pkgdown-rendered articles has (a) no figure numbers;
(b) figure cross-references just appear in the rendered articles as
|@(fig:chunk-name)|
—
Reply to this email directly, view it on GitHub
<#2201>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAOYSQCTR6SSTUTXKAJ4VJDWBHAI3ANCNFSM6AAAAAAQ27QNUU>.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Wow! Thx @dmurdoch For the record, the suggestion is to add a
I get all figures numbered and cross-references work. However, I also get a large number of warnings, which may be specious (?) or mean that my chunk labels aren't recognized by
Recommendation |
It looks like the necessary docs are in https://pkgdown.r-lib.org/reference/build_articles.html#output-formats. Additionally, I'll soon start work on quarto support (#2210) where hopefully all you'll need to do to get nice figure numbers + cross-references is switch from |
This is a question I posted on SO, https://stackoverflow.com/questions/73911723/how-to-have-pkgdown-use-figure-numbers-and-cross-references-in-vignettes but without any response, so I'm hoping that someone here can suggest a solution. Or if not, perhaps this is something that the
pkgdown
team can consider as an enhancement.I refer to the new pkgdown site for my
heplots
package, http://friendly.github.io/heplots/ , with the source athttps://github.com/friendly/heplots
My description in the SO post:
I've created several vignettes for a package, with figures I want to reference in the text.
Using the template for a
.Rmd
vignette, I can do this by usingbookdown::html_document2
as follows in my yaml header:Yet, when I build the associated
pkgdown
site, I don't get figure numbers or cross-references,done with
\@ref(fig:chunk_name)
.What I see in the pkgdown-rendered articles has (a) no figure numbers; (b) figure cross-references just appear in the rendered articles as
@(fig:chunk-name)
The text was updated successfully, but these errors were encountered: