Limit nomencl backwards support to case when old package is really used

This is only needed for very old versions of the nomencl package
(before March 2005)

No need to output compatibility code with newer versions

Furthermore, this breaks the use of the glossary package which also
has .glo extension (#12968)
This commit is contained in:
Juergen Spitzmueller 2023-11-08 16:17:58 +01:00
parent 412d202fc3
commit f74cc0ec92
3 changed files with 23 additions and 14 deletions

View File

@ -369,7 +369,7 @@
\TestPackage{named} \TestPackage{named}
\TestPackage{natbib} \TestPackage{natbib}
\TestPackage{nicefrac} \TestPackage{nicefrac}
\TestPackage{nomencl} \TestPackageAddVersion{nomencl}
\TestPackage{paralist} \TestPackage{paralist}
\TestPackage{parskip} \TestPackage{parskip}
\TestPackage{pdflscape} \TestPackage{pdflscape}

View File

@ -25,6 +25,7 @@
#include "DepTable.h" #include "DepTable.h"
#include "Encoding.h" #include "Encoding.h"
#include "Language.h" #include "Language.h"
#include "LaTeXFeatures.h"
#include "support/debug.h" #include "support/debug.h"
#include "support/docstring.h" #include "support/docstring.h"
@ -160,12 +161,14 @@ void LaTeX::removeAuxiliaryFiles() const
ind.removeFile(); ind.removeFile();
// nomencl file // nomencl file
if (LaTeXFeatures::isAvailableAtLeastFrom("nomencl", 2005, 3, 31)) {
FileName const nls(changeExtension(file.absFileName(), ".nls")); FileName const nls(changeExtension(file.absFileName(), ".nls"));
nls.removeFile(); nls.removeFile();
} else if (LaTeXFeatures::isAvailable("nomencl")) {
// nomencl file (old version of the package) // nomencl file (old version of the package up to v. 4.0)
FileName const gls(changeExtension(file.absFileName(), ".gls")); FileName const gls(changeExtension(file.absFileName(), ".gls"));
gls.removeFile(); gls.removeFile();
}
// endnotes file // endnotes file
FileName const ent(changeExtension(file.absFileName(), ".ent")); FileName const ent(changeExtension(file.absFileName(), ".ent"));
@ -315,8 +318,12 @@ int LaTeX::run(TeXErrors & terr)
// the extra checks here (to trigger a rerun). Cf. discussions in #8905. // the extra checks here (to trigger a rerun). Cf. discussions in #8905.
// FIXME: Sort out the real problem in DepTable. // FIXME: Sort out the real problem in DepTable.
bool const run_nomencl = head.haschanged(nlofile) || (nlofile.exists() && nlofile.isFileEmpty()); bool const run_nomencl = head.haschanged(nlofile) || (nlofile.exists() && nlofile.isFileEmpty());
bool run_nomencl_glo = false;
if (!LaTeXFeatures::isAvailableAtLeastFrom("nomencl", 2005, 3, 31)) {
// nomencl package up to v4.0
FileName const glofile(changeExtension(file.absFileName(), ".glo")); FileName const glofile(changeExtension(file.absFileName(), ".glo"));
bool const run_nomencl_glo = head.haschanged(glofile); run_nomencl_glo = head.haschanged(glofile);
}
// 1 // 1
// At this point we must run the bibliography processor if needed. // At this point we must run the bibliography processor if needed.

View File

@ -1529,14 +1529,16 @@ string const LaTeXFeatures::getPackages() const
"\\usepackage{ulem}\n"; "\\usepackage{ulem}\n";
if (mustProvide("nomencl")) { if (mustProvide("nomencl")) {
packages << "\\usepackage{nomencl}\n";
// Make it work with the new and old version of the package, // Make it work with the new and old version of the package,
// but don't use the compatibility option since it is // but don't use the compatibility option since it is
// incompatible to other packages. // incompatible to other packages.
packages << "\\usepackage{nomencl}\n" if (!LaTeXFeatures::isAvailableAtLeastFrom("nomencl", 2005, 3, 31)) {
"% the following is useful when we have the old nomencl.sty package\n" packages << "% Needed with nomencl < v4.1\n"
"\\providecommand{\\printnomenclature}{\\printglossary}\n" "\\providecommand{\\printnomenclature}{\\printglossary}\n"
"\\providecommand{\\makenomenclature}{\\makeglossary}\n" "\\providecommand{\\makenomenclature}{\\makeglossary}\n";
"\\makenomenclature\n"; }
packages << "\\makenomenclature\n";
} }
// fixltx2e provides subscript // fixltx2e provides subscript