Wandmalfarbe / pandoc-latex-template

A pandoc LaTeX template to convert markdown files to PDF or LaTeX.
BSD 3-Clause "New" or "Revised" License
6.01k stars 957 forks source link

Feature Request: Add option to use additional packages #329

Closed firefart closed 1 year ago

firefart commented 1 year ago

It would be great to add an option to add additional packages through the yml header.

If I want to \usepackage{pgf-pie} for example (to generate pie charts) this is currently not possible because the \usepackage instructions must come before \being{document}.

I would suggest adding an array of packages to the yml section and then looping over all of them and add \usepackage instructions for every single one.

daamien commented 1 year ago

Have you looked at --include-before-body and include-before: ?

https://pandoc.org/MANUAL.html#option--include-before-body

firefart commented 1 year ago

@daamien Yes but this option also includes the contents after the \begin{document}. This just inserts the content at the beginning of the body, but the \usepackage needs to be before \begin.

firefart commented 1 year ago

Ok managed it with the following in the metadata yml:

header-includes: |
  \usepackage{tikz}
  \usepackage{pgf-pie}

Thanks!

daamien commented 1 year ago

How about --include-in-header= and header-includes: then ?