mirror of
https://github.com/jgm/pandoc.git
synced 2026-09-24 15:44:59 +08:00
LaTeX writer: use \renewcommand for \textlatin with babel.
This avoids a clash with a deprecated \textlatin command defined in Babel. Closes #4161.
This commit is contained in:
@@ -276,10 +276,13 @@ pandocToLaTeX options (Pandoc meta blocks) = do
|
||||
"\\AddBabelHook{" ++ poly ++ "}{afterextras}" ++
|
||||
"{\\renewcommand{\\text" ++ poly ++ "}[2][]{\\foreignlanguage{"
|
||||
++ poly ++ "}{##2}}}\n"
|
||||
else "\\newcommand{\\text" ++ poly ++ "}[2][]{\\foreignlanguage{"
|
||||
++ babel ++ "}{#2}}\n" ++
|
||||
"\\newenvironment{" ++ poly ++ "}[2][]{\\begin{otherlanguage}{"
|
||||
++ babel ++ "}}{\\end{otherlanguage}}\n"
|
||||
else (if poly == "latin" -- see #4161
|
||||
then "\\providecommand{\\textlatin}{}\n\\renewcommand"
|
||||
else "\\newcommand") ++ "{\\text" ++ poly ++
|
||||
"}[2][]{\\foreignlanguage{" ++ babel ++ "}{#2}}\n" ++
|
||||
"\\newenvironment{" ++ poly ++
|
||||
"}[2][]{\\begin{otherlanguage}{" ++
|
||||
babel ++ "}}{\\end{otherlanguage}}\n"
|
||||
)
|
||||
-- eliminate duplicates that have same polyglossia name
|
||||
$ nubBy (\a b -> fst a == fst b)
|
||||
|
||||
Reference in New Issue
Block a user