*/
LaTeX::LaTeX(string const & latex, OutputParams const & rp,
- FileName const & f)
- : cmd(latex), file(f), runparams(rp)
+ FileName const & f, string const & p)
+ : cmd(latex), file(f), path(p), runparams(rp)
{
num_errors = 0;
if (prefixIs(cmd, "pdf")) { // Do we use pdflatex ?
+ quoteName(onlyFileName(file.toFilesystemEncoding()))
+ " > " + os::nulldev();
Systemcall one;
- return one.startscript(Systemcall::Wait, tmp);
+ return one.startscript(Systemcall::Wait, tmp, path);
}
tmp += quoteName(f);
tmp += params;
Systemcall one;
- one.startscript(Systemcall::Wait, tmp);
+ one.startscript(Systemcall::Wait, tmp, path);
return true;
}
tmp += " -o "
+ onlyFileName(changeExtension(file.toFilesystemEncoding(), nls));
Systemcall one;
- one.startscript(Systemcall::Wait, tmp);
+ one.startscript(Systemcall::Wait, tmp, path);
return true;
}
tmp += quoteName(onlyFileName(removeExtension(
it->aux_file.absFileName())));
Systemcall one;
- one.startscript(Systemcall::Wait, tmp);
+ one.startscript(Systemcall::Wait, tmp, path);
}
// Return whether bibtex was run
return result;
if (contains(token, "LaTeX Error:"))
retval |= LATEX_ERROR;
- // bug 6445. At this point its not clear we finish with error.
if (prefixIs(token, "! File ended while scanning")){
- wait_for_error = desc;
- continue;
+ if (prefixIs(token, "! File ended while scanning use of \\Hy@setref@link.")){
+ // bug 7344. We must rerun LaTeX if hyperref has been toggled.
+ retval |= ERROR_RERUN;
+ LYXERR(Debug::LATEX, "Force rerun.");
+ } else {
+ // bug 6445. At this point its not clear we finish with error.
+ wait_for_error = desc;
+ continue;
+ }
+ }
+
+ if (prefixIs(token, "! Paragraph ended before \\Hy@setref@link was complete.")){
+ // bug 7344. We must rerun LaTeX if hyperref has been toggled.
+ retval |= ERROR_RERUN;
+ LYXERR(Debug::LATEX, "Force rerun.");
}
+
if (!wait_for_error.empty() && prefixIs(token, "! Emergency stop.")){
retval |= LATEX_ERROR;
string errstr;
continue;
}
+ // FIXME UNICODE: We assume that the file names in the log
+ // file are in the file system encoding.
+ token = to_utf8(from_filesystem8bit(token));
+
// Sometimes, filenames are broken across lines.
// We care for that and save suspicious lines.
// Here we exclude some cases where we are sure
smatch sub;
- // FIXME UNICODE: We assume that the file names in the log
- // file are in the file system encoding.
- token = to_utf8(from_filesystem8bit(token));
-
// (1) "File: file.ext"
if (regex_match(token, sub, reg1)) {
// check for dot