aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2015-02-20 09:58:37 +0000
committerMatthew Pickering <matthewtpickering@gmail.com>2015-02-20 09:58:37 +0000
commit3e81c3a0a6b20be53cd7156c1dce6e49470352b9 (patch)
tree5f21720b95a1df327877ab597ede3676a120290d /src/Text/Pandoc/Writers
parent29955267722d30708e6acb5425f64cc02c796be0 (diff)
parent274efc4a71d6d18d7d3fe725e3476a9ee4b8ae21 (diff)
downloadpandoc-3e81c3a0a6b20be53cd7156c1dce6e49470352b9.tar.gz
Merge pull request #1964 from mpickering/latexfix
LaTeX Writer: Don't use listings in headers
Diffstat (limited to 'src/Text/Pandoc/Writers')
-rw-r--r--src/Text/Pandoc/Writers/LaTeX.hs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/Text/Pandoc/Writers/LaTeX.hs b/src/Text/Pandoc/Writers/LaTeX.hs
index 0e5ec5c18..64e36ca0b 100644
--- a/src/Text/Pandoc/Writers/LaTeX.hs
+++ b/src/Text/Pandoc/Writers/LaTeX.hs
@@ -701,7 +701,7 @@ inlineListToLaTeX lst =
("\\\\[" ++ show (length lbs) ++
"\\baselineskip]") : fixBreaks rest
fixBreaks (y:ys) = y : fixBreaks ys
-
+
isQuoted :: Inline -> Bool
isQuoted (Quoted _ _) = True
isQuoted _ = False
@@ -750,10 +750,11 @@ inlineToLaTeX (Cite cits lst) = do
inlineToLaTeX (Code (_,classes,_) str) = do
opts <- gets stOptions
+ inHeading <- gets stInHeading
case () of
- _ | writerListings opts -> listingsCode
+ _ | writerListings opts && not inHeading -> listingsCode
| writerHighlight opts && not (null classes) -> highlightCode
- | otherwise -> rawCode
+ | otherwise -> rawCode
where listingsCode = do
inNote <- gets stInNote
when inNote $ modify $ \s -> s{ stVerbInNote = True }