diff options
author | John MacFarlane <jgm@berkeley.edu> | 2015-05-27 12:01:49 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2015-05-27 12:01:49 -0700 |
commit | c841b15d254b77169f1c27e0eca3c996b9b83596 (patch) | |
tree | 2664d23e110fe9ce105e7b30af1b76b01703ced0 | |
parent | adfb217622a482ad716d9e65e48caef38f7c3654 (diff) | |
download | pandoc-c841b15d254b77169f1c27e0eca3c996b9b83596.tar.gz |
LaTeX writer: Make `mainlang` work when `lang` is in metadata.
Closes #2174.
-rw-r--r-- | src/Text/Pandoc/Writers/LaTeX.hs | 5 |
1 files changed, 3 insertions, 2 deletions
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 ) |