[英]redefine \nomencl_command in LyX
我試圖在LyX中重新定義\\nomencl_command
,以便能夠使用glossaries
包代替過時的nomencl
。
LyX允許您指定Nomenclature command
,默認情況下該Nomenclature command
設置為:
makeindex -s nomencl.ist
對於詞匯表,命令因此更改為:
makeglossaries
但是,nomencl的LyX實現使用更新的.nlo
作為輸入文件,而將.nls
作為輸出文件。 詞匯表使用“較舊的” .glo
和.gls
遺憾的是,無法指定擴展名。
我發現首選項文件僅顯示:
\nomencl_command "makeglossaries"
但日志輸出顯示:
makeglossaries "[filename].nlo" -o [filename].nls
所以我的問題是\\nomencl_command
在哪里進一步定義?
相關代碼在src/LaTeX.cpp
。 請注意以下內容,一些診斷信息被寫入了乳膠調試標志。 如果您使用lyx -dbg latex
運行LyX,則可以在終端上看到此信息。
以下是來自即將發布(幾天之內)的LyX 2.1的src/LaTeX.cpp
文件的摘錄。
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();
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.