rstudio / rmarkdown-cookbook

R Markdown Cookbook. A range of tips and tricks to make better use of R Markdown.
https://bookdown.org/yihui/rmarkdown-cookbook/
583 stars 225 forks source link

Declare LaTeX dependencies via pdf_document(extra_dependencies = ...) #28

Closed yihui closed 5 years ago

yihui commented 6 years ago

I guess not many people are aware of the extra_dependencies argument. It is a much more compact way of using extra LaTeX packages in pdf_document().

haozhu233 commented 6 years ago

Here is the related PR. In short, people can attach required latex packages using the following syntax.

extra_dependencies: ["multirow", "threeparttable"]

extra_dependencies:
    hyperref: ["unicode=true", "breaklinks=true"]
    lmodern: null

https://github.com/rstudio/rmarkdown/pull/944

dr-harper commented 6 years ago

I have added the first version of this section here 3f120e550e8186855ff15d87ca49d83229bf1465

https://dr-harper.github.io/rmarkdown-cookbook/include-additional-latex-packages.html

I have started to provide a list of packages which may be useful for R Markdown documents. I can see this expanding into its own section with some more examples on their use. Any suggestions for useful packages are welcome!