if have_oldrussian:
add_to_preamble(document, ["\\AddToHook{package/babel/after}{\\languageattribute{russian}{ancient}}"])
+ # Some babel languages require special treatment with unicode engines
+ if get_bool_value(document.header, "\\use_non_tex_fonts"):
+ if document.language == "hebrew" or find_token(document.body, "\\lang oldrussian", 0) != -1:
+ add_to_preamble(document, ["\\PassOptionsToPackage{provide*=*}{babel}"])
+
##
# Conversion hub
#
// add main language
langs.insert(language);
ostringstream os;
+ string force_provide;
for (auto const & l : langs) {
string blang = l->babel();
bool use_opt = langoptions;
use_opt = true;
}
}
- if (l->useBabelProvide() == 1 || (l->useBabelProvide() == 2 && useNonTeXFonts)) {
+ int const bp = l->useBabelProvide();
+ if (bp == 1) {
os << "\n\\babelprovide[import";
if (l == language)
os << ", main";
os << "]{" << blang << "}";
have_mods = true;
}
- else if (use_opt)
+ if (bp == 2 && useNonTeXFonts) {
+ // here we need to tell babel to use the ini
+ // even though an *.ldf exists
+ if (l == language)
+ force_provide = force_provide.empty()
+ ? "provide=*"
+ : "provide*=*";
+ else
+ force_provide = "provide+=*";
+ have_mods = true;
+ }
+ if (bp != 1 && use_opt)
blangs.push_back(blang);
}
- if (have_mods)
+ if (have_mods) {
lang_opts = getStringFromVector(blangs);
+ if (!force_provide.empty()) {
+ if (!lang_opts.empty())
+ lang_opts += ", ";
+ lang_opts += force_provide;
+ }
+ }
// The prefs may require the languages to
// be submitted to babel itself (not the class).
if ((langoptions || have_mods) && !lang_opts.empty())