git.iko.soy/typeable/pandoc
on master help sign in
Merge pull request #2735 from mb21/patch-1

LaTeX Writer: fix polyglossia to babel env mapping

commitece215ed7dc2e0a9d9b068fa309c4822cd73f655 authorJohn MacFarlane <jgm@berkeley.edu> dateTue 26 Apr 2016, 23:09 (11 years ago) parentcc0527b44f9548
2 files changed+4−4
src/Text/Pandoc/Writers/LaTeX.hs+1−1 tests/writers-lang-and-dir.latex+3−3
src/Text/Pandoc/Writers/LaTeX.hs+1−1
@@ -223,7 +223,7 @@ pandocToLaTeX options (Pandoc meta blocks) = do
223223 ++ poly ++ "}{##2}}}\n"
224224 else "\\newcommand{\\text" ++ poly ++ "}[2][]{\\foreignlanguage{"
225225 ++ babel ++ "}{#2}}\n" ++
226− "\\newenvironment{" ++ poly ++ "}[1]{\\begin{otherlanguage}{"
226+ "\\newenvironment{" ++ poly ++ "}[2][]{\\begin{otherlanguage}{"
227227 ++ babel ++ "}}{\\end{otherlanguage}}\n"
228228 )
229229 -- eliminate duplicates that have same polyglossia name
tests/writers-lang-and-dir.latex+3−3
@@ -29,14 +29,14 @@
2929\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
3030 \usepackage[shorthands=off,ngerman,british,nswissgerman,spanish,french,main=english]{babel}
3131 \newcommand{\textgerman}[2][]{\foreignlanguage{ngerman}{#2}}
32− \newenvironment{german}[1]{\begin{otherlanguage}{ngerman}}{\end{otherlanguage}}
32+ \newenvironment{german}[2][]{\begin{otherlanguage}{ngerman}}{\end{otherlanguage}}
3333 \newcommand{\textenglish}[2][]{\foreignlanguage{british}{#2}}
34− \newenvironment{english}[1]{\begin{otherlanguage}{british}}{\end{otherlanguage}}
34+ \newenvironment{english}[2][]{\begin{otherlanguage}{british}}{\end{otherlanguage}}
3535 \let\oritextspanish\textspanish
3636 \AddBabelHook{spanish}{beforeextras}{\renewcommand{\textspanish}{\oritextspanish}}
3737 \AddBabelHook{spanish}{afterextras}{\renewcommand{\textspanish}[2][]{\foreignlanguage{spanish}{##2}}}
3838 \newcommand{\textfrench}[2][]{\foreignlanguage{french}{#2}}
39− \newenvironment{french}[1]{\begin{otherlanguage}{french}}{\end{otherlanguage}}
39+ \newenvironment{french}[2][]{\begin{otherlanguage}{french}}{\end{otherlanguage}}
4040\else
4141 \usepackage{polyglossia}
4242 \setmainlanguage[]{english}