git.iko.soy/typeable/pandoc
on master help sign in
LaTeX writer: Omit lists with no items.

Otherwise we get LaTeX errors.

commit8dd00b93e2489b665aaa5503cef7d03ba8ad3a46 authorJohn MacFarlane <fiddlosopher@gmail.com> dateSat 16 Feb 2013, 17:44 (14 years ago) parenteca8c60
1 file changed+3
src/Text/Pandoc/Writers/LaTeX.hs+3
src/Text/Pandoc/Writers/LaTeX.hs+3
@@ -346,6 +346,7 @@ blockToLaTeX (CodeBlock (_,classes,keyvalAttr) str) = do
346346 return (flush $ text h)
347347blockToLaTeX (RawBlock "latex" x) = return $ text x
348348blockToLaTeX (RawBlock _ _) = return empty
349+blockToLaTeX (BulletList []) = return empty -- otherwise latex error
349350blockToLaTeX (BulletList lst) = do
350351 incremental <- gets stIncremental
351352 let inc = if incremental then "[<+->]" else ""
@@ -355,6 +356,7 @@ blockToLaTeX (BulletList lst) = do
355356 else empty
356357 return $ text ("\\begin{itemize}" ++ inc) $$ spacing $$ vcat items $$
357358 "\\end{itemize}"
359+blockToLaTeX (OrderedList _ []) = return empty -- otherwise latex error
358360blockToLaTeX (OrderedList (start, numstyle, numdelim) lst) = do
359361 st <- get
360362 let inc = if stIncremental st then "[<+->]" else ""
@@ -393,6 +395,7 @@ blockToLaTeX (OrderedList (start, numstyle, numdelim) lst) = do
393395 $$ spacing
394396 $$ vcat items
395397 $$ "\\end{enumerate}"
398+blockToLaTeX (DefinitionList []) = return empty
396399blockToLaTeX (DefinitionList lst) = do
397400 incremental <- gets stIncremental
398401 let inc = if incremental then "[<+->]" else ""