Skip to content

Fix BiocStyle & pkgdown interaction#108

Closed
zeehio wants to merge 2 commits into
Bioconductor:develfrom
zeehio:fix-biocstyle-with-pkgdown
Closed

Fix BiocStyle & pkgdown interaction#108
zeehio wants to merge 2 commits into
Bioconductor:develfrom
zeehio:fix-biocstyle-with-pkgdown

Conversation

@zeehio

@zeehio zeehio commented Jun 2, 2024

Copy link
Copy Markdown

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.

imatge

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.

@zeehio

zeehio commented Sep 18, 2025

Copy link
Copy Markdown
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
zeehio force-pushed the fix-biocstyle-with-pkgdown branch from f04523f to b8223a1 Compare July 11, 2026 03:04
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).
@LiNk-NY

LiNk-NY commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Hi @zeehio
Thanks for your interest.
Can you provide a reproducible example of this issue?

@zeehio

zeehio commented Jul 21, 2026

Copy link
Copy Markdown
Author

Good news, I can't.

Two years ago I had to install this branch in my AlpsNMR GitHub workflow https://github.com/sipss/AlpsNMR or otherwise pkgdown failed.

I have been dragging this patch for two years on my package.

I recently hit #116 and I combined both patches.

Now I just tried using the patch in #116 and dropping this one and the build succeeded.

I guess something got fixed elsewhere (possibly pkgdown or some dependency).

Anyway, since I can't reproduce the error, I will close this PR. Apologies for all the noise.

@zeehio zeehio closed this Jul 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants