X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FLaTeX.cpp;h=49968ffdc8a6884995b4f53ff166c66fe09b7b05;hb=27d580b5c057d565b9b4b50c811f6e1fab7f1246;hp=8a74b61ea01a8b722fa724ada1134220131d4a8f;hpb=b6938386a2a34492ba23444d26877fef554acf64;p=lyx.git diff --git a/src/LaTeX.cpp b/src/LaTeX.cpp index 8a74b61ea0..49968ffdc8 100644 --- a/src/LaTeX.cpp +++ b/src/LaTeX.cpp @@ -50,7 +50,6 @@ namespace os = support::os; // different way. // - the makeindex style files should be taken care of with // the dependency mechanism. -// - makeindex commandline options should be supported // - somewhere support viewing of bibtex and makeindex log files. // - we should perhaps also scan the bibtex log file @@ -283,7 +282,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 +334,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 @@ -412,11 +411,23 @@ int LaTeX::startscript() bool LaTeX::runMakeIndex(string const & f, OutputParams const & runparams, string const & params) { + string tmp = runparams.use_japanese ? + lyxrc.jindex_command : lyxrc.index_command; + + if (!runparams.index_command.empty()) + tmp = runparams.index_command; + LYXERR(Debug::LATEX, - "idx file has been made, running makeindex on file " << f); - string tmp = lyxrc.index_command + ' '; + "idx file has been made, running index processor (" + << tmp << ") on file " << f); tmp = subst(tmp, "$$lang", runparams.document_language); + if (runparams.use_indices) { + tmp = lyxrc.splitindex_command + " -m " + quoteName(tmp); + LYXERR(Debug::LATEX, + "Multiple indices. Using splitindex command: " << tmp); + } + tmp += ' '; tmp += quoteName(f); tmp += params; Systemcall one; @@ -549,7 +560,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 +570,12 @@ 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; + + if (!runparams.bibtex_command.empty()) + tmp = runparams.bibtex_command; + tmp += " "; // onlyFilename() is needed for cygwin tmp += quoteName(onlyFilename(removeExtension( it->aux_file.absFilename()))); @@ -640,6 +657,12 @@ int LaTeX::scanLogFile(TeXErrors & terr) LYXERR(Debug::LATEX, "We should rerun."); retval |= RERUN; } + } else if (prefixIs(token, "LETTRE WARNING:")) { + if (contains(token, "veuillez recompiler")) { + // lettre.cls + LYXERR(Debug::LATEX, "We should rerun."); + retval |= RERUN; + } } else if (token[0] == '(') { if (contains(token, "Rerun LaTeX") || contains(token, "Rerun to get")) { @@ -648,7 +671,9 @@ int LaTeX::scanLogFile(TeXErrors & terr) retval |= RERUN; } } else if (prefixIs(token, "! ") - || (fle_style && regex_match(token, sub, file_line_error))) { + || (fle_style + && regex_match(token, sub, file_line_error) + && !contains(token, "pdfTeX warning"))) { // Ok, we have something that looks like a TeX Error // but what do we really have. @@ -767,12 +792,13 @@ bool handleFoundFile(string const & ff, DepTable & head) // (1) foundfile is an // absolute path and should // be inserted. - FileName absname(foundfile); - if (absname.isAbsolute()) { + FileName absname; + if (FileName::isAbsolute(foundfile)) { LYXERR(Debug::DEPEND, "AbsolutePath file: " << foundfile); // On initial insert we want to do the update at once // since this file cannot be a file generated by // the latex run. + absname.set(foundfile); if (!insertIfExists(absname, head)) { // check for spaces string strippedfile = foundfile; @@ -1001,7 +1027,7 @@ void LaTeX::deplog(DepTable & head) // where "File: file.ext" would be skipped if (regex_match(token, sub, reg6)) { // search for strings in (...) - static regex reg6_1("\\(([^()]+)(.).*"); + static regex reg6_1("\\(([^()]+)(.)"); smatch what; string::const_iterator first = token.begin(); string::const_iterator end = token.end();