You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 14, 2020. It is now read-only.
Repository navigation
This repository was archived by the owner on Feb 14, 2020. It is now read-only.
When I use knitr::spin and chunk for figure and use captionioner to lable the figure, in the appropriate chunk, I get an MD file which I then use Rmarkdown to generate into pdf, html and word files.
For PDF I get double numbering and for word, I get the right figure numbering. How should I resolve this?
Hi,
I think it could be fairly straightforward to add the extraction of the caption to the captioner function. The folowing addition in bold in the code chunk from the captioner function should take care of this.
...
if (display == FALSE) {
return(invisible())
}
else if (display == "full" || display == "f") {
return(paste0(prefix, obj_num, ": ", caption))
} else if (display == "caption") {
return(caption)
}
else if (display == "cite" || display == "c") {
return(paste0(prefix, obj_num))
}
else if (display == "num" || display == "n") {
return(obj_num)
}
else {
warning("Invalid display mode used. Caption was still saved.")
return(invisible())
}
...
This will work for latex once you define a fig_num function similar to the one below but with the parameter "display" set to "caption". Then you use the fig_num function to define the fig.cap option in the header line of the R code chunk. To get it working for both html and pdf (latex) in the same Rmd file you can follow the attached working exmple.
When I use knitr::spin and chunk for figure and use captionioner to lable the figure, in the appropriate chunk, I get an MD file which I then use Rmarkdown to generate into pdf, html and word files.
For PDF I get double numbering and for word, I get the right figure numbering. How should I resolve this?