aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2020-10-12 21:35:36 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2020-10-12 21:35:36 -0700
commitef6627f6456f80534dce937ae89a395b904b0c29 (patch)
tree74d9ead1a0d1ed1325cf3038d2795077993eca93 /src/Text/Pandoc/Writers
parent12ff835a8a8eeb374fb2992315c932809991fa63 (diff)
downloadpandoc-ef6627f6456f80534dce937ae89a395b904b0c29.tar.gz
LaTeX writer: fix handling of pt-BR.
For polyglossia we now use `\setmainlanguage[variant=brazilian]{portuguese}` and for babel `\usepackage[shorthands=off,main=brazilian]{babel}`. Closes #2953.
Diffstat (limited to 'src/Text/Pandoc/Writers')
-rw-r--r--src/Text/Pandoc/Writers/LaTeX.hs5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/Text/Pandoc/Writers/LaTeX.hs b/src/Text/Pandoc/Writers/LaTeX.hs
index a4003b672..f7342f6e1 100644
--- a/src/Text/Pandoc/Writers/LaTeX.hs
+++ b/src/Text/Pandoc/Writers/LaTeX.hs
@@ -1635,6 +1635,7 @@ toPolyglossia (Lang "grc" _ _ _) = ("greek", "variant=ancient")
toPolyglossia (Lang "hsb" _ _ _) = ("usorbian", "")
toPolyglossia (Lang "la" _ _ vars)
| "x-classic" `elem` vars = ("latin", "variant=classic")
+toPolyglossia (Lang "pt" _ "BR" _) = ("portuguese", "variant=brazilian")
toPolyglossia (Lang "sl" _ _ _) = ("slovenian", "")
toPolyglossia x = (commonFromBcp47 x, "")
@@ -1669,6 +1670,7 @@ toBabel (Lang "grc" _ _ _) = "polutonikogreek"
toBabel (Lang "hsb" _ _ _) = "uppersorbian"
toBabel (Lang "la" _ _ vars)
| "x-classic" `elem` vars = "classiclatin"
+toBabel (Lang "pt" _ "BR" _) = "brazilian"
toBabel (Lang "sl" _ _ _) = "slovene"
toBabel x = commonFromBcp47 x
@@ -1676,9 +1678,6 @@ toBabel x = commonFromBcp47 x
-- and converts it to a string shared by Babel and Polyglossia.
-- https://tools.ietf.org/html/bcp47#section-2.1
commonFromBcp47 :: Lang -> Text
-commonFromBcp47 (Lang "pt" _ "BR" _) = "brazil"
--- Note: documentation says "brazilian" works too, but it doesn't seem to work
--- on some systems. See #2953.
commonFromBcp47 (Lang "sr" "Cyrl" _ _) = "serbianc"
commonFromBcp47 (Lang "zh" "Latn" _ vars)
| "pinyin" `elem` vars = "pinyin"