You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
No table of content when choosing pdfroff as pdf engine. #5553
Is there special requirement to my input markdown document? According to philosophy of Pandoc, every valid inputs are supposed to be generated to a no error output.
@jgm Yes, there it is. But at the beginning I only see the few page in the front.
In addition, the entry of "Table of content" didn't appear in the left entries bar. It would be nice I can rapidly goto table of content page by clicking the entry in the side bar.
@jgm ,Yes, but for the toc left bar entry. It would be better to be unified with the other engine. The request to put table of content in front is much stronger than adding left side bar entry.
Macro: .TC [no]
Prints the table of contents on a new page, setting the page number to i (Roman lowercase numeral > one). You should usually place this macro at the end of the file, since groff is a single-pass formatter > and can only print what has been collected up to the point that the TC macro appears.
So moving it forward probably won't work (you'll get an empty toc).
Not sure what you mean by "the other engine."
We've always used pdfroff for conversion via ms.
Anyway, as you may have noticed, I've made a change that gives you both the things you wanted, relocating the TOC to the beginning (this can be disabled, the manual explains how) and adding it to the PDF bookmarks. I don't see any reason to communicate with the groff community about this.
Activity
jgm commentedon Jun 5, 2019
Looks like the groff ms
.TCmacro will add one.We just need to add something to the default template adding this if
tocis set, probably.jgm commentedon Jun 5, 2019
Well wait, it's there:
jgm commentedon Jun 5, 2019
Did you check the end of your document? Following groff custom, we added the .TC macro to the end, not the beginning. Perhaps we could change that.
stevenleeS0ht commentedon Jun 6, 2019
Is there special requirement to my input markdown document? According to philosophy of Pandoc, every valid inputs are supposed to be generated to a no error output.
mb21 commentedon Jun 6, 2019
What was the input? A small test case (just a few lines) is ideal. If your input is large, try to whittle it down to a minimum working example.
Finally, ask questions on pandoc-discuss and read the User's Guide.
jgm commentedon Jun 6, 2019
Again, let me ask: did you check the end of your document? the toc should be there.
stevenleeS0ht commentedon Jun 7, 2019
@jgm Yes, there it is. But at the beginning I only see the few page in the front.
In addition, the entry of "Table of content" didn't appear in the left entries bar. It would be nice I can rapidly goto table of content page by clicking the entry in the side bar.
mb21 commentedon Jun 7, 2019
For me, the following gives a table of contents on the second page:
on macOS with:
jgm commentedon Jun 7, 2019
So, if I understand correctly:
Is that all correct?
stevenleeS0ht commentedon Jun 8, 2019
@jgm ,Yes, but for the toc left bar entry. It would be better to be unified with the other engine. The request to put table of content in front is much stronger than adding left side bar entry.
jgm commentedon Jun 8, 2019
Groff docs say:
So moving it forward probably won't work (you'll get an empty toc).
jgm commentedon Jun 8, 2019
Wait, there's hope.
This diff gives you both of the things you want:
Two potential drawbacks of this change:
I think on the whole it's probably a good change, though.
With current pandoc, you can try adding
This should give you the PDF bookmark for the table of contents, but it will still appear at the end.
jgm commentedon Jun 8, 2019
--no-toc-relocationwas added in 0ae448e but the commit doesn't explain why.stevenleeS0ht commentedon Jun 8, 2019
@jgm , pdfroff is much faster than the other engine. As a result, speed issue is not problem.
However, it would be a good idea if we communicate with groff community.
This is just suggestion, It would be a good idea to absorb other users opinion.
jgm commentedon Jun 9, 2019
Not sure what you mean by "the other engine."
We've always used pdfroff for conversion via
ms.Anyway, as you may have noticed, I've made a change that gives you both the things you wanted, relocating the TOC to the beginning (this can be disabled, the manual explains how) and adding it to the PDF bookmarks. I don't see any reason to communicate with the groff community about this.
stevenleeS0ht commentedon Jun 11, 2019
Thanks!