summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
m---------data/templates10
-rw-r--r--src/Text/Pandoc/Writers/LaTeX.hs10
2 files changed, 12 insertions, 8 deletions
diff --git a/data/templates b/data/templates
-Subproject 3370fd9f11a2676c2052cdf50d7f0edafa75146
+Subproject 4e72f2bff9e9edca64b1559746228eaa00b260a
diff --git a/src/Text/Pandoc/Writers/LaTeX.hs b/src/Text/Pandoc/Writers/LaTeX.hs
index 20ee4e4d8..35cd4ebae 100644
--- a/src/Text/Pandoc/Writers/LaTeX.hs
+++ b/src/Text/Pandoc/Writers/LaTeX.hs
@@ -137,6 +137,11 @@ pandocToLaTeX options (Pandoc meta blocks) = do
st <- get
titleMeta <- stringToLaTeX TextString $ stringify $ docTitle meta
authorsMeta <- mapM (stringToLaTeX TextString . stringify) $ docAuthors meta
+ let (mainlang, otherlang) =
+ case (reverse . splitBy (==',') . filter (/=' ')) `fmap`
+ getField "lang" metadata of
+ Just (m:os) -> (m, reverse os)
+ _ -> ("", [])
let context = defField "toc" (writerTableOfContents options) $
defField "toc-depth" (show (writerTOCDepth options -
if stBook st
@@ -161,9 +166,8 @@ 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)
- (getField "lang" metadata)) $
+ defField "mainlang" mainlang $
+ defField "otherlang" otherlang $
(if stHighlighting st
then defField "highlighting-macros" (styleToLaTeX
$ writerHighlightStyle options )