+ # If some pages require running pdflatex pass them to legacy method
+ if len(pdf_pages) > 0:
+ # Create a new LaTeX file just for the snippets needing
+ # the legacy method
+ legacy_latex_file = latex_file_re.sub("_legacy.tex", latex_file)
+ filter_pages(latex_file, legacy_latex_file, pdf_pages)
+
+ # Pass the new LaTeX file to the legacy method
+ progress("Pages %s include pdflatex image files" % pdf_pages)
+ progress("Using the legacy conversion method (PDF support)")
+ legacy_status, legacy_metrics = legacy_conversion_step1(legacy_latex_file,
+ dpi, output_format, fg_color, bg_color, "pdflatex", True, True)
+
+ # Now we need to mix metrics data from dvipng and the legacy method
+ original_bitmap = latex_file_re.sub("%d." + output_format, legacy_latex_file)
+ destination_bitmap = latex_file_re.sub("%d." + output_format, latex_file)
+
+ # Join metrics from dvipng and legacy, and rename legacy bitmaps
+ join_metrics_and_rename(dvipng_metrics, legacy_metrics, pdf_pages,
+ original_bitmap, destination_bitmap)
+