git.iko.soy/typeable/pandoc
on master help sign in
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.

commita2cb53640defcbd672ae26d517ee54479a13a32a authorJohn MacFarlane <fiddlosopher@gmail.com> dateSun 4 Nov 2012, 11:09 (14 years ago) parent0c58012
1 file changed+5−1
src/Text/Pandoc/Writers/LaTeX.hs+5−1
src/Text/Pandoc/Writers/LaTeX.hs+5−1
@@ -238,7 +238,11 @@ elementToBeamer slideLevel (Sec lvl _num _ident tit elts)
238238 hasCodeBlock _ = []
239239 let hasCode (Code _ _) = [True]
240240 hasCode _ = []
241− let fragile = if not $ null $ queryWith hasCodeBlock elts ++ queryWith hasCode elts
241+ opts <- gets stOptions
242+ let fragile = if not $ null $ queryWith hasCodeBlock elts ++
243+ if writerListings opts
244+ then queryWith hasCode elts
245+ else []
242246 then "[fragile]"
243247 else ""
244248 let slideStart = Para $ RawInline "latex" ("\\begin{frame}" ++ fragile) :