diff options
| author | John MacFarlane <[email protected]> | 2021-09-09 18:32:37 -0700 |
|---|---|---|
| committer | John MacFarlane <[email protected]> | 2021-09-09 21:20:30 -0700 |
| commit | f4d2c9e886bb5c2313b3df70786e76141b580feb (patch) | |
| tree | c55a38168ce4b11d54970c2ba6fdd88c912d4f4f /src/Text/Pandoc/Writers/LaTeX/Util.hs | |
| parent | 395d65fdbe398e42270acfe6a76ad98a00ecb35d (diff) | |
Use babel, not polyglossia, with xelatex.babel
Previously polyglossia worked better with xelatex, but
that is no longer the case, so we simplify the code so that
babel is used with all latex engines.
This involves a change to the default LaTeX template.
Diffstat (limited to 'src/Text/Pandoc/Writers/LaTeX/Util.hs')
| -rw-r--r-- | src/Text/Pandoc/Writers/LaTeX/Util.hs | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/Text/Pandoc/Writers/LaTeX/Util.hs b/src/Text/Pandoc/Writers/LaTeX/Util.hs index c34338121..d79326e0d 100644 --- a/src/Text/Pandoc/Writers/LaTeX/Util.hs +++ b/src/Text/Pandoc/Writers/LaTeX/Util.hs @@ -26,7 +26,7 @@ import Control.Monad (when) import Text.Pandoc.Class (PandocMonad, toLang) import Text.Pandoc.Options (WriterOptions(..), isEnabled) import Text.Pandoc.Writers.LaTeX.Types (LW, WriterState(..)) -import Text.Pandoc.Writers.LaTeX.Lang (toPolyglossiaEnv) +import Text.Pandoc.Writers.LaTeX.Lang (toBabel) import Text.Pandoc.Highlighting (toListingsLanguage) import Text.DocLayout import Text.Pandoc.Definition @@ -238,13 +238,11 @@ wrapDiv (_,classes,kvs) t = do Just "ltr" -> align "LTR" _ -> id wrapLang txt = case lang of - Just lng -> let (l, o) = toPolyglossiaEnv lng - ops = if T.null o - then "" - else brackets $ literal o - in inCmd "begin" (literal l) <> ops + Just lng -> let l = toBabel lng + in inCmd "begin" "otherlanguage" + <> (braces (literal l)) $$ blankline <> txt <> blankline - $$ inCmd "end" (literal l) + $$ inCmd "end" "otherlanguage" Nothing -> txt return $ wrapColumns . wrapColumn . wrapDir . wrapLang $ t |
