aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc
diff options
context:
space:
mode:
authorJohn MacFarlane <fiddlosopher@gmail.com>2012-11-04 11:09:15 -0800
committerJohn MacFarlane <fiddlosopher@gmail.com>2012-11-04 11:09:42 -0800
commita2cb53640defcbd672ae26d517ee54479a13a32a (patch)
treeaca2d0be535641e583d1c59295ff902a1d274611 /src/Text/Pandoc
parent0c5801297d02b4407a5ba6101bfa779e5ce6d500 (diff)
downloadpandoc-a2cb53640defcbd672ae26d517ee54479a13a32a.tar.gz
LaTeX writer: Don't use [fragile] unnecessarily.
We were using [fragile] on slides even if they only contained code that was rendered using `\texttt`. Now `[fragile]` is only used for slides containing inline code if that code is rendered using listings. Closes #649.
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r--src/Text/Pandoc/Writers/LaTeX.hs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Writers/LaTeX.hs b/src/Text/Pandoc/Writers/LaTeX.hs
index 4929bb2a9..3d25e0fc9 100644
--- a/src/Text/Pandoc/Writers/LaTeX.hs
+++ b/src/Text/Pandoc/Writers/LaTeX.hs
@@ -238,7 +238,11 @@ elementToBeamer slideLevel (Sec lvl _num _ident tit elts)
hasCodeBlock _ = []
let hasCode (Code _ _) = [True]
hasCode _ = []
- let fragile = if not $ null $ queryWith hasCodeBlock elts ++ queryWith hasCode elts
+ opts <- gets stOptions
+ let fragile = if not $ null $ queryWith hasCodeBlock elts ++
+ if writerListings opts
+ then queryWith hasCode elts
+ else []
then "[fragile]"
else ""
let slideStart = Para $ RawInline "latex" ("\\begin{frame}" ++ fragile) :