* separate nomencl processing command from index processing command, since nomencl

relies on makeindex (with specific options) [bug 5184].

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@26226 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jürgen Spitzmüller 2008-08-23 09:44:00 +00:00
parent b556fe1bcb
commit 641708ac4b
7 changed files with 163 additions and 117 deletions

View File

@ -594,6 +594,8 @@ def checkOtherEntries():
rc_entry = [ r'\bibtex_command "%%"' ]) rc_entry = [ r'\bibtex_command "%%"' ])
checkProg('an index processor', ['texindy', 'makeindex -c -q'], checkProg('an index processor', ['texindy', 'makeindex -c -q'],
rc_entry = [ r'\index_command "%%"' ]) rc_entry = [ r'\index_command "%%"' ])
checkProg('a nomenclature processor', ['makeindex'],
rc_entry = [ r'\nomencl_command "makeindex -s nomencl.ist"' ])
checkProg('a spellchecker', ['ispell'], checkProg('a spellchecker', ['ispell'],
rc_entry = [ r'\spell_command "%%"' ]) rc_entry = [ r'\spell_command "%%"' ])
## FIXME: OCTAVE is not used anywhere ## FIXME: OCTAVE is not used anywhere

View File

@ -261,7 +261,7 @@ int LaTeX::run(TeXErrors & terr)
if (head.haschanged(idxfile)) { if (head.haschanged(idxfile)) {
// no checks for now // no checks for now
LYXERR(Debug::LATEX, "Running MakeIndex."); LYXERR(Debug::LATEX, "Running MakeIndex.");
message(_("Running MakeIndex.")); message(_("Running Index Processor."));
// onlyFilename() is needed for cygwin // onlyFilename() is needed for cygwin
rerun |= runMakeIndex(onlyFilename(idxfile.absFilename()), rerun |= runMakeIndex(onlyFilename(idxfile.absFilename()),
runparams); runparams);
@ -335,7 +335,7 @@ int LaTeX::run(TeXErrors & terr)
if (head.haschanged(idxfile)) { if (head.haschanged(idxfile)) {
// no checks for now // no checks for now
LYXERR(Debug::LATEX, "Running MakeIndex."); LYXERR(Debug::LATEX, "Running MakeIndex.");
message(_("Running MakeIndex.")); message(_("Running Index Processor."));
// onlyFilename() is needed for cygwin // onlyFilename() is needed for cygwin
rerun = runMakeIndex(onlyFilename(changeExtension( rerun = runMakeIndex(onlyFilename(changeExtension(
file.absFilename(), ".idx")), runparams); file.absFilename(), ".idx")), runparams);
@ -416,12 +416,14 @@ bool LaTeX::runMakeIndexNomencl(FileName const & file,
{ {
LYXERR(Debug::LATEX, "Running MakeIndex for nomencl."); LYXERR(Debug::LATEX, "Running MakeIndex for nomencl.");
message(_("Running MakeIndex for nomencl.")); message(_("Running MakeIndex for nomencl."));
string tmp = lyxrc.nomencl_command + ' ';
// onlyFilename() is needed for cygwin // onlyFilename() is needed for cygwin
string const nomenclstr = " -s nomencl.ist -o " tmp += quoteName(onlyFilename(changeExtension(file.absFilename(), nlo)));
tmp += " -o "
+ onlyFilename(changeExtension(file.toFilesystemEncoding(), nls)); + onlyFilename(changeExtension(file.toFilesystemEncoding(), nls));
return runMakeIndex( Systemcall one;
onlyFilename(changeExtension(file.absFilename(), nlo)), one.startscript(Systemcall::Wait, tmp);
runparams, nomenclstr); return true;
} }

View File

@ -1837,6 +1837,7 @@ void actOnUpdatedPrefs(LyXRC const & lyxrc_orig, LyXRC const & lyxrc_new)
case LyXRC::RC_FORMAT: case LyXRC::RC_FORMAT:
case LyXRC::RC_GROUP_LAYOUTS: case LyXRC::RC_GROUP_LAYOUTS:
case LyXRC::RC_INDEX_COMMAND: case LyXRC::RC_INDEX_COMMAND:
case LyXRC::RC_NOMENCL_COMMAND:
case LyXRC::RC_INPUT: case LyXRC::RC_INPUT:
case LyXRC::RC_KBMAP: case LyXRC::RC_KBMAP:
case LyXRC::RC_KBMAP_PRIMARY: case LyXRC::RC_KBMAP_PRIMARY:

View File

@ -116,6 +116,7 @@ LexerKeyword lyxrcTags[] = {
{ "\\make_backup", LyXRC::RC_MAKE_BACKUP }, { "\\make_backup", LyXRC::RC_MAKE_BACKUP },
{ "\\mark_foreign_language", LyXRC::RC_MARK_FOREIGN_LANGUAGE }, { "\\mark_foreign_language", LyXRC::RC_MARK_FOREIGN_LANGUAGE },
{ "\\mouse_wheel_speed", LyXRC::RC_MOUSE_WHEEL_SPEED }, { "\\mouse_wheel_speed", LyXRC::RC_MOUSE_WHEEL_SPEED },
{ "\\nomencl_command", LyXRC::RC_NOMENCL_COMMAND },
{ "\\num_lastfiles", LyXRC::RC_NUMLASTFILES }, { "\\num_lastfiles", LyXRC::RC_NUMLASTFILES },
{ "\\open_buffers_in_tabs", LyXRC::RC_OPEN_BUFFERS_IN_TABS }, { "\\open_buffers_in_tabs", LyXRC::RC_OPEN_BUFFERS_IN_TABS },
{ "\\path_prefix", LyXRC::RC_PATH_PREFIX }, { "\\path_prefix", LyXRC::RC_PATH_PREFIX },
@ -226,6 +227,7 @@ void LyXRC::setDefaults()
bibtex_command = "bibtex"; bibtex_command = "bibtex";
fontenc = "default"; fontenc = "default";
index_command = "makeindex -c -q"; index_command = "makeindex -c -q";
nomencl_command = "makeindex -s nomencl.ist";
dpi = 75; dpi = 75;
// Because a screen typically is wider than a piece of paper: // Because a screen typically is wider than a piece of paper:
zoom = 150; zoom = 150;
@ -604,6 +606,12 @@ int LyXRC::read(Lexer & lexrc)
} }
break; break;
case RC_NOMENCL_COMMAND:
if (lexrc.next(true)) {
nomencl_command = lexrc.getString();
}
break;
case RC_SCREEN_DPI: case RC_SCREEN_DPI:
lexrc >> dpi; lexrc >> dpi;
break; break;
@ -1321,6 +1329,13 @@ void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) c
} }
if (tag != RC_LAST) if (tag != RC_LAST)
break; break;
case RC_NOMENCL_COMMAND:
if (ignore_system_lyxrc ||
nomencl_command != system_lyxrc.nomencl_command) {
os << "\\nomencl_command \"" << escapeCommand(nomencl_command) << "\"\n";
}
if (tag != RC_LAST)
break;
case RC_TEX_EXPECTS_WINDOWS_PATHS: case RC_TEX_EXPECTS_WINDOWS_PATHS:
if (ignore_system_lyxrc || if (ignore_system_lyxrc ||
windows_style_tex_paths != system_lyxrc.windows_style_tex_paths) { windows_style_tex_paths != system_lyxrc.windows_style_tex_paths) {
@ -2535,6 +2550,10 @@ string const LyXRC::getDescription(LyXRCTags tag)
str = _("Define the options of makeindex (cf. man makeindex) or select an alternative compiler. E.g., using xindy/make-rules, the command string would be \"makeindex.sh -m $$lang\"."); str = _("Define the options of makeindex (cf. man makeindex) or select an alternative compiler. E.g., using xindy/make-rules, the command string would be \"makeindex.sh -m $$lang\".");
break; break;
case RC_NOMENCL_COMMAND:
str = _("Define the options of makeindex (cf. man makeindex) to be used for nomenclatures. This might differ from the index processing options.");
break;
case RC_INPUT: case RC_INPUT:
break; break;

View File

@ -103,6 +103,7 @@ public:
RC_MAKE_BACKUP, RC_MAKE_BACKUP,
RC_MARK_FOREIGN_LANGUAGE, RC_MARK_FOREIGN_LANGUAGE,
RC_MOUSE_WHEEL_SPEED, RC_MOUSE_WHEEL_SPEED,
RC_NOMENCL_COMMAND,
RC_NUMLASTFILES, RC_NUMLASTFILES,
RC_PATH_PREFIX, RC_PATH_PREFIX,
RC_PERS_DICT, RC_PERS_DICT,
@ -246,6 +247,8 @@ public:
std::string bibtex_command; std::string bibtex_command;
/// command to run makeindex incl. options or other index programs /// command to run makeindex incl. options or other index programs
std::string index_command; std::string index_command;
/// command to run makeindex incl. options for nomencl
std::string nomencl_command;
/// ///
std::string document_path; std::string document_path;
/// ///

View File

@ -556,6 +556,7 @@ void PrefLatex::apply(LyXRC & rc) const
rc.chktex_command = fromqstr(latexChecktexED->text()); rc.chktex_command = fromqstr(latexChecktexED->text());
rc.bibtex_command = fromqstr(latexBibtexED->text()); rc.bibtex_command = fromqstr(latexBibtexED->text());
rc.index_command = fromqstr(latexIndexED->text()); rc.index_command = fromqstr(latexIndexED->text());
rc.nomencl_command = fromqstr(latexNomenclED->text());
rc.auto_reset_options = latexAutoresetCB->isChecked(); rc.auto_reset_options = latexAutoresetCB->isChecked();
rc.view_dvi_paper_option = fromqstr(latexDviPaperED->text()); rc.view_dvi_paper_option = fromqstr(latexDviPaperED->text());
rc.default_papersize = rc.default_papersize =
@ -572,6 +573,7 @@ void PrefLatex::update(LyXRC const & rc)
latexChecktexED->setText(toqstr(rc.chktex_command)); latexChecktexED->setText(toqstr(rc.chktex_command));
latexBibtexED->setText(toqstr(rc.bibtex_command)); latexBibtexED->setText(toqstr(rc.bibtex_command));
latexIndexED->setText(toqstr(rc.index_command)); latexIndexED->setText(toqstr(rc.index_command));
latexNomenclED->setText(toqstr(rc.nomencl_command));
latexAutoresetCB->setChecked(rc.auto_reset_options); latexAutoresetCB->setChecked(rc.auto_reset_options);
latexDviPaperED->setText(toqstr(rc.view_dvi_paper_option)); latexDviPaperED->setText(toqstr(rc.view_dvi_paper_option));
latexPaperSizeCO->setCurrentIndex( latexPaperSizeCO->setCurrentIndex(

View File

@ -6,7 +6,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>427</width> <width>427</width>
<height>308</height> <height>359</height>
</rect> </rect>
</property> </property>
<property name="windowTitle" > <property name="windowTitle" >
@ -19,33 +19,58 @@
<property name="spacing" > <property name="spacing" >
<number>6</number> <number>6</number>
</property> </property>
<item row="7" column="0" colspan="3" > <item row="5" column="0" >
<widget class="QCheckBox" name="latexAutoresetCB" > <widget class="QLabel" name="latexNomenclLA" >
<property name="toolTip" >
<string>Set class options to default on class change</string>
</property>
<property name="text" > <property name="text" >
<string>&amp;Reset class options when document class changes</string> <string>&amp;Nomenclature command:</string>
</property>
<property name="buddy" >
<cstring>latexIndexED</cstring>
</property> </property>
</widget> </widget>
</item> </item>
<item row="8" column="0" colspan="3" > <item row="5" column="1" colspan="2" >
<spacer> <widget class="QLineEdit" name="latexNomenclED" >
<property name="orientation" > <property name="toolTip" >
<enum>Qt::Vertical</enum> <string>Command and options for nomencl (usually makeindex)</string>
</property> </property>
<property name="sizeType" > </widget>
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" >
<size>
<width>409</width>
<height>20</height>
</size>
</property>
</spacer>
</item> </item>
<item row="6" column="0" colspan="3" > <item row="4" column="0" >
<widget class="QLabel" name="latexIndexLA" >
<property name="text" >
<string>&amp;Index command:</string>
</property>
<property name="buddy" >
<cstring>latexIndexED</cstring>
</property>
</widget>
</item>
<item row="4" column="1" colspan="2" >
<widget class="QLineEdit" name="latexIndexED" >
<property name="toolTip" >
<string>Index command and options (makeindex, xindy)</string>
</property>
</widget>
</item>
<item row="6" column="1" colspan="2" >
<widget class="QLineEdit" name="latexDviPaperED" >
<property name="toolTip" >
<string>Optional paper size flag (-paper) for some DVI viewers</string>
</property>
</widget>
</item>
<item row="6" column="0" >
<widget class="QLabel" name="latexDviPaperLA" >
<property name="text" >
<string>&amp;DVI viewer paper size options:</string>
</property>
<property name="buddy" >
<cstring>latexDviPaperED</cstring>
</property>
</widget>
</item>
<item row="7" column="0" colspan="3" >
<widget class="QCheckBox" name="pathCB" > <widget class="QCheckBox" name="pathCB" >
<property name="enabled" > <property name="enabled" >
<bool>true</bool> <bool>true</bool>
@ -64,113 +89,32 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="0" > <item row="8" column="0" colspan="3" >
<widget class="QLabel" name="latexPaperSizeLA" > <widget class="QCheckBox" name="latexAutoresetCB" >
<property name="text" >
<string>Default paper si&amp;ze:</string>
</property>
<property name="buddy" >
<cstring>latexPaperSizeCO</cstring>
</property>
</widget>
</item>
<item row="0" column="0" >
<widget class="QLabel" name="latexEncodingLA" >
<property name="text" >
<string>Te&amp;X encoding:</string>
</property>
<property name="buddy" >
<cstring>latexEncodingED</cstring>
</property>
</widget>
</item>
<item row="2" column="1" colspan="2" >
<widget class="QLineEdit" name="latexChecktexED" >
<property name="toolTip" > <property name="toolTip" >
<string>CheckTeX start options and flags</string> <string>Set class options to default on class change</string>
</property> </property>
</widget>
</item>
<item row="4" column="0" >
<widget class="QLabel" name="latexIndexLA" >
<property name="text" > <property name="text" >
<string>&amp;Index command:</string> <string>&amp;Reset class options when document class changes</string>
</property>
<property name="buddy" >
<cstring>latexIndexED</cstring>
</property> </property>
</widget> </widget>
</item> </item>
<item row="3" column="0" > <item row="9" column="0" colspan="3" >
<widget class="QLabel" name="latexBibtexLA" >
<property name="text" >
<string>&amp;BibTeX command:</string>
</property>
<property name="buddy" >
<cstring>latexBibtexED</cstring>
</property>
</widget>
</item>
<item row="5" column="0" >
<widget class="QLabel" name="latexDviPaperLA" >
<property name="text" >
<string>&amp;DVI viewer paper size options:</string>
</property>
<property name="buddy" >
<cstring>latexDviPaperED</cstring>
</property>
</widget>
</item>
<item row="2" column="0" >
<widget class="QLabel" name="latexChecktexLA" >
<property name="text" >
<string>Chec&amp;kTeX command:</string>
</property>
<property name="buddy" >
<cstring>latexChecktexED</cstring>
</property>
</widget>
</item>
<item row="3" column="1" colspan="2" >
<widget class="QLineEdit" name="latexBibtexED" >
<property name="toolTip" >
<string>BibTeX command and options</string>
</property>
</widget>
</item>
<item row="5" column="1" colspan="2" >
<widget class="QLineEdit" name="latexDviPaperED" >
<property name="toolTip" >
<string>Optional paper size flag (-paper) for some DVI viewers</string>
</property>
</widget>
</item>
<item row="4" column="1" colspan="2" >
<widget class="QLineEdit" name="latexIndexED" >
<property name="toolTip" >
<string>Index command and options (makeindex, xindy)</string>
</property>
</widget>
</item>
<item rowspan="2" row="0" column="2" >
<spacer> <spacer>
<property name="orientation" > <property name="orientation" >
<enum>Qt::Horizontal</enum> <enum>Qt::Vertical</enum>
</property> </property>
<property name="sizeType" > <property name="sizeType" >
<enum>QSizePolicy::Expanding</enum> <enum>QSizePolicy::Expanding</enum>
</property> </property>
<property name="sizeHint" > <property name="sizeHint" >
<size> <size>
<width>21</width> <width>409</width>
<height>52</height> <height>20</height>
</size> </size>
</property> </property>
</spacer> </spacer>
</item> </item>
<item row="0" column="1" >
<widget class="QLineEdit" name="latexEncodingED" />
</item>
<item row="1" column="1" > <item row="1" column="1" >
<widget class="QComboBox" name="latexPaperSizeCO" > <widget class="QComboBox" name="latexPaperSizeCO" >
<item> <item>
@ -215,6 +159,79 @@
</item> </item>
</widget> </widget>
</item> </item>
<item row="0" column="1" >
<widget class="QLineEdit" name="latexEncodingED" />
</item>
<item rowspan="2" row="0" column="2" >
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" >
<size>
<width>21</width>
<height>52</height>
</size>
</property>
</spacer>
</item>
<item row="3" column="1" colspan="2" >
<widget class="QLineEdit" name="latexBibtexED" >
<property name="toolTip" >
<string>BibTeX command and options</string>
</property>
</widget>
</item>
<item row="2" column="0" >
<widget class="QLabel" name="latexChecktexLA" >
<property name="text" >
<string>Chec&amp;kTeX command:</string>
</property>
<property name="buddy" >
<cstring>latexChecktexED</cstring>
</property>
</widget>
</item>
<item row="3" column="0" >
<widget class="QLabel" name="latexBibtexLA" >
<property name="text" >
<string>&amp;BibTeX command:</string>
</property>
<property name="buddy" >
<cstring>latexBibtexED</cstring>
</property>
</widget>
</item>
<item row="2" column="1" colspan="2" >
<widget class="QLineEdit" name="latexChecktexED" >
<property name="toolTip" >
<string>CheckTeX start options and flags</string>
</property>
</widget>
</item>
<item row="0" column="0" >
<widget class="QLabel" name="latexEncodingLA" >
<property name="text" >
<string>Te&amp;X encoding:</string>
</property>
<property name="buddy" >
<cstring>latexEncodingED</cstring>
</property>
</widget>
</item>
<item row="1" column="0" >
<widget class="QLabel" name="latexPaperSizeLA" >
<property name="text" >
<string>Default paper si&amp;ze:</string>
</property>
<property name="buddy" >
<cstring>latexPaperSizeCO</cstring>
</property>
</widget>
</item>
</layout> </layout>
</widget> </widget>
<tabstops> <tabstops>