# Compile the latex file.
latex_status, latex_stdout = run_latex(latex, latex_file)
if latex_status:
- warning("trying to recover from failed compilation")
+ progress("Will try to recover from %s failure" % latex)
if pdf_output:
return legacy_conversion_step3(latex_file, dpi, output_format, True, skipMetrics)
# Pass failed pages to pdflatex
if len(failed_pages) > 0:
warning("Now trying to obtain failed previews through pdflatex")
- legacy_conversion_pdflatex(latex_file, failed_pages, legacy_metrics,
- use_pdftocairo, conv, gs_device, gs_ext, alpha, resolution,
- output_format)
+ error_count = legacy_conversion_pdflatex(latex_file, failed_pages,
+ legacy_metrics, use_pdftocairo, conv, gs_device, gs_ext, alpha,
+ resolution, output_format)
+ else:
+ error_count = 0
# Invalidate metrics for pages that produced errors
if len(error_pages) > 0:
if index not in failed_pages:
legacy_metrics.pop(index - 1)
legacy_metrics.insert(index - 1, (index, -1.0))
+ error_count += 1
# Crop the ppm images
if pnmcrop != None and output_format == "ppm":
# Extract metrics info from the log file.
metrics_file = latex_file_re.sub(".metrics", latex_file)
write_metrics_info(legacy_metrics, metrics_file)
+ if error_count:
+ warning("Failed to produce %d preview snippet(s)" % error_count)
return (0, legacy_metrics)
error_pages = []
latex_status, latex_stdout = run_latex(latex, latex_file, bibtex)
if latex_status:
- warning("trying to recover from failed compilation")
+ progress("Will try to recover from %s failure" % latex)
error_pages = check_latex_log(latex_file_re.sub(".log", latex_file))
# The dvi output file name
# Invalidate metrics for pages that produced errors
if len(error_pages) > 0:
+ error_count = 0
for index in error_pages:
if index not in ps_pages and index not in pdf_pages:
dvipng_metrics.pop(index - 1)
dvipng_metrics.insert(index - 1, (index, -1.0))
+ error_count += 1
+ if error_count:
+ warning("Failed to produce %d preview snippet(s)" % error_count)
# Convert images to ppm format if necessary.
if output_format == "ppm":