We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
A very basic question. How to add cross references to figures?
In bookdown::pdf_document2 we can do:
--- title: "Untitled" author: "test" date: "4/3/2022" output: bookdown::pdf_document2: toc: false --- \```{r setup, include=FALSE} # escaping the \`, remove the \ knitr::opts_chunk$set(echo = FALSE) \``` This is a cross reference to Figure \@ref(fig:aplot) \``` {r, aplot, fig.cap="This is a plot"} plot(1) \```
Is this possible in stevetemplates::article2?
The only way I manage is through the captioner package:
--- title: "Untitled" author: "test" date: "4/3/2022" output: stevetemplates::article2 --- \```{r setup, include=FALSE} knitr::opts_chunk$set(echo = FALSE) library(captioner) fig_nums <- captioner() \``` This is a cross reference to `r fig_nums("aplot", display = "cite")` \```{r, aplot} plot(1) \``` `r fig_nums(name = "aplot", caption = "This is a plot")`
The text was updated successfully, but these errors were encountered:
Pretty sure you can. You can see how I do this here through {bookdown}
https://github.com/svmiller/peacesciencer/blob/master/manuscript/src/render_pdf.R
Alas, you are right that I built the article2 function to not use {bookdown}. Let me look into this further.
article2
{bookdown}
Sorry, something went wrong.
No branches or pull requests
A very basic question. How to add cross references to figures?
In bookdown::pdf_document2 we can do:
Is this possible in stevetemplates::article2?
The only way I manage is through the captioner package:
The text was updated successfully, but these errors were encountered: