mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-27 11:52:25 +00:00
Compare commits
No commits in common. "d0b559a31d93d8c6c8bc7aa4242be6a627c576bf" and "3f636a61b9ea89ec78ef20a5c38aacf936f6ceed" have entirely different histories.
d0b559a31d
...
3f636a61b9
@ -120,22 +120,12 @@
|
|||||||
#6
|
#6
|
||||||
\fi}
|
\fi}
|
||||||
|
|
||||||
|
|
||||||
% For the version test below, we need to load the tested package.
|
|
||||||
% However, we are only interested in the version information, so
|
|
||||||
% we redefine an internal method of \ProvidesPackage to quit
|
|
||||||
% as soon as we have that information
|
|
||||||
\let\chk@pr@videpackage\@pr@videpackage
|
|
||||||
\def\@pr@videpackage[#1]{\chk@pr@videpackage[#1]\endinput}
|
|
||||||
|
|
||||||
% Tests whether an package is present and also adds the version to the package list
|
% Tests whether an package is present and also adds the version to the package list
|
||||||
\newcommand{\TestPackageAddVersion}[2][\default]{
|
\newcommand{\TestPackageAddVersion}[2][\default]{
|
||||||
\def\default{#2}
|
\def\default{#2}
|
||||||
\def\package@version{}
|
\def\package@version{}
|
||||||
|
% The actual test only works after the package has been loaded
|
||||||
\IfFileExists{#1.sty}{%
|
\IfFileExists{#1.sty}{%
|
||||||
% The actual test only works after the package has been loaded,
|
|
||||||
% but with the redefinition of \@pr@videpackage above, we quit
|
|
||||||
% as early as possible
|
|
||||||
\RequirePackage{#1}%
|
\RequirePackage{#1}%
|
||||||
\protected@edef\package@@version{\csname ver@#1.sty\endcsname}%
|
\protected@edef\package@@version{\csname ver@#1.sty\endcsname}%
|
||||||
\protected@edef\package@version{\expandafter\@parse@version\package@@version//00\@nil}%
|
\protected@edef\package@version{\expandafter\@parse@version\package@@version//00\@nil}%
|
||||||
@ -222,14 +212,13 @@
|
|||||||
\AddPackage[\expandafter\@parse@version\fmtversion//00\@nil]{LaTeX}
|
\AddPackage[\expandafter\@parse@version\fmtversion//00\@nil]{LaTeX}
|
||||||
|
|
||||||
%%% And now, the list of available languages
|
%%% And now, the list of available languages
|
||||||
% Up to 2016 \the\everyjob contains something like
|
% The trick is to know that \the\everyjob contains something like
|
||||||
% \typeout{LaTeX2e <2001/06/01>}
|
% \typeout{LaTeX2e <2001/06/01>}
|
||||||
% \typeout{Babel <v3.7h> and hyphenation patterns for american, french, german, ngerman, nohyphenation, loaded.}
|
% \typeout{Babel <v3.7h> and hyphenation patterns for american, french, german, ngerman, nohyphenation, loaded.}
|
||||||
% All we have to do is to extract the list from there:
|
% All we have to do is to extract the list from there:
|
||||||
% (1) concatenate all the messages that are displayed everytime the
|
% (1) concatenate all the messages that are displayed everytime the
|
||||||
% format is loaded. The is done by redefining locally \typeout to
|
% format is loaded. The is done by redefining locally \typeout to
|
||||||
% append its argument to the macro \mesg.
|
% append its argument to the macro \mesg.
|
||||||
% But see below for recent versions of babel.
|
|
||||||
\def\mesg{}
|
\def\mesg{}
|
||||||
{\def\typeout#1{\xdef\mesg{\mesg #1}}
|
{\def\typeout#1{\xdef\mesg{\mesg #1}}
|
||||||
\the\everyjob}
|
\the\everyjob}
|
||||||
@ -237,27 +226,19 @@
|
|||||||
% (2) strip the useless parts from \mesg. This uses the fact that TeX
|
% (2) strip the useless parts from \mesg. This uses the fact that TeX
|
||||||
% allows to define macros with parameters delimited by arbitrary text.
|
% allows to define macros with parameters delimited by arbitrary text.
|
||||||
\def\platexname{pLaTeX2e}
|
\def\platexname{pLaTeX2e}
|
||||||
\def\langs{}
|
|
||||||
\ifx\pfmtname\platexname
|
\ifx\pfmtname\platexname
|
||||||
\def\langs{japanese}
|
\def\langs{japanese}
|
||||||
\else
|
\else
|
||||||
\ifx\mesg\empty
|
|
||||||
% As of 2016, babel does not print out the loaded hyphenation patterns to
|
|
||||||
% the log anymore, so \mesg will be empty. For the following method,
|
|
||||||
% see https://tex.stackexchange.com/questions/330085/
|
|
||||||
\@ifundefined{bbl@languages}{}{
|
|
||||||
\def\bbl@elt#1#2#3#4{#1, }
|
|
||||||
\edef\@langs{\bbl@languages}
|
|
||||||
\def\strip#1, \endmark{\def\langs{#1}}
|
|
||||||
\expandafter\strip\@langs\endmark
|
|
||||||
}
|
|
||||||
\else
|
|
||||||
\def\strip#1patterns for #2, loaded.#3\endmark{\def\langs{#2}}
|
\def\strip#1patterns for #2, loaded.#3\endmark{\def\langs{#2}}
|
||||||
\expandafter\strip\mesg\endmark
|
\expandafter\strip\mesg\endmark
|
||||||
\fi
|
|
||||||
\fi
|
\fi
|
||||||
|
|
||||||
% (3) handle the result
|
% (3) handle the result
|
||||||
|
% FIXME: As of 2016, babel does not print out the loaded hyphenation patterns to
|
||||||
|
% the log anymore, so this discontinues to work. For possible workarounds
|
||||||
|
% (with babel), see https://tex.stackexchange.com/questions/330085/
|
||||||
|
% Leaving this activated for the time being, since it probably still
|
||||||
|
% works with older distributions.
|
||||||
\message{^^J\prefix checking for available hyphenation patterns... \langs}
|
\message{^^J\prefix checking for available hyphenation patterns... \langs}
|
||||||
\AddVariable{languages}{\langs}
|
\AddVariable{languages}{\langs}
|
||||||
|
|
||||||
|
@ -106,9 +106,3 @@ What's new
|
|||||||
|
|
||||||
* BUILD/INSTALLATION
|
* BUILD/INSTALLATION
|
||||||
|
|
||||||
- Fix (only informal) check for hyphenation patterns in (re)configuration.
|
|
||||||
|
|
||||||
- Improve check for package versions in (re)configuration. Particularly,
|
|
||||||
configuration does not break any longer if a sub-dependency of a
|
|
||||||
tested package is missing (bug 13112),
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user