Fix BiocStyle & pkgdown interaction#108
Open
zeehio wants to merge 2 commits into
Open
Conversation
Author
|
It's been a year without any feedback on this issue. Is there anything I can do to get this merged or discussed? Thanks |
out.format needs to be set for knit_theme$get(thm) to work. However, when building a pkgdown article based on a vignette that uses BiocStyle::pdf_document, the out.format is forced to be html, and hardcoding this knit option clashes with pkgdown. By setting and restoring the output format, things keep working as expected
zeehio
force-pushed
the
fix-biocstyle-with-pkgdown
branch
from
July 11, 2026 03:04
f04523f to
b8223a1
Compare
zeehio
pushed a commit
to zeehio/BiocStyle
that referenced
this pull request
Jul 11, 2026
…onductor#108) BiocStyle::pdf_document() sets the global knitr option 'out.format' to "latex" to look up the syntax highlighting theme but did not restore its previous value, corrupting state for documents rendered later in the same session (e.g. pkgdown building multiple articles in-process).
…onductor#108) BiocStyle::pdf_document() sets the global knitr option 'out.format' to "latex" to look up the syntax highlighting theme but did not restore its previous value, corrupting state for documents rendered later in the same session (e.g. pkgdown building multiple articles in-process).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
pkgdown https://pkgdown.r-lib.org/ is an R package to build static websites from package documentation and vignettes.
pkgdown evaluates the output format of the vignettes, but it does not use it, since it generates html documents.
However, BiocStyle manually sets the out.format to "latex". This makes pkgdown generate an html file that then is passed to pdflatex, giving an error "\begin{document}" not found. The temporary .tex file contains an html version of the vignette.
It seems the only reason BiocStyle sets "out.format" to "latex" is to call
knit_theme$get(thm)$highlight, by setting "out.format" to its former value everything seems to keep working.This change restores
"out.format", so pkgdown is still able to generate the html files. pdf vignettes still work as expected.