From c841b15d254b77169f1c27e0eca3c996b9b83596 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Wed, 27 May 2015 12:01:49 -0700 Subject: LaTeX writer: Make `mainlang` work when `lang` is in metadata. Closes #2174. --- src/Text/Pandoc/Writers/LaTeX.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/Text/Pandoc/Writers') diff --git a/src/Text/Pandoc/Writers/LaTeX.hs b/src/Text/Pandoc/Writers/LaTeX.hs index a785e1edc..20ee4e4d8 100644 --- a/src/Text/Pandoc/Writers/LaTeX.hs +++ b/src/Text/Pandoc/Writers/LaTeX.hs @@ -161,8 +161,9 @@ pandocToLaTeX options (Pandoc meta blocks) = do defField "euro" (stUsesEuro st) $ defField "listings" (writerListings options || stLHS st) $ defField "beamer" (writerBeamer options) $ - defField "mainlang" (maybe "" (reverse . takeWhile (/=',') . reverse) - (lookup "lang" $ writerVariables options)) $ + defField "mainlang" + (maybe "" (reverse . takeWhile (/=',') . reverse) + (getField "lang" metadata)) $ (if stHighlighting st then defField "highlighting-macros" (styleToLaTeX $ writerHighlightStyle options ) -- cgit v1.2.3