aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2015-05-27 12:01:49 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2015-05-27 12:01:49 -0700
commitc841b15d254b77169f1c27e0eca3c996b9b83596 (patch)
tree2664d23e110fe9ce105e7b30af1b76b01703ced0 /src
parentadfb217622a482ad716d9e65e48caef38f7c3654 (diff)
downloadpandoc-c841b15d254b77169f1c27e0eca3c996b9b83596.tar.gz
LaTeX writer: Make `mainlang` work when `lang` is in metadata.
Closes #2174.
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/Writers/LaTeX.hs5
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 )