7

By default the vertical spacing on sections is quite large with the pandoc default.latex template. Is there a way to pass an argument to reduce the size of the spacing?

I see that there is a titlesec package, however I'd like to keep using the default.latex template if possible without having to modify it.

IF I need to modify the template, is there a clever way to do it rather than copying the entire default.latex template?

2 Answers 2

5

You can also use the YAML header to put commands in the preamble:

---
header-includes:
    - \usepackage{titlesec}
    - \titleformat*{\section}{\itshape}
---
1
  • Ah! good one! Only available from version 1.12.2 though
    – Bordaigorl
    Dec 2, 2014 at 16:30
2

From the User Guide:

-H FILE, --include-in-header=FILE

Include contents of FILE, verbatim, at the end of the header. [...] This option can be used repeatedly to include multiple files in the header. They will be included in the order specified. Implies --standalone.

You can then put your customisation code in FILE. The code inside FILE will be inserted at the end of the preamble before \begin{document} so you can import additional packages using \usepackage.

Additionally you can use

-B FILE, --include-before-body=FILE

Include contents of FILE, verbatim, at the beginning of the document body (e.g. after [...] the \begin{document} command in LaTeX). [...] This option can be used repeatedly to include multiple files. They will be included in the order specified. Implies --standalone.

-A FILE, --include-after-body=FILE

Include contents of FILE, verbatim, at the end of the document body (before [...] the \end{document} command in LaTeX). This option can be be used repeatedly to include multiple files. They will be included in the order specified. Implies --standalone.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .