How to handle appendices properly

796 views
Skip to first unread message

jani...@gmail.com

unread,
Nov 7, 2014, 8:57:22 AM11/7/14
to sphinx...@googlegroups.com
Sphinx is a great tool -- thanks for making it available.

***

Would someone help me to achieve the following?
  • I want the main matter of my Sphinx document to be numbered.
  • I want a single glossary reST document to follow the main matter un-numbered.
  • I want the aforementioned glossary to appear as an appendix in LaTeX PDF output.
***

I acheive the above in HTML with the following (in my index.rst):

..  toctree::
    :numbered:
    :maxdepth: 2

    chap-01
    chap-02
    chap-03

..  toctree::

    glossary

And I also get the glossary to appear as a LaTeX appendix using the following in my conf.py:

latex_appendices = ['glossary']


HOWEVER, the glossary appears twice in the LaTeX output: once as a numbered chapter, again as an appendix.

Can someone give me some insight?

Respectfully,

Jason

Takayuki Shimizukawa

unread,
Nov 8, 2014, 1:51:39 AM11/8/14
to sphinx...@googlegroups.com
Hi,

Well..., latex_appendices includes your 'glossary' page automatically, and your index.rst also includes 'glossary' by using 'toctree' directive.
If you want to use single index.rst for html and latex output, I suggest a workaround as:

.. only:: html

   .. toctree::

      glossary

I don't think it's the best, but works for me.
Regards,

--
You received this message because you are subscribed to the Google Groups "sphinx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sphinx-users+unsubscribe@googlegroups.com.
To post to this group, send email to sphinx...@googlegroups.com.
Visit this group at http://groups.google.com/group/sphinx-users.
For more options, visit https://groups.google.com/d/optout.

Jason Massey

unread,
Nov 8, 2014, 4:36:38 PM11/8/14
to sphinx...@googlegroups.com

It works!! Thank you!

To unsubscribe from this group and stop receiving emails from it, send an email to sphinx-users...@googlegroups.com.

Jason Massey

unread,
Nov 8, 2014, 4:36:39 PM11/8/14
to sphinx...@googlegroups.com

Will try it: thank you!

On Nov 8, 2014 1:51 AM, "Takayuki Shimizukawa" <shimi...@gmail.com> wrote:
To unsubscribe from this group and stop receiving emails from it, send an email to sphinx-users...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages