diff options
author | John MacFarlane <jgm@berkeley.edu> | 2020-11-25 08:25:30 -0800 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2020-11-25 08:25:30 -0800 |
commit | e26d31d56bc61553d5d6153f2130184643869877 (patch) | |
tree | 8ff245f31b73c83926292962e7cbe1bbb39b402b /test/writers-lang-and-dir.latex | |
parent | bfb2a492c86f47833e530a0b8baf167b119f9138 (diff) | |
download | pandoc-e26d31d56bc61553d5d6153f2130184643869877.tar.gz |
latex template: disable language-specific shorthands in babel.
Babel defines "shorthands" for some languages, and these can
produce unexpected results. For example, in Spanish, `1.22`
gets rendered as `122`, and `et~al.` as `etal`.
One would think that babel's `shorthands=off` option (which
we were using) would disable these, but it doesn't. So we
remove `shorthands=off` and add some code that redefines
the shorthands macro. Eventually this will be fixed in babel,
I hope, and we can revert to something simpler.
Closes #6817, closes #6887.
Diffstat (limited to 'test/writers-lang-and-dir.latex')
-rw-r--r-- | test/writers-lang-and-dir.latex | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/test/writers-lang-and-dir.latex b/test/writers-lang-and-dir.latex index 91f4be8c1..05465e581 100644 --- a/test/writers-lang-and-dir.latex +++ b/test/writers-lang-and-dir.latex @@ -56,7 +56,10 @@ \setotherlanguage[]{spanish} \setotherlanguage[]{french} \else - \usepackage[shorthands=off,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}} |