Bioconductor / BiocStyle

Issues and pull requests for BiocStyle should go here.
12 stars 19 forks source link

pdf_document fails #63

Closed mtmorgan closed 5 years ago

mtmorgan commented 5 years ago

Several packages, e.g., http://bioconductor.org/checkResults/devel/bioc-LATEST/swfdr/malbec1-buildsrc.html fail with

! Argument of \paragraph has an extra }.
<inserted text>
                \par
l.1290 \ttl@extract\paragraph

Error: Failed to compile swfdrQ.tex. See https://yihui.name/tinytex/r/#debugging for debugging tips. See swfdrQ.log for more info.
Execution halted

A minimal example is to R CMD Sweave the following:

---
title: "Title"
output: BiocStyle::pdf_document
vignette: >
  %\VignetteIndexEntry{}
  %\VignetteEngine{knitr::rmarkdown}
  %\VignetteEncoding{UTF-8}
---

The tail of the latex log involves loading several .sty files, I think triggered by loading resources/tex/Bioconductor.sty

) (/usr/local/texlive/2018/texmf-dist/tex/latex/titlesec/titlesec.sty
Package: titlesec 2016/03/21 v2.10.2 Sectioning titles
\ttl@box=\box32
\beforetitleunit=\skip64
\aftertitleunit=\skip65
\ttl@plus=\dimen141
\ttl@minus=\dimen142
\ttl@toksa=\toks26
\titlewidth=\dimen143
\titlewidthlast=\dimen144
\titlewidthfirst=\dimen145
! Argument of \paragraph has an extra }.
<inserted text> 
                \par 
l.1290 \ttl@extract\paragraph
aoles commented 5 years ago

Thank you for reporting this! Might be related to the usage of TinyTeX, I think I have seen some issues with this distro already in the past. Are the release builders using it as well? At least there it builds, there haven't been any changes to Bioconductor.sty for over a year now.

mtmorgan commented 5 years ago

I don't think the build system (or my mac, where I can also reproduce the problem) uses TinyTeX; maybe a change in a dependency like knitr?

hpages commented 5 years ago

Hi Andrzej,

FWIW we use Tex Live on the Unix builders, MikTeX on the Windows builders, and MacTeX on the Mac builders.

H.

aoles commented 5 years ago

Thanks @hpages for chiming in. I was suggesting TinyTeX because of the note which comes with the error message on all 3 platforms: See https://yihui.name/tinytex/r/#debugging for debugging tips. But maybe this is independent from the distro actually used.

It seems that a few dependencies including knitr, rmarkdown and bookdown changed since the release, maybe something to follow up on. Unfortunately, I have a few other things going on right now so I'm afraid it might take a while until I can look into this.

Cheers, Andrzej

mtmorgan commented 5 years ago

I checked only a couple of packages, but these have problems only in devel. Also, my test vignette above fails when built under bioc-devel but not bioc-3.9. Since both devel and release are using R-3.6, I think this means its a Bioconductor package... which I think points to BiocStyle!

aoles commented 5 years ago

Found it! Apparently I've introduced this bug in https://github.com/Bioconductor/BiocStyle/commit/f6f0378b963a1fa300e0f55870d2d08bf5cc6565, quite embarrassing.

Let me apologize for all the inconvenience, I will fix ASAP.

Cheers, Andrzej

aoles commented 5 years ago

For the record: things used to work before by chance only because the older pandoc LaTeX template provided by rmarkdown default-1.15.2.tex was used rather than default-1.17.0.2.tex. The former template file was chosen because of an error in the regex which I have fixed in https://github.com/Bioconductor/BiocStyle/commit/f6f0378b963a1fa300e0f55870d2d08bf5cc6565. However, as it turned out the newer template was incompatible with BiocStyle. The details are quite obscure: apparently some template code got moved around in https://github.com/jgm/pandoc/commit/e5573bca8f8c92bf96ed1525fb29fc8fb61dc44c for no apparent reason. It seems that Bioconductor.sty must not be loaded after the following block because of a clash with titlesec as described here and here.

$if(subparagraph)$
$else$
% Redefines (sub)paragraphs to behave more like sections
\ifx\paragraph\undefined\else
\let\oldparagraph\paragraph
\renewcommand{\paragraph}[1]{\oldparagraph{#1}\mbox{}}
\fi
\ifx\subparagraph\undefined\else
\let\oldsubparagraph\subparagraph
\renewcommand{\subparagraph}[1]{\oldsubparagraph{#1}\mbox{}}
\fi
$endif$
hpages commented 5 years ago

Thx Andrzej!