首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在\nomencl_command中重新定义LyX

在\nomencl_command中重新定义LyX
EN

Stack Overflow用户
提问于 2014-04-08 10:03:21
回答 1查看 510关注 0票数 2

我试图在\nomencl_command中重新定义LyX,以便能够使用glossaries包而不是过时的nomencl

LyX允许您指定Nomenclature command,默认设置为:

代码语言:javascript
复制
makeindex -s nomencl.ist

因此,对于术语表,命令更改为:

代码语言:javascript
复制
makeglossaries

但是,nomencl的LyX实现使用最近的.nlo作为输入文件,使用.nls作为输出文件。虽然术语表使用的是‘旧的’.glo.gls,但遗憾的是,不能指定扩展。

我发现首选项文件只显示:

代码语言:javascript
复制
\nomencl_command "makeglossaries"

但是日志输出显示:

代码语言:javascript
复制
makeglossaries "[filename].nlo" -o [filename].nls

因此,我的问题是,\nomencl_command的定义在哪里?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2014-04-09 20:32:12

相关代码在src/LaTeX.cpp中。请注意,一些诊断信息被写入到latex调试标志中。如果您使用LyX运行lyx -dbg latex,您可以在终端上看到这些信息。

以下是即将发布(几天内)的src/LaTeX.cpp文件LyX 2.1的摘录。

代码语言:javascript
复制
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");

代码语言:javascript
复制
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;
}

代码语言:javascript
复制
// 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();
票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/22933718

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档