Pandoc - Inserting pages before generated Table of Contents

前端 未结 4 1993
心在旅途
心在旅途 2020-12-16 12:03

I\'ve been playing around with Pandoc.

Is there anyway to insert pages before the generated Table of Contents?

For example:

  • Title Page
4条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-16 13:04

    None of these solutions worked for me, and one top-level comment suggested using Pandoc templates without details. So here's a simple fix.

    • Download the default Pandoc template from here: https://github.com/jgm/pandoc-templates, e.g. I used default.tex but renamed it template.tex.

    • Modify the template to insert additional content, create new pages, etc. e.g.:

      \input{title.tex}
      \newpage
      \input{acknowledgements.tex}
      \newpage
      
      $if(toc)$
      $if(toc-title)$
      \renewcommand*\contentsname{$toc-title$}
      $endif$
      
      \newpage
      
    • Use this modified template rather than the default template, e.g.

      pandoc --template=template.tex -o document.pdf document.tex`.
      

    That's it.

提交回复
热议问题