Am Donnerstag, den 11.07.2019, 19:17 +0200 schrieb Jürgen Spitzmüller:
> Am Donnerstag, den 11.07.2019, 17:54 +0200 schrieb Jean-Marc
> Lasgouttes:
> > My concern is to know whether documents that used to work wwith 2.3
> > on 
> > older TeX distributions will continue to work with 2.4.
> 
> Sure. As said, we can try to provide this, given that we can add a
> test
> for package versions in chkconfig.ltx

Attached is the only solution I could find. It's not particularly nice
since the tested package needs to be loaded in advance of the test, and
this cannot be done in the test macro itself. But for the given
problem, it will suffice.

What do you think?

Jürgen
diff --git a/lib/chkconfig.ltx b/lib/chkconfig.ltx
index 970b26baaa..fb04719377 100644
--- a/lib/chkconfig.ltx
+++ b/lib/chkconfig.ltx
@@ -120,6 +120,29 @@
     #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}
@@ -527,6 +550,11 @@
 %\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.

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to