LaTeX writer: Make mainlang work when lang is in metadata.

Closes #2174.
This commit is contained in:
John MacFarlane 2015-05-27 12:01:49 -07:00
parent adfb217622
commit c841b15d25

View file

@ -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 )