git.iko.soy/typeable/pandoc
on master help sign in
LaTeX writer: use \renewcommand for \textlatin with babel.
bba7646John MacFarlane
src/Text/Pandoc/Writers/LaTeX.hs+7−4
@@ -276,10 +276,13 @@ pandocToLaTeX options (Pandoc meta blocks) = do
276 "\\AddBabelHook{" ++ poly ++ "}{afterextras}" ++
276 "\\AddBabelHook{" ++ poly ++ "}{afterextras}" ++
277 "{\\renewcommand{\\text" ++ poly ++ "}[2][]{\\foreignlanguage{"
277 "{\\renewcommand{\\text" ++ poly ++ "}[2][]{\\foreignlanguage{"
278 ++ poly ++ "}{##2}}}\n"
278 ++ poly ++ "}{##2}}}\n"
279+ else (if poly == "latin" -- see #4161
280+ then "\\providecommand{\\textlatin}{}\n\\renewcommand"
279− else "\\newcommand{\\text" ++ poly ++ "}[2][]{\\foreignlanguage{"
281+ else "\\newcommand") ++ "{\\text" ++ poly ++
280− ++ babel ++ "}{#2}}\n" ++
282+ "}[2][]{\\foreignlanguage{" ++ babel ++ "}{#2}}\n" ++
283+ "\\newenvironment{" ++ poly ++
281− "\\newenvironment{" ++ poly ++ "}[2][]{\\begin{otherlanguage}{"
284+ "}[2][]{\\begin{otherlanguage}{" ++
282− ++ babel ++ "}}{\\end{otherlanguage}}\n"
285+ babel ++ "}}{\\end{otherlanguage}}\n"
283 )
286 )
284 -- eliminate duplicates that have same polyglossia name
287 -- eliminate duplicates that have same polyglossia name
285 $ nubBy (\a b -> fst a == fst b)
288 $ nubBy (\a b -> fst a == fst b)