==== Chapter Appendix =====

37 views
Skip to first unread message

Geert Stappers

unread,
Jun 5, 2019, 12:33:02 PM6/5/19
to sphinx...@googlegroups.com
Hi,


How to make appendix appear  as appendix?


Example.rst:

----------------------------

===

Foo

===

Chapter content


===

Bar

===

Appendix content

----------------------------


Both, "Foo" and "Bar", get rendered as chapters in output.pdf.


In LaTeX  there is an  appendix package for say where appendicey start.


How to tell in the  .rst  file that  "Bar" should be an Appendix?



Regards

Geert Stappers





jfbu

unread,
Jun 5, 2019, 4:07:21 PM6/5/19
to sphinx...@googlegroups.com
Hi Geert,
This should work

===
Foo
===

Chapter content


.. raw:: latex

\appendix

===
Bar
===

Appendix content


All chapters after that will become appendices in the PDF.

\appendix macro is part of standard LaTeX report class which Sphinx uses by default.

If you need something more sophisticated you can probably load additional LaTeX packages via 'preamble' key of latex_elements, and insert the suitable raw latex code as above.

Regards

Jean-François

Geert Stappers

unread,
Jun 5, 2019, 6:03:38 PM6/5/19
to sphinx...@googlegroups.com
Yes, it does.  Thanks


>
> \appendix macro is part of standard LaTeX report class which Sphinx
> uses by default.
>
> If you need something more sophisticated you can probably load
> additional LaTeX packages via 'preamble' key of latex_elements, and
> insert the suitable raw latex code as above.
>
> Regards
>
> Jean-François


Regards

Geert



Stefano David

unread,
Jun 6, 2019, 11:08:19 AM6/6/19
to sphinx-users
HI,
I use a different approach to add appendices in LaTeX.

This should work

===
Foo
===

Chapter content


.. raw:: latex

    \appendix

===
Bar
===

Appendix content


In index.rst (I hope that indentation remains):

.. toctree::

   foo

.. only:: html

   .. toctree::
      bar

and in conf.py I have

latex_appendices = ['bar']

Best regards,
Stefano
Reply all
Reply to author
Forward
0 new messages