#6
\fi}
+% Tests whether an package is present in a specific version (or newer)
+% Syntax: \TestPackageVersion{<name>}{<yyyy/mm/dd>}
+% Note: This requires the package to be loaded first
+
+\newcommand{\TestPackageVersion}[2]{
+ \message{^^J\prefix checking for package #1 at least as of #2...}
+ \IfFileExists{#1.sty}
+ {
+ \@ifpackagelater{#1}{#2}{\existstrue}{\existsfalse}
+ }
+ {
+ \existsfalse
+ }
+ \ifexists
+ \message{yes^^J}
+ \AddVariable{#1}{yes}
+ \AddPackage{#1-#2}
+ \else
+ \message{no^^J}
+ \AddVariable{#1}{no}
+ \fi}
+
+
% Adapted from ltxcheck.tex
\newcommand{\TestFont}[2][\default]{
\def\default{#2}
%\TestPackage{mathabx}
%\TestPackage{mathdesign}% But see above!
+%%% Specific package versions
+% This only works if the package has been loaded before
+\IfFileExists{babel.sty}{\RequirePackage{babel}}{}
+\TestPackageVersion{babel}{2017/11/03}
+
%%% Document classes
% The list of layout files has been put in this file here by the
% configure script.
#LyX 2.4 created this file. For more info see https://www.lyx.org/
-\lyxformat 578
+\lyxformat 580
\begin_document
\begin_header
\save_transient_properties true
\end_layout
\begin_deeper
+\begin_layout Standard
+
+\change_inserted -712698321 1563000039
+As of version 3.15 (2017/11/03),
+\family sans
+babel
+\family default
+ also provides specific commands to select OpenType, TrueType and PostScript
+ fonts from the Operating System (with XeTeX or LuaTeX).
+ If this version (or a newer one) is installed (on your system:
+\begin_inset Info
+type "package"
+arg "babel-2017/11/03"
+\end_inset
+
+), \SpecialChar LyX
+ will use this rather than
+\family sans
+fontspec
+\family default
+'s commands.
+\change_unchanged
+
+\end_layout
+
\begin_layout Standard
Your \SpecialChar LaTeX
installation has hyphenation patterns for the following languages:
os << from_ascii(ams);
if (useNonTeXFonts) {
- // Babel loads fontspec itself
- if (!features.isProvided("fontspec") && !features.useBabel())
+ // Babel (as of 2017/11/03) loads fontspec itself
+ if (!features.isProvided("fontspec")
+ && !(features.useBabel() && features.isAvailable("babel-2017/11/03")))
os << "\\usepackage{fontspec}\n";
if (features.mustProvide("unicode-math")
&& features.isAvailable("unicode-math"))
// variants are understood by both engines. However,
// we want to provide support for at least TeXLive 2009
// (for XeTeX; LuaTeX is only supported as of v.2)
- // Babel has its own higher-level interface on top of
- // fontspec that is to be used.
- bool const babel = features.useBabel();
+ // As of 2017/11/03, Babel has its own higher-level
+ // interface on top of fontspec that is to be used.
+ bool const babelfonts = features.useBabel()
+ && features.isAvailable("babel-2017/11/03");
string const texmapping =
(features.runparams().flavor == OutputParams::XETEX) ?
"Mapping=tex-text" : "Ligatures=TeX";
if (fontsRoman() != "default") {
- if (babel)
+ if (babelfonts)
os << "\\babelfont{rm}[";
else
os << "\\setmainfont[";
if (fontsSans() != "default") {
string const sans = parseFontName(fontsSans());
if (fontsSansScale() != 100) {
- if (babel)
+ if (babelfonts)
os << "\\babelfont{sf}";
else
os << "\\setsansfont";
os << texmapping << "]{"
<< sans << "}\n";
} else {
- if (babel)
+ if (babelfonts)
os << "\\babelfont{sf}[";
else
os << "\\setsansfont[";
if (fontsTypewriter() != "default") {
string const mono = parseFontName(fontsTypewriter());
if (fontsTypewriterScale() != 100) {
- if (babel)
+ if (babelfonts)
os << "\\babelfont{tt}";
else
os << "\\setmonofont";
os << "]{"
<< mono << "}\n";
} else {
- if (babel)
+ if (babelfonts)
os << "\\babelfont{tt}";
else
os << "\\setmonofont";