aboutsummaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authorhseg <gesh@gesh.uni.cx>2021-10-04 02:34:59 +0300
committerJohn MacFarlane <jgm@berkeley.edu>2021-10-03 19:16:50 -0700
commitda8bcb783b1f5fc99be86617762eca42ab2db6ad (patch)
treea6a36645f228558506bbc24345ca9f71cab82756 /data
parent6742e77d1ee10247c3fd2344381b52df5d4baba0 (diff)
downloadpandoc-da8bcb783b1f5fc99be86617762eca42ab2db6ad.tar.gz
Make babel use more idiomatic
* Use `babel`'s bidi implementation * Remove global `lang` option -- it broke eg hebrew * Import babel languages individually instead of as package options -- was broken for greek, hebrew * Move `header-includes` to after `babel` setup Closes #7604
Diffstat (limited to 'data')
-rw-r--r--data/templates/default.latex29
1 files changed, 13 insertions, 16 deletions
diff --git a/data/templates/default.latex b/data/templates/default.latex
index 27a3fc877..10377f2cd 100644
--- a/data/templates/default.latex
+++ b/data/templates/default.latex
@@ -4,11 +4,6 @@
$if(colorlinks)$
\PassOptionsToPackage{dvipsnames,svgnames,x11names}{xcolor}
$endif$
-$if(dir)$
-$if(latex-dir-rtl)$
-\PassOptionsToPackage{RTLdocument}{bidi}
-$endif$
-$endif$
$if(CJKmainfont)$
\PassOptionsToPackage{space}{xeCJK}
$endif$
@@ -17,9 +12,6 @@ $endif$
$if(fontsize)$
$fontsize$,
$endif$
-$if(lang)$
- $babel-lang$,
-$endif$
$if(papersize)$
$papersize$paper,
$endif$
@@ -370,23 +362,28 @@ $if(csl-refs)$
\newcommand{\CSLRightInline}[1]{\parbox[t]{\linewidth - \csllabelwidth}{#1}\break}
\newcommand{\CSLIndent}[1]{\hspace{\cslhangindent}#1}
$endif$
-$for(header-includes)$
-$header-includes$
-$endfor$
$if(lang)$
-\usepackage[$for(babel-otherlangs)$$babel-otherlangs$,$endfor$main=$babel-lang$]{babel}
+\ifXeTeX
+\usepackage[bidi=default]{babel}
+\fi
+\ifLuaTeX
+\usepackage[bidi=basic]{babel}
+\fi
+\babelprovide[main,import]{$babel-lang$}
+$for(babel-otherlangs)$
+\babelprovide[import]{$babel-otherlangs$}
+$endfor$
% get rid of language-specific shorthands (see #6817):
\let\LanguageShortHands\languageshorthands
\def\languageshorthands#1{}
$endif$
+$for(header-includes)$
+$header-includes$
+$endfor$
\ifLuaTeX
\usepackage{selnolig} % disable illegal ligatures
\fi
$if(dir)$
-\ifXeTeX
- % Load bidi as late as possible as it modifies e.g. graphicx
- \usepackage{bidi}
-\fi
\ifPDFTeX
\TeXXeTstate=1
\newcommand{\RL}[1]{\beginR #1\endR}