New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pandoc_args behaves different for HTML and PDF #1142

Closed
rgaiacs opened this Issue Sep 10, 2017 · 1 comment

Comments

Projects
None yet
2 participants
@rgaiacs

rgaiacs commented Sep 10, 2017

When I used

output:
  pdf_document:
   pandoc_args: [
     "--data-dir", "_pandoc",
     "--template", "apa6.tex",
     "--output", "apa6.pdf"
   ]

on the YAML header of my document and run Knit, the log shows

usr/lib/rstudio/bin/pandoc/pandoc +RTS -K512m -RTS paper.utf8.md --to latex --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash --output paper.pdf --template /home/raniere/R/x86_64-pc-linux-gnu-library/3.4/rmarkdown/rmd/latex/default-1.17.0.2.tex --highlight-style tango --latex-engine pdflatex --variable graphics=yes --data-dir _pandoc --template apa6.tex --output apa6.pdf --variable 'geometry:margin=1in' 

Note that my --template option is after the default one which means that Pandoc is going to use the option that I provided.

When I used

output:
  html_document:
    pandoc_args: [
      "--data-dir", "_pandoc",
      "--template", "university-of-manchester.html",
      "--output", "paper.html"
    ]

on the YAML header and run Knit, the log shows

/usr/lib/rstudio/bin/pandoc/pandoc +RTS -K512m -RTS paper.utf8.md --to html --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash --output paper.html --smart --email-obfuscation none --self-contained --data-dir _pandoc --template university-of-manchester.html --output paper.html --standalone --section-divs --template /home/raniere/R/x86_64-pc-linux-gnu-library/3.4/rmarkdown/rmd/h/default.html --no-highlight --variable highlightjs=1 --variable 'theme:bootstrap' --include-in-header /tmp/RtmpICieib/rmarkdown-str22be582057ea.html --mathjax --variable 'mathjax-url:https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML'

Now, my --template option is behind the default one which means that Pandoc is not going to use the option that I provided.

I know that I should use the template option as explained in the documentation but would be great if always the pandoc_args were at the end of the Pandoc call.

@yihui yihui added this to the v1.7 milestone Oct 10, 2017

@yihui

This comment has been minimized.

Show comment
Hide comment
@yihui

yihui Oct 10, 2017

Member

I'm not sure if there are any unexpected consequences of changing the order of pandoc_args, so I tend not touch it, especially given that this particular issue you reported has a clear solution as you mentioned. Thanks for the report anyway!

Member

yihui commented Oct 10, 2017

I'm not sure if there are any unexpected consequences of changing the order of pandoc_args, so I tend not touch it, especially given that this particular issue you reported has a clear solution as you mentioned. Thanks for the report anyway!

@yihui yihui closed this Oct 10, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment