Переопределить \nomencl_command в LyX

Я пытаюсь переопределить \nomencl_command в LyX, чтобы иметь возможность использовать glossaries пакет вместо устаревшего nomencl,

LyX позволяет вам указать Nomenclature command, который по умолчанию установлен в:

makeindex -s nomencl.ist

Для глоссариев команда, таким образом, изменяется на:

makeglossaries

Тем не менее, LyX реализация nomencl использует более свежие .nlo в качестве входного файла, а .nls в качестве выходного файла. В то время как глоссарии используют "старые" .glo а также .gls К сожалению, расширения не могут быть указаны.

Я обнаружил, что файл настроек говорит только:

\nomencl_command "makeglossaries"

но вывод журнала говорит:

makeglossaries "[filename].nlo" -o [filename].nls

Так что мой вопрос где \nomencl_command определен дальше?

1 ответ

Решение

Соответствующий код находится в src/LaTeX.cpp, Обратите внимание, что некоторая диагностическая информация записывается в флаг отладки латекса. Вы можете увидеть эту информацию на терминале, если вы запускаете 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();
Другие вопросы по тегам