diff --git a/lib/configure.py b/lib/configure.py index aff725605a..e369b68e14 100644 --- a/lib/configure.py +++ b/lib/configure.py @@ -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 diff --git a/src/LaTeX.cpp b/src/LaTeX.cpp index d8d3fad2f7..d7fe03f770 100644 --- a/src/LaTeX.cpp +++ b/src/LaTeX.cpp @@ -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 const & bibtex_info) +bool LaTeX::runBibTeX(vector const & bibtex_info, + OutputParams const & runparams) { bool result = false; for (vector::const_iterator it = bibtex_info.begin(); @@ -558,7 +561,9 @@ bool LaTeX::runBibTeX(vector 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()))); diff --git a/src/LaTeX.h b/src/LaTeX.h index 24c2ea27bf..78c283d85a 100644 --- a/src/LaTeX.h +++ b/src/LaTeX.h @@ -188,7 +188,7 @@ private: void updateBibtexDependencies(DepTable &, std::vector const &); /// - bool runBibTeX(std::vector const &); + bool runBibTeX(std::vector const &, OutputParams const &); /// void deleteFilesOnError() const; diff --git a/src/LyXFunc.cpp b/src/LyXFunc.cpp index a08aa07d4a..59d6215989 100644 --- a/src/LyXFunc.cpp +++ b/src/LyXFunc.cpp @@ -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: diff --git a/src/LyXRC.cpp b/src/LyXRC.cpp index d4e214b4d5..b1240cd069 100644 --- a/src/LyXRC.cpp +++ b/src/LyXRC.cpp @@ -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; diff --git a/src/LyXRC.h b/src/LyXRC.h index 15268b850a..d8fee9d082 100644 --- a/src/LyXRC.h +++ b/src/LyXRC.h @@ -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; /// diff --git a/src/frontends/qt4/GuiPrefs.cpp b/src/frontends/qt4/GuiPrefs.cpp index 208ed5e188..ec1585b591 100644 --- a/src/frontends/qt4/GuiPrefs.cpp +++ b/src/frontends/qt4/GuiPrefs.cpp @@ -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)); diff --git a/src/frontends/qt4/ui/PrefLatexUi.ui b/src/frontends/qt4/ui/PrefLatexUi.ui index f81fbdec87..0e24d8a14a 100644 --- a/src/frontends/qt4/ui/PrefLatexUi.ui +++ b/src/frontends/qt4/ui/PrefLatexUi.ui @@ -6,7 +6,7 @@ 0 0 427 - 359 + 367 @@ -19,87 +19,7 @@ 6 - - - - &Nomenclature command: - - - latexNomenclED - - - - - - - Command and options for nomencl (usually makeindex) - - - - - - - &Index command: - - - latexIndexED - - - - - - - Index command and options (makeindex, xindy) - - - - - - - Optional paper size flag (-paper) for some DVI viewers - - - - - - - &DVI viewer paper size options: - - - latexDviPaperED - - - - - - - true - - - - - - 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. - - - Qt::LeftToRight - - - &Use Windows-style paths in LaTeX files - - - - - - - Set class options to default on class change - - - R&eset class options when document class changes - - - - + Qt::Vertical @@ -110,11 +30,21 @@ 409 - 20 + 21 + + + + Set class options to default on class change + + + R&eset class options when document class changes + + + @@ -178,13 +108,6 @@ - - - - BibTeX command and options - - - @@ -195,16 +118,6 @@ - - - - &BibTeX command: - - - latexBibtexED - - - @@ -232,6 +145,127 @@ + + + + BibTeX command and options + + + + + + + &BibTeX command: + + + latexBibtexED + + + + + + + &Nomenclature command: + + + latexNomenclED + + + + + + + true + + + + + + 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. + + + Qt::LeftToRight + + + &Use Windows-style paths in LaTeX files + + + + + + + Command and options for nomencl (usually makeindex) + + + + + + + Index command and options (makeindex, xindy) + + + + + + + &Index command: + + + latexIndexED + + + + + + + Specific index command and options for pLaTeX (Japanese) + + + + + + + Specific BibTeX command and options for pLaTeX (Japanese) + + + + + + + BibTeX command (&Japanese): + + + latexJBibtexED + + + + + + + Index command (Ja&panese): + + + latexJIndexED + + + + + + + Optional paper size flag (-paper) for some DVI viewers + + + + + + + &DVI viewer paper size options: + + + latexDviPaperED + + +