diff options
author | Albert Krewinkel <albert@zeitkraut.de> | 2016-12-04 21:15:10 +0100 |
---|---|---|
committer | Albert Krewinkel <albert@zeitkraut.de> | 2016-12-04 21:15:52 +0100 |
commit | bfa734c402fab970c1abebf1d6c1429f060082b8 (patch) | |
tree | daf88cf89ae3428fa8b6c632816cb2efa271fec7 /tests | |
parent | 85e8afe942d5bef9f6ce42368333efc0092a4b43 (diff) | |
download | pandoc-bfa734c402fab970c1abebf1d6c1429f060082b8.tar.gz |
LaTeX writer: Fix unnumbered headers when used with `--top-level`
Fix interaction of top-level divisions `part` or `chapter` with
unnumbered headers when emitting LaTeX. Headers are ensured to be
written using stared commands (like `\subsection*{}`).
Fixes: #3272
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Tests/Writers/LaTeX.hs | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/Tests/Writers/LaTeX.hs b/tests/Tests/Writers/LaTeX.hs index d8bfa5924..f140cc2dd 100644 --- a/tests/Tests/Writers/LaTeX.hs +++ b/tests/Tests/Writers/LaTeX.hs @@ -146,6 +146,28 @@ tests = [ testGroup "code blocks" , "\\subsection{header2}\n" , "\\subsubsection{header3}" ] + , test (latexTopLevelDiv TopLevelPart) + "part top-level, section not in toc" $ + ( headerWith ("", ["unnumbered"], []) 1 (text "header1") + <> headerWith ("", ["unnumbered"], []) 2 (text "header2") + <> headerWith ("", ["unnumbered"], []) 3 (text "header3") + <> headerWith ("", ["unnumbered"], []) 4 (text "header4") + <> headerWith ("", ["unnumbered"], []) 5 (text "header5") + <> headerWith ("", ["unnumbered"], []) 6 (text "header6")) + =?> + unlines [ "\\part*{header1}" + , "\\addcontentsline{toc}{part}{header1}\n" + , "\\chapter*{header2}" + , "\\addcontentsline{toc}{chapter}{header2}\n" + , "\\section*{header3}" + , "\\addcontentsline{toc}{section}{header3}\n" + , "\\subsection*{header4}" + , "\\addcontentsline{toc}{subsection}{header4}\n" + , "\\subsubsection*{header5}" + , "\\addcontentsline{toc}{subsubsection}{header5}\n" + , "\\paragraph{header6}" + , "\\addcontentsline{toc}{paragraph}{header6}" + ] ] ] ] |