I'm trying to compile an article using BiocWorkflowTools and I'm pretty close to tearing all my hair out. I've been growing my hair for a few years now, so I would appreciate any help in delaying that process.
The suggestion on the "workflow workflow", for us wretched creatures who don't use Rstudio, is to make an article like so:
rmd_file <- rmarkdown::draft(
"Article.Rmd",
template = "f1000_article",
package = "BiocWorkflowTools",
edit = FALSE
)
If I then start an R session in the created Article
directory and run rmarkdown::render("Article.Rmd")
I get a latex error because f1000_styles.sty
isn't included:
! LaTeX Error: Environment tabledata undefined.
Okay, so I can add this to the yaml frontmatter:
---
[...]
header-includes:
- \usepackage{f1000_styles}
---
Now I wonder what happens if I render again?
! LaTeX Error: Option clash for package geometry.
Fantastic. Seems to be a check here in BiocWorkflowTools
, because rmarkdown does something funny with geometry
. No worries, add it to the yaml frontmatter.
---
[...]
geometry: "hmargin=1.8cm,vmargin=2.2cm"
---
What now? Oh boy. Apparently there's some nonsense with titlesec
and pandoc too (here).
! Argument of \paragraph has an extra }.
<inserted text>
\par
l.1290 \ttl@extract\paragraph
Fine. Stress levels rising even recreating this debugging process, but it's fine, latex alone is annoying and there are multiple other programs/languages interacting here so it's inevitable. Throw another ~~stick on the fire~~ entry in the yaml frontmatter:
---
[...]
subparagraph: yes
---
Now?
! LaTeX Error: \begin{minipage} on input line 110 ended by \end{center}.
This is where the trail of tears ends, I'm afraid. I have no debugging stamina remaining. I have absolutely no idea what the problem is here and I can't be arsed to debug the latex at the minute (I will probably try again tomorrow). One hypothesis is that it's the author field being scrambled. For example, if I look at the tex document I see
\title{\emph{F1000Research} Software Tool Article Template}
\author{true \and true}
An interesting interpretation, to be sure, but not the one that I initially intended, nor one that I particularly expected.
If I run rmarkdown::render([...], clean = FALSE)
and inspect Article.knit.md
, I see the same author field as in the template:
---
[...]
author:
- name: Author Name1
affiliation: Address of author1
- name: Author Name2
affiliation: Address of author2
---
So it seems to me that pandoc is messing with me.
If I change to author: [A, B]
I see \author{A \and B}
which is obviously a slight improvement over random coercion to booleans, but obviously lacks affiliations and other niceties that journals sometimes expect. Even author: [A, B]
doesn't save me from the proverbial river of ~~sh~~ excrement that is ! LaTeX Error: \begin{minipage} on input line 111 ended by \end{center}.
.
If you've made it this far I commend you, weary traveller. Rest assured my tone is one of general frustration, not annoyance with the authors. I hope that my ~~irritating~~ attempts at levity are seen as such, as I am simply trying to laugh as ~~Rome~~ my manuscript burns. I'm happy to make a PR to patch whatever problems I find.
Per the formalities, I'll try to list my software versions.
I'm using the latest (1.12.0) BiocWorkflowTools
pandoc -v
gives:
pandoc 1.19.2.4
Compiled with pandoc-types 1.17.0.5, texmath 0.9.4.4, skylighting 0.3.3.1
While pandoc-citeproc -V
gives pandoc-citeproc 0.10.5.1
.
My sessionInfo()
:
R version 3.6.2 (2019-12-12)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 18.04.4 LTS
Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.7.1
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.7.1
locale:
[1] LC_CTYPE=en_GB.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_GB.UTF-8 LC_COLLATE=en_GB.UTF-8
[5] LC_MONETARY=en_GB.UTF-8 LC_MESSAGES=en_GB.UTF-8
[7] LC_PAPER=en_GB.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_GB.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] Rcpp_1.0.3 bookdown_0.17 digest_0.6.24
[4] R6_2.4.1 magrittr_1.5 git2r_0.26.1
[7] evaluate_0.14 BiocWorkflowTools_1.12.0 httr_1.4.1
[10] stringi_1.4.5 rlang_0.4.4 fs_1.3.1
[13] rstudioapi_0.10 rmarkdown_2.1 BiocStyle_2.14.4
[16] tools_3.6.2 stringr_1.4.0 glue_1.3.1
[19] tinytex_0.19 xfun_0.12 yaml_2.2.1
[22] parallel_3.6.2 compiler_3.6.2 BiocManager_1.30.10
[25] htmltools_0.4.0 knitr_1.27 usethis_1.5.1
I also note this knitr error for what it's worth, though I obviously don't care about this one:
!!! Error: Input file `Article_files/figure-latex/frog-picture-1.pdf' not found!
Hi Alan, thanks for the interest in the BiocWorkflowTools package. I must admit it's been a bit neglected recently, and you might notice that the even the 'Workflow Workflow' is failing to build (with a different error from what you're reporting).
Mostly the neglect is due to the fact that I never sucessfully cracked the process of submitting an Rmd down to F1000 without jumping through some pretty tedious hoops, so although you could (at least at one point in time) make a PDF that looks like a paper, submission was still ultimately of a TeX file which was unsatisfactory to me.
None the less, that doesn't excuse having software that can't be run with documention that's now clearly out of date. I'll take a look at the pack in the next few days and at least try to update so the template works and you can compile a PDF from the markdown.
Cheers, fair enough about the neglect. I still find it a useful idea, since rmarkdown::render means you can create the workflow and tex/pdf from the same Rmd at the same time.
The reason I'm working on this is because an existing manuscript was written with this framework and I think it would be more effort at this point to try switching.
As I said I'm more than happy to submit some of these fixes as a patch if you like. The last bit is beyond me but that's as much my poor Latex knowledge as anything else.
fyi I tried with recent pandoc 2.9.2 and it still doesn't handle author + affil