aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2015-05-27 12:15:21 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2015-05-27 12:15:50 -0700
commit4a9aaf6fd6be3c0c6df21c93ac1275acd199ab64 (patch)
treeb3d2b41b5d0b6987a090305821389d43811a69a1 /src/Text/Pandoc/Writers
parentc841b15d254b77169f1c27e0eca3c996b9b83596 (diff)
downloadpandoc-4a9aaf6fd6be3c0c6df21c93ac1275acd199ab64.tar.gz
LaTeX/beamer: added `setotherlanguages` in polyglossia.
This uses an `otherlang` variable that takes a list of languages. As requseted in #2174.
Diffstat (limited to 'src/Text/Pandoc/Writers')
-rw-r--r--src/Text/Pandoc/Writers/LaTeX.hs10
1 files changed, 7 insertions, 3 deletions
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 )