aboutsummaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authorJohn MacFarlane <[email protected]>2025-02-04 22:21:06 -0800
committerJohn MacFarlane <[email protected]>2025-02-08 10:45:11 -0800
commit9be096332727ad62e9fcd50188980d376003f7fa (patch)
tree355858231834e343c79a03ea1bd78fdc09ac82f2 /data
parent1a3ea44f4fc53deccd1896d9f21a07a19af54cac (diff)
LaTeX writer/template: Improve babel support.
Previously we used the `.ini` files for every language, but for European languages these tend to provide inferior results to the `.ldf` files used by classic Babel. Currently Babel documentation recommends using the classic system for European languages written in Latin and Cyrillic scripts and Vietnamese. So the LaTeX writer and template now follow this guidance. Main languages in the list of languages with good "classic" support are added to global documentclass options and will be automatically handled by Babel using the `.ldf` files. If the main language is not in this list, the `babeloptions` variable will be set to `provide=*`, which will cause support to be loaded from the `.ini` file rather than an `.ldf`. So, for example, setting `-V babeloptions=''` with a polytonic Greek document will cause the `.ldf` support to be used instead of the `.ini`. The default setting of this variable can be overwritten, but in most cases the default should give good results. Closes #8283.
Diffstat (limited to 'data')
-rw-r--r--data/templates/common.latex8
-rw-r--r--data/templates/default.latex6
2 files changed, 8 insertions, 6 deletions
diff --git a/data/templates/common.latex b/data/templates/common.latex
index d2e7f841f..3f93b1b88 100644
--- a/data/templates/common.latex
+++ b/data/templates/common.latex
@@ -183,12 +183,11 @@ $-- Babel language support
$--
$if(lang)$
\ifLuaTeX
-\usepackage[bidi=basic]{babel}
+\usepackage[bidi=basic$for(babeloptions)$,$babeloptions$$endfor$]{babel}
\else
-\usepackage[bidi=default]{babel}
+\usepackage[bidi=default$for(babeloptions)$,$babeloptions$$endfor$]{babel}
\fi
$if(babel-lang)$
-\babelprovide[main,import]{$babel-lang$}
$if(mainfont)$
\ifPDFTeX
\else
@@ -196,9 +195,6 @@ $if(mainfont)$
\fi
$endif$
$endif$
-$for(babel-otherlangs)$
-\babelprovide[import]{$babel-otherlangs$}
-$endfor$
$for(babelfonts/pairs)$
\babelfont[$babelfonts.key$]{rm}{$babelfonts.value$}
$endfor$
diff --git a/data/templates/default.latex b/data/templates/default.latex
index b7858dedc..781133776 100644
--- a/data/templates/default.latex
+++ b/data/templates/default.latex
@@ -1,5 +1,11 @@
$passoptions.latex()$
\documentclass[
+$for(babel-otherlangs)$
+ $babel-otherlangs$,
+$endfor$
+$if(babel-lang)$
+ $babel-lang$,
+$endif$
$if(fontsize)$
$fontsize$,
$endif$