Markdown to Latex (PDF) #2395
frafor
commented
You can use the --chapters command-line option to make
level-1 headers be treated as chapters.
Pandoc will look at the template and do this automatically
if you have documentclass{book}. Or, at least, it should --
perhaps some special feature of your setup is preventing
this from working. But the most reliable method is to
use --chapters explicitly.
+++ Franz J Fortuny L de M [Sep 13 15 21:18 ]:
…
Yes, the current code checks the template directly;
it doesn't check the documentclass metadata field.
(This code dates from before YAML metadata.)
But we could change it to check this too.
Ubuntu tends to have old versions of pandoc in the
repository. You might consider using the deb package
I provide instead, for an up-to-date version.
+++ Franz J Fortuny L de M [Sep 14 15 07:43 ]:
…
There's a template variable for this, which must be set in
a specific way. The plan is to make this work in a uniform
way for all formats, with a `lang` variable that takes
standardized values, but I haven't had a chance to work on
this lately. Soon, I hope.
+++ Franz J Fortuny L de M [Sep 14 15 09:19 ]:
…
TODO: check the documentclass
metadata variable in addition to the template, when looking for book
classes.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When doing Markdown to LaTeX (for PDF) transformation, we see that if what is requested is the documentclass book, then the numeric index is formed starting with Chapter 0 and ending with Chapter 0, as if ALL sections were from chapter zero.
This is because you are tranforming the new ONE-POUNT (#, or h1) as section instead of chapter when the documentclass is book.
If documentclass is article, then, fine: h1 h2 etc become sections; but LaTeX demands that h1 becomes Chapter title when a book is generated from a quite a long markdown text, with h1 (#) symbols considered Chapter's titles.
Please, review this; it works perfectly ok when generating an ePub book, but it fails because the Pandoc transformation mechanism or machine is not considering the type of documentclass (book) that is being generated in the LaTeX for PDF machine.