Creating bbl file from RMarkdown

I've solved this issue, but figured I should write it out in case anyone else comes looking! I wanted to post an article on arxiv that I had written using RMarkdown and the rticles package. Since arxiv wants source files, I had added keep_tex: yes to my yaml header, which left me with the .tex file I needed. But, I also needed a bbl file and couldn't figure out how to get it. Here's the trick!

tinytex::latexmk(filename, clean = FALSE)

Knit your document, then run that code on the resulting .tex to get a bunch of aux files to persist, including the .bbl

Thanks !

I think we should definitely update the format fonction in rticles so that all the source file required by arxiv are kept.

Which is the format used ?

I was using base_format: rticles::asa_article but I think it applies to all the formats. Maybe eventually arxiv will accept .Rmd files!

is .bbl file supposed to be kept for all type of submission ? It seems as of now that only the .tex file was necessary among built resources during rendering.

If we make a change to keep everything by default, maybe some user will be disturbed.

Also note you should be bable to achieve that without a specific call to this function by setting the option

options(tinytex.clean=TRUE)

This will pass clean = TRUE to the call of latexmk() during a rendering;

If you are using an external bib file to build your bibliography, arxiv will require the bbl file in order to process the tex. Journals kind of vary in what they require, IIRC. Some will take the .bib but others want the .bbl.

Good to know I could set tinytex.clean = FALSE in the document itself!

2 Likes

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.