Le 17/09/2018 à 19:05, ChrisD a écrit :
Le 17/09/2018 à 15:40, ChrisD a écrit :
Le 16/09/2018 à 02:56, ChrisD a écrit :
I just upgraded from version 1.7.5 to 1.8.0. When I output to latex PDF the 
table of contents (TOC) not longer appears.

In 1.7.5 there is a TOC in the text, starting on the 2nd page of the output, right after 
the title page. This 2nd page is titled "CONTENTS". There is also a 
bookmark-style TOC that appears in the left pane of my PDF viewer (and which is far more 
useful than the TOC in the text).

In 1.8.0 there is no bookmark-style TOC. In the text, the 2nd page is labeled 
"CONTENTS" but is otherwise blank.

I reviewed the change list, and it notes under incompatible changes that the 
latex tableofcontents variable has been moved to the template. Do I need to do 
something with a template? If so, how? The latex customization page says that 
one can use an experimental feature for a user defined template but gives no 
clue what it should look like and says all template variables are unstable and 
undocumented.

I'm running on Win7-64 and using MiKTeX, if it matters.

Any suggestions? Thanks,
Chris



Hi,

How do you build the PDF?

Perhaps there was another problem which caused an abort after only one pdflatex 
run.

To dispel worries about template, can you check your <document>.tex in LaTeX 
build repertory contains `\sphinxtableofcontents` somewhere after `\begin{document}`?

Even without it, the PDF should get the chapter/section bookmarks, if pdflatex 
has been executed at least twice.

My bet is that it got executed only once.

It may help to remove left-over latex build repertory, and start build from 
scratch again, as latex auxiliary files are always susceptible to cause 
troubles after an upgrade.

Best,

Jean-François

I'm embarrassed to admit that I had completely forgotten about the need to run 
pdflatex (or make) twice. And because I was having problems I was clearing the 
build folder each time I tried it (to avoid the auxiliary files problem which I 
had experienced before), so it would fail again. Just running make again 
without clearing solved the problem. Thanks for your help.

Chris


Hi Chris,

Good you could fix this.

Unfortunately I can't help with Windows,

on Unixen:

  either make latexpdf in the source repertory or

  make latex there followed by make all-pdf in the latex build repertory

should do automatically the needed number of pdflatex runs...

I can't test on Windows...

Cheers,

Jean-François


The sphinx pdf make is broken on windows.
Older versions of sphinx invoked "make" but there is no make installed by 
default on windows so that failed.
Version 1.8.0 appears to attempt to fix this by creating a secondary make.bat 
batch file in the _build/latex folder. However it invokes latexmk, which is 
installed by MiKTeX, but requires perl to be installed. Perl is also not 
installed by default on windows, so that fails.


I see. At 
https://github.com/sphinx-doc/sphinx/blob/914d93a9e161077382539eb3ee9045343f1b56b1/sphinx/texinputs_win/Makefile_t#L70-L76

You get to see the old Makefile not using Latexmk

It did pdflatex 3 times, makeindex, then pdflatex 2 times.


I suppose I could install perl, but I took a somewhat brute force approach and modified 
my primary make.bat batch file so it runs Sphinx to build latex (not latexpdf), and then 
runs pdflatex twice. So at least now the "run twice" thing is automated.



If you don't use the ``index`` role or directive in your document then this 
should be enough, although sometimes longtable requires an extra LaTeX run due 
to some circumstances.

(a script could search near end of LaTeX log output for a "Run LaTeX again" message which is 
emitted by longtable is some cases ; I don't recall if it is "Run" or "run")

If you do need makeindex, then you must run twice pdflatex after it for "Index" 
to show in the bookmarks.

(and you many need to have run pdflatex twice *before* so that page numbers are 
ok in indexed entries, although in 'manual' class this may be ok because page 
numbering starts after table of contents, but with 'howto' class the problem 
will arise that after only 1 pdflatex the TOC is empty, but after second run it 
has entries, possibly shifting by 1 page numbers after it)

Side note: last time I checked RTD did

pdflatex twice
makeindex
pdflatex

but this causes missing Index entry in TOC.

Best,

Jean-François



--
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+unsubscr...@googlegroups.com.
To post to this group, send email to sphinx-users@googlegroups.com.
Visit this group at https://groups.google.com/group/sphinx-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to