Wed 25 Apr 2012 01:25:55 PM UTC, comment #12:
In this example I'm working on the attached fangle.tm (and fangle.ts) which has an empty toc in the body and empty references and toc in the aux.
1. basic
texmacs -c fangle.tm fangle.pdf -q
Result:
toc (page 5) is blank
code references (page 24) have no page numbers (only ?) and no forward references
2. Extra pagination
texmacs -c fangle.tm fangle.pdf -x '(print-to-file "fangle.pdf")' -q
Result:
toc still blank
code references (page 24) have page numbers. Back references have page numbers and foward references exist but without page numbers (?)
3. (style-clear-cache) can update references too
but we need to generate another pdf of course
texmacs -c fangle.tm fangle.pdf -x '(print-to-file "fangle.pdf") (style-clear-cache) (print-to-file "fangle.pdf")' -q
Result:
toc still blank
code references all have page numbers including back and forward links
4. try toc with (generate-all-aux)
Of course when the toc is inserted, all the page numbers will be wrong, but we should get a same-length toc with missing page numbers if we (generate-all-aux) first.
texmacs -c fangle.tm fangle.pdf -x '(generate-all-aux) (print-to-file "fangle.pdf") (style-clear-cache) (print-to-file "fangle.pdf")' -q
Result:
toc is correct. The generate-all-aux inserts the toc, the print-to-file re-paginates, the style-clear-cache allows the new page numbers to show, and the final print-to-file produces the pdf.
forward code-references are now incorrect. On page 26, 26e next-ref points to 24f which should be 26f.
26f previous-ref points to 26e which is correct.
5. How to update forward references now the toc is here?
Extra invocations of (style-clear-cache) or (update-current-buffer) or (generate-all-aux) are without effect
(style-clear-cache) was enough to generate forward links in test 3.
It seems that the "-c" was doing something for us not being done here, for if I remove -c and try load-buffer insead:
texmacs -x '(load-buffer "file:///media/BIGSAM/Projects/fangle/fangle.tm") (generate-all-aux) (print-to-file "fangle.pdf") (generate-all-aux) (update-current-buffer) (style-clear-cache) (print-to-file "fangle.pdf")' -q
Then I find that forward code references are missing the page number, and again nothing can bring them back!
The summary is that I have no spell to render a pdf with valid links from a file with empty aux and empty toc in the body.
(file #25732, file #25733)
|