-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HTML table of contents with toc :true
in the yaml metablock?
#2872
Comments
Pandoc's writers populate the The difference between HTML and LaTeX (PDF) is that in
while in HTML, there is nothing like a It would be possible to treat +++ joelostblom [Apr 22 16 15:09 ]:
|
Thank you for the explanation! If I understand you correctly, the solution I was imagining is similar to what you suggested. Simply activating I can't say if this is a satisfactory solution technically, but just from a user standpoint, I would intuitively expect |
I faced the same problem and like the proposed solution. |
Well, it seems to me that |
I had the same issue, and it took me a while to stumble across this bug report. I vote for @equaeghe's idea, that looks like the cleanest solution. Also, to provide backward compatibility for existing templates, if --toc is specified on the command line, and not defined in the metadata, then set |
Yes, I think @equaeghe's idea is a good one. |
Hi, To me the behaviour is a bit unexpected. Take this minimal file: ---
title: Title1
toc: true
---
## Title2
Paragraph
In order to get the table of content I need to add the After reading the templates I understand how this was designed to be the expected behaviour in the sense that Thanks for this amazing tool! |
The YAML setting `toc: true` works for PDF creation but for HTML it simply prints `true` as the table of contents. It looks like a misconception and the only acceptable solution I have found is to use `--toc` on the command line instead of the `toc: true` setting in the YAML header. It is a known issue, here are more details: jgm/pandoc#2872 With this fix I get table of contents not only for PDF but for HTML too. The PDF looks like before for me, the table of contents and the outline are still present as it was before.
The YAML setting `toc: true` works for PDF creation but for HTML it simply prints `true` as the table of contents. It looks like a misconception and the only acceptable solution I have found is to use `--toc` on the command line instead of the `toc: true` setting in the YAML header. It is a known issue, here are more details: jgm/pandoc#2872 With this fix I get table of contents not only for PDF but for HTML too. The PDF looks like before for me, the table of contents and the outline are still present as it was before.
When I generate an html-document from a markdown-file with
toc: true
in the yaml-metablock, the resulting html-file has the word "true" at the top of the document instead of an actual table of contents. When I add--toc
to the pandoc command, it still only prints "true". When I removetoc: true
from the markdown file and add--toc
to the pandoc command, the html-document displays a table of contents.Is it possible make
toc: true
in the yaml-metablock generate a table of contents in the html document, similar to how the generation of pdf files works (wheretoc: true
and--toc
produce the same output)?The text was updated successfully, but these errors were encountered: