r - Pandoc conversion of markdown to latex with default filename -


i'm using r package knitr generate markdown file test.md. file processed pandoc produce variety of output formats, such html , pdf. because want use bibtex when generating pdf through latex, believe have tell pandoc stop @ intermediate latex output, , run bibtex , pdflatex myself (twice). here's found slight annoyance in workflow: way found pandoc keep intermediate tex file, , not go way pdf, specify hard-coded filename through -o option .tex extension. problematic me because i'm using a config file run pandoc('test.md', "latex", "config.pandoc") via knitr options, keep generic without hard-coded output filename:

format: latex o: test.tex s:  s: biblio: refs.bib biblatex: template: 'template.tex' default-image-extension: pdf 

which in turn becomes following command pandoc,

pandoc -s -s --biblio=refs.bib --default-image-extension=pdf --biblatex --template='template.tex'  -f markdown -t latex -o test.tex 'test.md' 

if skip o: test.tex option, pandoc produces pdf , doesn't keep intermediate latex file. how can keep tex file, without specifying hard-coded filename?

to solve problem on side, added new argument ext pandoc() function. available on github now (knitr development version 1.3.6). can override default file extension, e.g.

library(knitr) pandoc(..., ext = 'tex') 

Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -