mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-21 17:51:03 +00:00
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:
parent
412d202fc3
commit
f74cc0ec92
@ -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}
|
||||||
|
@ -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
|
||||||
FileName const nls(changeExtension(file.absFileName(), ".nls"));
|
if (LaTeXFeatures::isAvailableAtLeastFrom("nomencl", 2005, 3, 31)) {
|
||||||
nls.removeFile();
|
FileName const nls(changeExtension(file.absFileName(), ".nls"));
|
||||||
|
nls.removeFile();
|
||||||
// nomencl file (old version of the package)
|
} else if (LaTeXFeatures::isAvailable("nomencl")) {
|
||||||
FileName const gls(changeExtension(file.absFileName(), ".gls"));
|
// nomencl file (old version of the package up to v. 4.0)
|
||||||
gls.removeFile();
|
FileName const gls(changeExtension(file.absFileName(), ".gls"));
|
||||||
|
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());
|
||||||
FileName const glofile(changeExtension(file.absFileName(), ".glo"));
|
bool run_nomencl_glo = false;
|
||||||
bool const run_nomencl_glo = head.haschanged(glofile);
|
if (!LaTeXFeatures::isAvailableAtLeastFrom("nomencl", 2005, 3, 31)) {
|
||||||
|
// nomencl package up to v4.0
|
||||||
|
FileName const glofile(changeExtension(file.absFileName(), ".glo"));
|
||||||
|
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.
|
||||||
|
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user