git.iko.soy/typeable/pandoc
on master help sign in
Merge pull request #1964 from mpickering/latexfix

LaTeX Writer: Don't use listings in headers

commit3e81c3a0a6b20be53cd7156c1dce6e49470352b9 authorMatthew Pickering <matthewtpickering@gmail.com> dateFri 20 Feb 2015, 09:58 (12 years ago) parent2995526274efc4
1 file changed+4−3
src/Text/Pandoc/Writers/LaTeX.hs+4−3
src/Text/Pandoc/Writers/LaTeX.hs+4−3
@@ -701,7 +701,7 @@ inlineListToLaTeX lst =
701701 ("\\\\[" ++ show (length lbs) ++
702702 "\\baselineskip]") : fixBreaks rest
703703 fixBreaks (y:ys) = y : fixBreaks ys
704−
704+
705705isQuoted :: Inline -> Bool
706706isQuoted (Quoted _ _) = True
707707isQuoted _ = False
@@ -750,10 +750,11 @@ inlineToLaTeX (Cite cits lst) = do
750750
751751inlineToLaTeX (Code (_,classes,_) str) = do
752752 opts <- gets stOptions
753+ inHeading <- gets stInHeading
753754 case () of
754− _ | writerListings opts -> listingsCode
755+ _ | writerListings opts && not inHeading -> listingsCode
755756 | writerHighlight opts && not (null classes) -> highlightCode
756− | otherwise -> rawCode
757+ | otherwise -> rawCode
757758 where listingsCode = do
758759 inNote <- gets stInNote
759760 when inNote $ modify $ \s -> s{ stVerbInNote = True }