我试图在\nomencl_command中重新定义LyX,以便能够使用glossaries包而不是过时的nomencl。
LyX允许您指定Nomenclature command,默认设置为:
makeindex -s nomencl.ist因此,对于术语表,命令更改为:
makeglossaries但是,nomencl的LyX实现使用最近的.nlo作为输入文件,使用.nls作为输出文件。虽然术语表使用的是‘旧的’.glo和.gls,但遗憾的是,不能指定扩展。
我发现首选项文件只显示:
\nomencl_command "makeglossaries"但是日志输出显示:
makeglossaries "[filename].nlo" -o [filename].nls因此,我的问题是,\nomencl_command的定义在哪里?
发布于 2014-04-09 20:32:12
相关代码在src/LaTeX.cpp中。请注意,一些诊断信息被写入到latex调试标志中。如果您使用LyX运行lyx -dbg latex,您可以在终端上看到这些信息。
以下是即将发布(几天内)的src/LaTeX.cpp文件LyX 2.1的摘录。
FileName const nlofile(changeExtension(file.absFileName(), ".nlo"));
// If all nomencl entries are removed, nomencl writes an empty nlo file.
// DepTable::hasChanged() returns false in this case, since it does not
// distinguish empty files from non-existing files. This is why we need
// the extra checks here (to trigger a rerun). Cf. discussions in #8905.
// FIXME: Sort out the real problem in DepTable.
if (head.haschanged(nlofile) || (nlofile.exists() && nlofile.isFileEmpty()))
rerun |= runMakeIndexNomencl(file, ".nlo", ".nls");
FileName const glofile(changeExtension(file.absFileName(), ".glo"));
if (head.haschanged(glofile))
rerun |= runMakeIndexNomencl(file, ".glo", ".gls");和
bool LaTeX::runMakeIndexNomencl(FileName const & file,
string const & nlo, string const & nls)
{
LYXERR(Debug::LATEX, "Running MakeIndex for nomencl.");
message(_("Running MakeIndex for nomencl."));
string tmp = lyxrc.nomencl_command + ' ';
// onlyFileName() is needed for cygwin
tmp += quoteName(onlyFileName(changeExtension(file.absFileName(), nlo)));
tmp += " -o "
+ onlyFileName(changeExtension(file.toFilesystemEncoding(), nls));
Systemcall one;
one.startscript(Systemcall::Wait, tmp, path);
return true;
}和
// nomencl file
FileName const nls(changeExtension(file.absFileName(), ".nls"));
nls.removeFile();
// nomencl file (old version of the package)
FileName const gls(changeExtension(file.absFileName(), ".gls"));
gls.removeFile();https://stackoverflow.com/questions/22933718
复制相似问题