// in it. However it seems safe to run latex (at least) on time each
// time the .tex file changes.
{
- int scanres = LaTeX::NO_ERRORS;
+ int scanres = NO_ERRORS;
unsigned int count = 0; // number of times run
num_errors = 0; // just to make sure.
const unsigned int MAX_RUN = 6;
head.update();
if (!head.sumchange()) {
lyxerr[Debug::DEPEND] << "return no_change" << endl;
- return LaTeX::NO_CHANGE;
+ return NO_CHANGE;
}
lyxerr[Debug::DEPEND]
<< "Dependency file has changed" << endl;
WriteStatus(minib, string(_("LaTeX run number ")) + tostr(count));
this->operator()();
scanres = scanLogFile(terr);
- if (scanres & LaTeX::ERROR_RERUN) {
+ if (scanres & ERROR_RERUN) {
lyxerr[Debug::LATEX] << "Rerunning LaTeX" << endl;
this->operator()();
scanres = scanLogFile(terr);
}
- if (scanres & LaTeX::ERRORS) {
+ if (scanres & ERRORS) {
deleteFilesOnError();
return scanres; // return on error
}
}
// run bibtex
- if (scanres & LaTeX::UNDEF_CIT
- || scanres & LaTeX::RERUN
- || run_bibtex) {
+ // if (scanres & UNDEF_CIT || scanres & RERUN || run_bibtex)
+ if (scanres & UNDEF_CIT || run_bibtex) {
// Here we must scan the .aux file and look for
// "\bibdata" and/or "\bibstyle". If one of those
// tags is found -> run bibtex and set rerun = true;
string(_("LaTeX run number ")) + tostr(count));
this->operator()();
scanres = scanLogFile(terr);
- if (scanres & LaTeX::ERRORS) {
+ if (scanres & ERRORS) {
deleteFilesOnError();
return scanres; // return on error
}
// -> rerun not asked for:
// just return (fall out of bottom of func)
//
- while ((head.sumchange() || rerun || (scanres & LaTeX::RERUN))
+ while ((head.sumchange() || rerun || (scanres & RERUN))
&& count < MAX_RUN) {
// Yes rerun until message goes away, or until
// MAX_RUNS are reached.
WriteStatus(minib, string(_("LaTeX run number ")) + tostr(count));
this->operator()();
scanres = scanLogFile(terr);
- if (scanres & LaTeX::ERRORS) {
+ if (scanres & ERRORS) {
deleteFilesOnError();
return scanres; // return on error
}
retval |= TEX_WARNING;
} else if (contains(token, "Rerun to get citations")) {
// Natbib seems to use this.
- retval |= RERUN;
+ retval |= UNDEF_CIT;
} else if (contains(token, "No pages of output")) {
// A dvi file was not created
retval |= NO_OUTPUT;
// since this file can not be a file generated by
// the latex run.
head.insert(foundfile, true);
- continue;
}
// (2) foundfile is in the tmpdir
// insert it into head
- if (FileInfo(OnlyFilename(foundfile)).exist()) {
+ else if (FileInfo(OnlyFilename(foundfile)).exist()) {
if (unwanted.exact_match(foundfile)) {
lyxerr[Debug::DEPEND]
<< "We don't want "
<< endl;
head.insert(OnlyFilename(foundfile));
}
- continue;
- }
- lyxerr[Debug::DEPEND]
- << "Not a file or we are unable to find it."
- << endl;
+ } else
+ lyxerr[Debug::DEPEND]
+ << "Not a file or we are unable to find it."
+ << endl;
}
}