git.iko.soy/typeable/pandoc
on master help sign in
LaTeX writer: Make `mainlang` work when `lang` is in metadata.

Closes #2174.

commitc841b15d254b77169f1c27e0eca3c996b9b83596 authorJohn MacFarlane <jgm@berkeley.edu> dateWed 27 May 2015, 12:01 (11 years ago) parentadfb217
1 file changed+3−2
src/Text/Pandoc/Writers/LaTeX.hs+3−2
src/Text/Pandoc/Writers/LaTeX.hs+3−2
@@ -161,8 +161,9 @@ pandocToLaTeX options (Pandoc meta blocks) = do
161161 defField "euro" (stUsesEuro st) $
162162 defField "listings" (writerListings options || stLHS st) $
163163 defField "beamer" (writerBeamer options) $
164− defField "mainlang" (maybe "" (reverse . takeWhile (/=',') . reverse)
165− (lookup "lang" $ writerVariables options)) $
164+ defField "mainlang"
165+ (maybe "" (reverse . takeWhile (/=',') . reverse)
166+ (getField "lang" metadata)) $
166167 (if stHighlighting st
167168 then defField "highlighting-macros" (styleToLaTeX
168169 $ writerHighlightStyle options )