Mark
Mark

Reputation: 3575

How can I add a foreword or a preface before the TOC in a (pdflatex) sphinx document?

How can I use Sphinx to generate a pdflatex document in which there is some text before the table of contents? The generated LaTeX file always seems to have \tableofcontents before any document-body text.

I have been unable to find any information / documentation on this, and I'd appreciate it if anyone has any tips. I am not interested in 'manual' solutions which require modifying the tex file directly -- I am looking for directives / options which can be specified directly within rst files.

Upvotes: 7

Views: 1904

Answers (1)

Kevin Horn
Kevin Horn

Reputation: 4295

Try setting a value for latex_elements['preamble'] in your conf.py file.

Upvotes: 0

Related Questions