aboutsummaryrefslogtreecommitdiff
path: root/test/writers-lang-and-dir.latex
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2021-09-09 18:32:37 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2021-09-19 09:40:59 -0700
commitdd7b83ac9111b63786c1042c4849d7cea79c668b (patch)
tree1d8f573b01394f765d68cb8939bf1800ec0c9c14 /test/writers-lang-and-dir.latex
parentca20d5c10bb81147eb2342908ca87b453c8e5d78 (diff)
downloadpandoc-dd7b83ac9111b63786c1042c4849d7cea79c668b.tar.gz
Use babel, not polyglossia, with xelatex.
Previously polyglossia worked better with xelatex, but that is no longer the case, so we simplify the code so that babel is used with all latex engines. This involves a change to the default LaTeX template.
Diffstat (limited to 'test/writers-lang-and-dir.latex')
-rw-r--r--test/writers-lang-and-dir.latex43
1 files changed, 12 insertions, 31 deletions
diff --git a/test/writers-lang-and-dir.latex b/test/writers-lang-and-dir.latex
index d91f77325..e7e5aa876 100644
--- a/test/writers-lang-and-dir.latex
+++ b/test/writers-lang-and-dir.latex
@@ -45,30 +45,10 @@
\providecommand{\tightlist}{%
\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
\setcounter{secnumdepth}{-\maxdimen} % remove section numbering
-\ifXeTeX
- % Load polyglossia as late as possible: uses bidi with RTL langages (e.g. Hebrew, Arabic)
- \usepackage{polyglossia}
- \setmainlanguage[]{english}
- \setotherlanguage[]{german}
- \setotherlanguage[variant=british]{english}
- \setotherlanguage[variant=swiss]{german}
- \setotherlanguage[]{spanish}
- \setotherlanguage[]{french}
-\else
- \usepackage[ngerman,british,nswissgerman,spanish,french,main=english]{babel}
+\usepackage[ngerman,british,nswissgerman,spanish,french,main=english]{babel}
% get rid of language-specific shorthands (see #6817):
\let\LanguageShortHands\languageshorthands
\def\languageshorthands#1{}
- \newcommand{\textgerman}[2][]{\foreignlanguage{ngerman}{#2}}
- \newenvironment{german}[2][]{\begin{otherlanguage}{ngerman}}{\end{otherlanguage}}
- \newcommand{\textenglish}[2][]{\foreignlanguage{british}{#2}}
- \newenvironment{english}[2][]{\begin{otherlanguage}{british}}{\end{otherlanguage}}
- \let\oritextspanish\textspanish
- \AddBabelHook{spanish}{beforeextras}{\renewcommand{\textspanish}{\oritextspanish}}
- \AddBabelHook{spanish}{afterextras}{\renewcommand{\textspanish}[2][]{\foreignlanguage{spanish}{##2}}}
- \newcommand{\textfrench}[2][]{\foreignlanguage{french}{#2}}
- \newenvironment{french}[2][]{\begin{otherlanguage}{french}}{\end{otherlanguage}}
-\fi
\ifLuaTeX
\usepackage{selnolig} % disable illegal ligatures
\fi
@@ -123,18 +103,19 @@ word-that-includesa\LR{ltrspan}right?
Some text and
-\begin{german}
+\begin{otherlanguage}{ngerman}
German div contents
-\end{german}
+\end{otherlanguage}
and more text.
-Next paragraph with a \textenglish[variant=british]{British span} and a
-word-that-includesa\textgerman[variant=swiss]{Swiss German span}right?
+Next paragraph with a \foreignlanguage{british}{British span} and a
+word-that-includesa\foreignlanguage{nswissgerman}{Swiss German
+span}right?
-Some \textspanish{Spanish text}.
+Some \foreignlanguage{spanish}{Spanish text}.
\hypertarget{combined}{%
\section{Combined}\label{combined}}
@@ -142,17 +123,17 @@ Some \textspanish{Spanish text}.
Some text and
\begin{RTL}
-\begin{french}
+\begin{otherlanguage}{french}
French rtl div contents
-\end{french}
+\end{otherlanguage}
\end{RTL}
and more text.
-Next paragraph with a \LR{\textenglish[variant=british]{British ltr
-span}} and a word-that-includesa\LR{\textgerman[variant=swiss]{Swiss
-German ltr span}}right?
+Next paragraph with a \LR{\foreignlanguage{british}{British ltr span}}
+and a word-that-includesa\LR{\foreignlanguage{nswissgerman}{Swiss German
+ltr span}}right?
\end{document}