Skip to content

Commit

Permalink
LaTeX writer: properly handle unnumbered headings level 4+.
Browse files Browse the repository at this point in the history
Closes #6018.

Previously the `\paragraph` command was used instead of
`\paragraph*` for unnumbered level 4 headings.
  • Loading branch information
jgm committed Jan 2, 2020
1 parent 4affd40 commit 2c1a911
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Text/Pandoc/Writers/LaTeX.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1010,7 +1010,7 @@ sectionHeader classes ident level lst = do
-- see http://tex.stackexchange.com/questions/169830/
else empty
lab <- labelFor ident
let star = if unnumbered && level' < 4 then text "*" else empty
let star = if unnumbered then text "*" else empty
let stuffing = star <> optional <> contents
stuffing' <- hypertarget True ident $
text ('\\':sectionType) <> stuffing <> lab
Expand Down
2 changes: 1 addition & 1 deletion test/Tests/Writers/LaTeX.hs
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ tests = [ testGroup "code blocks"
, "\\addcontentsline{toc}{subsection}{header4}\n"
, "\\subsubsection*{header5}"
, "\\addcontentsline{toc}{subsubsection}{header5}\n"
, "\\paragraph{header6}"
, "\\paragraph*{header6}"
, "\\addcontentsline{toc}{paragraph}{header6}"
]
]
Expand Down

0 comments on commit 2c1a911

Please sign in to comment.