* Properly separate the specific Japanese (i.e., pLaTeX) auxiliary programs (jbibtex, mendex)

from the standard LaTeX programs.
  These programs are only used now if the document actually uses Japanese, not always if they are found.
  (bug 5601 a.o.).

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@29238 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jürgen Spitzmüller 2009-04-13 09:53:40 +00:00
parent a6145ac4cd
commit 26b361417d
8 changed files with 202 additions and 107 deletions

View File

@ -591,10 +591,14 @@ def checkOtherEntries():
''' entries other than Format and Converter '''
checkProg('ChkTeX', ['chktex -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38'],
rc_entry = [ r'\chktex_command "%%"' ])
checkProg('BibTeX', ['jbibtex', 'bibtex'],
checkProg('BibTeX', ['bibtex'],
rc_entry = [ r'\bibtex_command "%%"' ])
checkProg('JBibTeX, the Japanese BibTeX', ['jbibtex', 'bibtex'],
rc_entry = [ r'\jbibtex_command "%%"' ])
checkProg('an index processor', ['texindy', 'makeindex -c -q'],
rc_entry = [ r'\index_command "%%"' ])
checkProg('an index processor appropriate to Japanese', ['mendex -c -q', 'makeindex -c -q'],
rc_entry = [ r'\jindex_command "%%"' ])
checkProg('a nomenclature processor', ['makeindex'],
rc_entry = [ r'\nomencl_command "makeindex -s nomencl.ist"' ])
## FIXME: OCTAVE is not used anywhere

View File

@ -283,7 +283,7 @@ int LaTeX::run(TeXErrors & terr)
LYXERR(Debug::LATEX, "Running BibTeX.");
message(_("Running BibTeX."));
updateBibtexDependencies(head, bibtex_info);
rerun |= runBibTeX(bibtex_info);
rerun |= runBibTeX(bibtex_info, runparams);
} else if (!had_depfile) {
/// If we run pdflatex on the file after running latex on it,
/// then we do not need to run bibtex, but we do need to
@ -335,7 +335,7 @@ int LaTeX::run(TeXErrors & terr)
LYXERR(Debug::LATEX, "Running BibTeX.");
message(_("Running BibTeX."));
updateBibtexDependencies(head, bibtex_info);
rerun |= runBibTeX(bibtex_info);
rerun |= runBibTeX(bibtex_info, runparams);
}
// 4
@ -414,7 +414,9 @@ bool LaTeX::runMakeIndex(string const & f, OutputParams const & runparams,
{
LYXERR(Debug::LATEX,
"idx file has been made, running makeindex on file " << f);
string tmp = lyxrc.index_command + ' ';
string tmp = runparams.use_japanese ?
lyxrc.jindex_command : lyxrc.index_command;
tmp += ' ';
tmp = subst(tmp, "$$lang", runparams.document_language);
tmp += quoteName(f);
@ -549,7 +551,8 @@ void LaTeX::updateBibtexDependencies(DepTable & dep,
}
bool LaTeX::runBibTeX(vector<AuxInfo> const & bibtex_info)
bool LaTeX::runBibTeX(vector<AuxInfo> const & bibtex_info,
OutputParams const & runparams)
{
bool result = false;
for (vector<AuxInfo>::const_iterator it = bibtex_info.begin();
@ -558,7 +561,9 @@ bool LaTeX::runBibTeX(vector<AuxInfo> const & bibtex_info)
continue;
result = true;
string tmp = lyxrc.bibtex_command + " ";
string tmp = runparams.use_japanese ?
lyxrc.jbibtex_command : lyxrc.bibtex_command;
tmp += " ";
// onlyFilename() is needed for cygwin
tmp += quoteName(onlyFilename(removeExtension(
it->aux_file.absFilename())));

View File

@ -188,7 +188,7 @@ private:
void updateBibtexDependencies(DepTable &, std::vector<AuxInfo> const &);
///
bool runBibTeX(std::vector<AuxInfo> const &);
bool runBibTeX(std::vector<AuxInfo> const &, OutputParams const &);
///
void deleteFilesOnError() const;

View File

@ -1911,6 +1911,8 @@ void actOnUpdatedPrefs(LyXRC const & lyxrc_orig, LyXRC const & lyxrc_new)
case LyXRC::RC_FORMAT:
case LyXRC::RC_GROUP_LAYOUTS:
case LyXRC::RC_INDEX_COMMAND:
case LyXRC::RC_JBIBTEX_COMMAND:
case LyXRC::RC_JINDEX_COMMAND:
case LyXRC::RC_NOMENCL_COMMAND:
case LyXRC::RC_INPUT:
case LyXRC::RC_KBMAP:

View File

@ -99,6 +99,8 @@ LexerKeyword lyxrcTags[] = {
{ "\\gui_language", LyXRC::RC_GUI_LANGUAGE },
{ "\\index_command", LyXRC::RC_INDEX_COMMAND },
{ "\\input", LyXRC::RC_INPUT },
{ "\\jbibtex_command", LyXRC::RC_JBIBTEX_COMMAND },
{ "\\jindex_command", LyXRC::RC_JINDEX_COMMAND },
{ "\\kbmap", LyXRC::RC_KBMAP },
{ "\\kbmap_primary", LyXRC::RC_KBMAP_PRIMARY },
{ "\\kbmap_secondary", LyXRC::RC_KBMAP_SECONDARY },
@ -595,12 +597,24 @@ int LyXRC::read(Lexer & lexrc)
}
break;
case RC_JBIBTEX_COMMAND:
if (lexrc.next(true)) {
jbibtex_command = lexrc.getString();
}
break;
case RC_INDEX_COMMAND:
if (lexrc.next(true)) {
index_command = lexrc.getString();
}
break;
case RC_JINDEX_COMMAND:
if (lexrc.next(true)) {
jindex_command = lexrc.getString();
}
break;
case RC_NOMENCL_COMMAND:
if (lexrc.next(true)) {
nomencl_command = lexrc.getString();
@ -1337,6 +1351,13 @@ void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) c
}
if (tag != RC_LAST)
break;
case RC_JBIBTEX_COMMAND:
if (ignore_system_lyxrc ||
jbibtex_command != system_lyxrc.jbibtex_command) {
os << "\\jbibtex_command \"" << escapeCommand(jbibtex_command) << "\"\n";
}
if (tag != RC_LAST)
break;
case RC_INDEX_COMMAND:
if (ignore_system_lyxrc ||
index_command != system_lyxrc.index_command) {
@ -1344,6 +1365,13 @@ void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) c
}
if (tag != RC_LAST)
break;
case RC_JINDEX_COMMAND:
if (ignore_system_lyxrc ||
jindex_command != system_lyxrc.jindex_command) {
os << "\\jindex_command \"" << escapeCommand(jindex_command) << "\"\n";
}
if (tag != RC_LAST)
break;
case RC_NOMENCL_COMMAND:
if (ignore_system_lyxrc ||
nomencl_command != system_lyxrc.nomencl_command) {
@ -2483,6 +2511,10 @@ string const LyXRC::getDescription(LyXRCTags tag)
str = _("Define the options of bibtex (cf. man bibtex) or select an alternative compiler (e.g. mlbibtex or bibulus).");
break;
case RC_JBIBTEX_COMMAND:
str = _("Define the options of the bibtex program for PLaTeX (Japanese LaTeX).");
break;
case RC_BINDFILE:
str = _("Keybindings file. Can either specify an absolute path, or LyX will look in its global and local bind/ directories.");
break;
@ -2570,6 +2602,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\".");
break;
case RC_JINDEX_COMMAND:
str = _("Define the options of the index program for PLaTeX (Japanese LaTeX).");
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;

View File

@ -86,6 +86,8 @@ public:
RC_GROUP_LAYOUTS,
RC_INDEX_COMMAND,
RC_INPUT,
RC_JBIBTEX_COMMAND,
RC_JINDEX_COMMAND,
RC_KBMAP,
RC_KBMAP_PRIMARY,
RC_KBMAP_SECONDARY,
@ -244,8 +246,12 @@ public:
std::string chktex_command;
/// command to run bibtex incl. options
std::string bibtex_command;
/// command to run japanese bibtex incl. options
std::string jbibtex_command;
/// command to run makeindex incl. options or other index programs
std::string index_command;
/// command to run japanese index program incl. options
std::string jindex_command;
/// command to run makeindex incl. options for nomencl
std::string nomencl_command;
///

View File

@ -571,8 +571,12 @@ PrefLatex::PrefLatex(GuiPreferences * form)
this, SIGNAL(changed()));
connect(latexBibtexED, SIGNAL(textChanged(QString)),
this, SIGNAL(changed()));
connect(latexJBibtexED, SIGNAL(textChanged(QString)),
this, SIGNAL(changed()));
connect(latexIndexED, SIGNAL(textChanged(QString)),
this, SIGNAL(changed()));
connect(latexJIndexED, SIGNAL(textChanged(QString)),
this, SIGNAL(changed()));
connect(latexAutoresetCB, SIGNAL(clicked()),
this, SIGNAL(changed()));
connect(latexDviPaperED, SIGNAL(textChanged(QString)),
@ -595,7 +599,9 @@ void PrefLatex::apply(LyXRC & rc) const
rc.fontenc = fromqstr(latexEncodingED->text());
rc.chktex_command = fromqstr(latexChecktexED->text());
rc.bibtex_command = fromqstr(latexBibtexED->text());
rc.jbibtex_command = fromqstr(latexJBibtexED->text());
rc.index_command = fromqstr(latexIndexED->text());
rc.index_command = fromqstr(latexJIndexED->text());
rc.nomencl_command = fromqstr(latexNomenclED->text());
rc.auto_reset_options = latexAutoresetCB->isChecked();
rc.view_dvi_paper_option = fromqstr(latexDviPaperED->text());
@ -612,7 +618,9 @@ void PrefLatex::update(LyXRC const & rc)
latexEncodingED->setText(toqstr(rc.fontenc));
latexChecktexED->setText(toqstr(rc.chktex_command));
latexBibtexED->setText(toqstr(rc.bibtex_command));
latexJBibtexED->setText(toqstr(rc.jbibtex_command));
latexIndexED->setText(toqstr(rc.index_command));
latexJIndexED->setText(toqstr(rc.jindex_command));
latexNomenclED->setText(toqstr(rc.nomencl_command));
latexAutoresetCB->setChecked(rc.auto_reset_options);
latexDviPaperED->setText(toqstr(rc.view_dvi_paper_option));

View File

@ -6,7 +6,7 @@
<x>0</x>
<y>0</y>
<width>427</width>
<height>359</height>
<height>367</height>
</rect>
</property>
<property name="windowTitle" >
@ -19,87 +19,7 @@
<property name="spacing" >
<number>6</number>
</property>
<item row="5" column="0" >
<widget class="QLabel" name="latexNomenclLA" >
<property name="text" >
<string>&amp;Nomenclature command:</string>
</property>
<property name="buddy" >
<cstring>latexNomenclED</cstring>
</property>
</widget>
</item>
<item row="5" column="1" colspan="2" >
<widget class="QLineEdit" name="latexNomenclED" >
<property name="toolTip" >
<string>Command and options for nomencl (usually makeindex)</string>
</property>
</widget>
</item>
<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" >
<property name="enabled" >
<bool>true</bool>
</property>
<property name="toolTip" >
<string/>
</property>
<property name="whatsThis" >
<string>Select if LyX should output Windows-style paths rather than Posix-style paths to LaTeX files. Useful if you're using the native Windows MikTeX rather than the Cygwin teTeX.</string>
</property>
<property name="layoutDirection" >
<enum>Qt::LeftToRight</enum>
</property>
<property name="text" >
<string>&amp;Use Windows-style paths in LaTeX files</string>
</property>
</widget>
</item>
<item row="8" column="0" colspan="3" >
<widget class="QCheckBox" name="latexAutoresetCB" >
<property name="toolTip" >
<string>Set class options to default on class change</string>
</property>
<property name="text" >
<string>R&amp;eset class options when document class changes</string>
</property>
</widget>
</item>
<item row="9" column="0" colspan="3" >
<item row="11" column="0" colspan="3" >
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
@ -110,11 +30,21 @@
<property name="sizeHint" >
<size>
<width>409</width>
<height>20</height>
<height>21</height>
</size>
</property>
</spacer>
</item>
<item row="10" column="0" colspan="3" >
<widget class="QCheckBox" name="latexAutoresetCB" >
<property name="toolTip" >
<string>Set class options to default on class change</string>
</property>
<property name="text" >
<string>R&amp;eset class options when document class changes</string>
</property>
</widget>
</item>
<item row="1" column="1" >
<widget class="QComboBox" name="latexPaperSizeCO" >
<item>
@ -178,13 +108,6 @@
</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" >
@ -195,16 +118,6 @@
</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" >
@ -232,6 +145,127 @@
</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="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="7" column="0" >
<widget class="QLabel" name="latexNomenclLA" >
<property name="text" >
<string>&amp;Nomenclature command:</string>
</property>
<property name="buddy" >
<cstring>latexNomenclED</cstring>
</property>
</widget>
</item>
<item row="9" column="0" colspan="3" >
<widget class="QCheckBox" name="pathCB" >
<property name="enabled" >
<bool>true</bool>
</property>
<property name="toolTip" >
<string/>
</property>
<property name="whatsThis" >
<string>Select if LyX should output Windows-style paths rather than Posix-style paths to LaTeX files. Useful if you're using the native Windows MikTeX rather than the Cygwin teTeX.</string>
</property>
<property name="layoutDirection" >
<enum>Qt::LeftToRight</enum>
</property>
<property name="text" >
<string>&amp;Use Windows-style paths in LaTeX files</string>
</property>
</widget>
</item>
<item row="7" column="1" colspan="2" >
<widget class="QLineEdit" name="latexNomenclED" >
<property name="toolTip" >
<string>Command and options for nomencl (usually makeindex)</string>
</property>
</widget>
</item>
<item row="5" 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="5" 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="6" column="1" colspan="2" >
<widget class="QLineEdit" name="latexJIndexED" >
<property name="toolTip" >
<string>Specific index command and options for pLaTeX (Japanese)</string>
</property>
</widget>
</item>
<item row="4" column="1" colspan="2" >
<widget class="QLineEdit" name="latexJBibtexED" >
<property name="toolTip" >
<string>Specific BibTeX command and options for pLaTeX (Japanese)</string>
</property>
</widget>
</item>
<item row="4" column="0" >
<widget class="QLabel" name="latexJBibtexLA" >
<property name="text" >
<string>BibTeX command (&amp;Japanese):</string>
</property>
<property name="buddy" >
<cstring>latexJBibtexED</cstring>
</property>
</widget>
</item>
<item row="6" column="0" >
<widget class="QLabel" name="latexJIndexLA" >
<property name="text" >
<string>Index command (Ja&amp;panese):</string>
</property>
<property name="buddy" >
<cstring>latexJIndexED</cstring>
</property>
</widget>
</item>
<item row="8" 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="8" 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>
</layout>
</widget>
<tabstops>