Having the Index appear the Table of Contents

36 views
Skip to first unread message

Paul Dubois

unread,
Dec 28, 2016, 1:49:27 PM12/28/16
to sphinx-users
I am writing books that I want to render in html, latexpdf, and epub. 

I want the TOC to include a last line Index that shows or links to (depending on output format) the page where the index starts.

In html, the pages have the "index" button (at least using the "traditional" style).  In the pdf and epub, the index is back there, but the only way to get to it is to choose the last chapter and start scrolling. 

sphinx-quickstart produces something that looks like it is intended to make an "Index" chapter, but in fact produces two literal lines in the pdf with the actual index starting on the next page.

I don't want to get to editing the latex output or anything like that, it is above my pay-grade. What's the Sphinx magic? Or is this just a bug?


gilberto dos santos alves

unread,
Dec 28, 2016, 5:41:17 PM12/28/16
to sphinx...@googlegroups.com
[1] http://www.sphinx-doc.org/en/1.5.1/tutorial.html
hi. have you read this good simple tutorial?

--
gilberto dos santos alves
+55(11)9-8646-5049
sao paulo - sp - brasil





--
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 https://groups.google.com/group/sphinx-users.
For more options, visit https://groups.google.com/d/optout.

Paul Dubois

unread,
Dec 28, 2016, 9:16:41 PM12/28/16
to sphinx...@googlegroups.com
Yes, of course.  Do you believe the answer to my question is in it and I missed it?

Perhaps I have not asked clearly. I want the main table of contents to list/link to  the page the index begins on, as if it was another chapter.  Otherwise, in latexpdf in particular there is no link to get there; and even in a physical copy, no way to suspect it is back there unless you go looking.

The file generated by sphinx-quickstart does not result in a satisfactory output.

On Wed, Dec 28, 2016 at 2:41 PM gilberto dos santos alves <gsa...@gmail.com> wrote:
[1] http://www.sphinx-doc.org/en/1.5.1/tutorial.html
hi. have you read this good simple tutorial?

--
gilberto dos santos alves
+55(11)9-8646-5049
sao paulo - sp - brasil





2016-12-28 16:49 GMT-02:00 Paul Dubois <pfdu...@gmail.com>:
I am writing books that I want to render in html, latexpdf, and epub. 

I want the TOC to include a last line Index that shows or links to (depending on output format) the page where the index starts.

In html, the pages have the "index" button (at least using the "traditional" style).  In the pdf and epub, the index is back there, but the only way to get to it is to choose the last chapter and start scrolling. 

sphinx-quickstart produces something that looks like it is intended to make an "Index" chapter, but in fact produces two literal lines in the pdf with the actual index starting on the next page.

I don't want to get to editing the latex output or anything like that, it is above my pay-grade. What's the Sphinx magic? Or is this just a bug?


--
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...@googlegroups.com.

To post to this group, send email to sphinx...@googlegroups.com.
Visit this group at https://groups.google.com/group/sphinx-users.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "sphinx-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/sphinx-users/H6f8LLWTgvk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to sphinx-users...@googlegroups.com.

Martin Bless

unread,
Dec 29, 2016, 4:36:02 AM12/29/16
to sphinx...@googlegroups.com
Hi Paul,

[Paul Dubois]:
> I am writing books that I want to render in html, latexpdf, and epub.
>
> I want the TOC to include a last line Index that shows or links to
> (depending on output format) the page where the index starts.

you may find one path to a solution here:
https://docs.typo3.org/News/2016/Index.html#cool-stuff-for-nerds-special-templates-available


See what I did there to create a sitemap. The idea is that you have an
extra template and select that by means of page properties. My page has
normal contents first (that appears in the TOC) and "knows" how to
generate the special contents. In my case it's a sitemap, in your case
it would be then index.

You would have to adapt that somehow similar like::


:template: myindex.html

.. _MyIndex:

======================
My Index
======================

.. template 'myindex.html' will insert the Index here below normal contents




Patting myself on the shoulders I still find that using page properties like that is a clever idea :-)

You would have to create the template file :file:`myindex.html` of course.

Martin

https://github.com/TYPO3-Documentation/t3SphinxThemeRtd/blob/master/t3SphinxThemeRtd/sitemap.html

https://github.com/sphinx-doc/sphinx/blob/master/sphinx/themes/basic/genindex.html

--
http://mbless.de

Paul Dubois

unread,
Dec 29, 2016, 11:48:33 AM12/29/16
to sphinx...@googlegroups.com
Thank you, Martin. It is way over my head, as I don't even know what a template is.  I come at this from scientific computing and not web development. Since I have a limited goal perhaps I can get this done by experiment from your suggestion.  I have seen in my searching that a lot of people have encountered this problem.

Reply all
Reply to author
Forward
0 new messages