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:
parent
79c3f57c47
commit
bba7646340
1 changed files with 7 additions and 4 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue