From bfa734c402fab970c1abebf1d6c1429f060082b8 Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Sun, 4 Dec 2016 21:15:10 +0100 Subject: 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 --- tests/Tests/Writers/LaTeX.hs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'tests/Tests/Writers') 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}" + ] ] ] ] -- cgit v1.2.3