Compare commits

...

4 Commits

Author SHA1 Message Date
Udi Fogiel
54601b5578 update test 2024-09-10 15:44:42 +03:00
Scott Kostyshak
7fb059bce4 Whitespace 2024-09-10 14:23:37 +02:00
Udi Fogiel
abd35bc33c fix jlreq abstract layout and adapt Chinese docs for unicode engines
jlreq layout defined the abstract environment to be boxed
in the preamble. Doing any kind of typesetting before
all the setup has finished is error prone and may lead to
wrong output (wrong fonts for example). The correct
place to put the abstract code is right before \maketitle.

The Chinese docs loaded the ctex package in case system fonts
were used. Now, with the new support for languages with babel
and polyglossia it is no longer necessary and creates collisions.
2024-09-10 15:17:07 +03:00
Jürgen Spitzmüller
498135ef38 Do not push options to \babelprovide which do not make sense there
Should fix a couple of tests
2024-09-10 13:58:33 +02:00
6 changed files with 8 additions and 27 deletions

View File

@ -5,13 +5,6 @@
\save_transient_properties true
\origin unavailable
\textclass report
\begin_preamble
% Chinese localization
\@ifpackageloaded{fontspec}%
{\usepackage{ctex}}% ctex with non-TeX fonts
{%\usepackage[UTF8]{ctex}% error with font setup (missing font?)
}
\end_preamble
\use_default_options false
\maintain_unincluded_children false
\language chinese-traditional

View File

@ -5,13 +5,6 @@
\save_transient_properties true
\origin /systemlyxdir/doc/zh_CN/
\textclass article
\begin_preamble
% Chinese localization
\@ifpackageloaded{fontspec}%
{\usepackage{ctex}}% ctex with non-TeX fonts
{%\usepackage[UTF8]{ctex}% error with font setup (missing font?)
}
\end_preamble
\use_default_options true
\maintain_unincluded_children no
\language chinese-simplified

View File

@ -5,13 +5,6 @@
\save_transient_properties true
\origin /systemlyxdir/doc/zh_CN/
\textclass book
\begin_preamble
% Chinese localization
\@ifpackageloaded{fontspec}%
{\usepackage{ctex}}% ctex with non-TeX fonts
{%\usepackage[UTF8]{ctex}% error with font setup (missing font?)
}
\end_preamble
\options cjk
\use_default_options true
\maintain_unincluded_children no

View File

@ -94,7 +94,7 @@ End
Style Abstract_over_Columns
CopyStyle Abstract
InPreamble 1
InTitle 1
LabelString "Abstract"
Category FrontMatter
LatexType Command

View File

@ -3532,7 +3532,7 @@ string BufferParams::babelCall(LaTeXFeatures const & features, string lang_opts,
os << "\n\\babelprovide[import";
if (l == language)
os << ", main";
if (!babelLangOptions(l->lang()).empty())
if (!babelLangOptions(l->lang(), true).empty())
os << ", " << babelLangOptions(l->lang());
os << "]{" << blang << "}";
have_mods = true;
@ -3555,7 +3555,8 @@ string BufferParams::babelCall(LaTeXFeatures const & features, string lang_opts,
}
if ((bp == 2 && useNonTeXFonts) || have_other_forceprovide) {
// Options need to go to \babeprovide
if (!babelLangOptions(l->lang()).empty())
// but only those set in document settings
if (!babelLangOptions(l->lang(), true).empty())
os << "\n\\babelprovide["
<< babelLangOptions(l->lang())
<< "]{" << blang << "}";
@ -4095,11 +4096,11 @@ string const BufferParams::bibFileEncoding(string const & file) const
}
string const BufferParams::babelLangOptions(string const & lang) const
string const BufferParams::babelLangOptions(string const & lang, bool const onlycust) const
{
if (lang_options_babel_.find(lang) == lang_options_babel_.end()) {
Language const * l = languages.getLanguage(lang);
return l ? l->babelOpts() :string();
return (l && !onlycust) ? l->babelOpts() : string();
}
return lang_options_babel_.find(lang)->second;
}

View File

@ -343,7 +343,8 @@ public:
/// babel language options
std::map<std::string, std::string> lang_options_babel_;
///
std::string const babelLangOptions(std::string const & lang) const;
std::string const babelLangOptions(std::string const & lang,
bool const onlycust = false) const;
///
void setBabelLangOptions(std::string const & lang, std::string const & opts)
{ lang_options_babel_[lang] = opts; }