Skip to content
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

Regression: Markdown to LaTeX conversion doesn't always recognize unnumbered headers #3272

Closed
bwhelm opened this issue Dec 3, 2016 · 3 comments

Comments

@bwhelm
Copy link

bwhelm commented Dec 3, 2016

Pandoc versions >= 1.18 sometimes do not recognize unnumbered headers, whereas pandoc 1.17.2 does in the same conditions. This happens with a 4th-level header and with --chapters (or --top-level-division=chapter) specified. See pandoc runs below.

> pandoc --version
pandoc 1.17.2
Compiled with texmath 0.8.6.4, highlighting-kate 0.6.2.1.
<snip>

> pandoc -t latex --chapters
#### Testing {-}
\subsubsection*{Testing}\label{testing}
\addcontentsline{toc}{subsubsection}{Testing}

This is correct -- with \subsubsection*. Compare this with:

> pandoc --version
pandoc 1.19
Compiled with pandoc-types 1.17.0.4, texmath 0.9, highlighting-kate 0.6.3
<snip>

> pandoc -t latex --chapters
[pandoc warning] --chapters is deprecated. Use --top-level-division=chapter instead.
#### Testing {-}
\subsubsection{Testing}\label{testing}
\addcontentsline{toc}{subsubsection}{Testing}

Here, the * is wrongly omitted from \subsubsection.

This does not happen without specifying --chapters (or --top-level-division=chapter); nor does it happen with 1st--3rd level headings.

@jgm
Copy link
Owner

jgm commented Dec 3, 2016

I think I see what is happening.

+  let star = if unnumbered && level < 4 then text "*" else empty

This is to avoid adding a star to \paragraph, which can't take one.
Normally a level 4 header is a \paragraph, but when you use --chapters it becomes a \subsubsection. So this needs some revision.

tarleb added a commit to tarleb/pandoc that referenced this issue Dec 3, 2016
Headers of depth four were not marked as unnumbered.

Fixes: jgm#3272
@tarleb
Copy link
Collaborator

tarleb commented Dec 3, 2016 via email

@jgm
Copy link
Owner

jgm commented Dec 4, 2016 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants