From bec95c97ace807b4f6c6ad359bf0b310b905f707 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 11 Jun 2019 20:43:20 -0700 Subject: LaTeX writer: Don't highlight code in headings. This causes compilation errors, and I don't know how to work around them. Closes #5574. --- src/Text/Pandoc/Writers/LaTeX.hs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/Text/Pandoc/Writers/LaTeX.hs') diff --git a/src/Text/Pandoc/Writers/LaTeX.hs b/src/Text/Pandoc/Writers/LaTeX.hs index 9933c6d36..3acf80866 100644 --- a/src/Text/Pandoc/Writers/LaTeX.hs +++ b/src/Text/Pandoc/Writers/LaTeX.hs @@ -1190,10 +1190,11 @@ inlineToLaTeX (Code (_,classes,kvs) str) = do Right h -> modify (\st -> st{ stHighlighting = True }) >> return (text (T.unpack h)) case () of - _ | writerListings opts && not (inHeading || inItem) -> listingsCode + _ | inHeading || inItem -> rawCode -- see #5574 + | writerListings opts -> listingsCode | isJust (writerHighlightStyle opts) && not (null classes) - -> highlightCode - | otherwise -> rawCode + -> highlightCode + | otherwise -> rawCode inlineToLaTeX (Quoted qt lst) = do contents <- inlineListToLaTeX lst csquotes <- liftM stCsquotes get -- cgit v1.2.3