mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-25 10:58:52 +00:00
parent
07169c7be2
commit
3c3cb777d6
@ -318,10 +318,13 @@ def legacy_conversion_step1(latex_file, dpi, output_format, fg_color, bg_color,
|
|||||||
def legacy_conversion_pdflatex(latex_file, failed_pages, legacy_metrics,
|
def legacy_conversion_pdflatex(latex_file, failed_pages, legacy_metrics,
|
||||||
use_pdftocairo, conv, gs_device, gs_ext, alpha, resolution, output_format):
|
use_pdftocairo, conv, gs_device, gs_ext, alpha, resolution, output_format):
|
||||||
|
|
||||||
|
error_count = 0
|
||||||
|
|
||||||
# Search for pdflatex executable
|
# Search for pdflatex executable
|
||||||
pdflatex = find_exe(["pdflatex"])
|
pdflatex = find_exe(["pdflatex"])
|
||||||
if pdflatex == None:
|
if pdflatex == None:
|
||||||
warning("Can't find pdflatex. Some pages failed with all the possible routes.")
|
warning("Can't find pdflatex. Some pages failed with all the possible routes.")
|
||||||
|
failed_pages = []
|
||||||
else:
|
else:
|
||||||
# Create a new LaTeX file from the original but only with failed pages
|
# Create a new LaTeX file from the original but only with failed pages
|
||||||
pdf_latex_file = latex_file_re.sub("_pdflatex.tex", latex_file)
|
pdf_latex_file = latex_file_re.sub("_pdflatex.tex", latex_file)
|
||||||
@ -360,6 +363,7 @@ def legacy_conversion_pdflatex(latex_file, failed_pages, legacy_metrics,
|
|||||||
if conv_status:
|
if conv_status:
|
||||||
# Give up!
|
# Give up!
|
||||||
warning("Some pages failed with all the possible routes")
|
warning("Some pages failed with all the possible routes")
|
||||||
|
failed_pages = []
|
||||||
else:
|
else:
|
||||||
# We've done it!
|
# We've done it!
|
||||||
pdf_log_file = latex_file_re.sub(".log", pdf_latex_file)
|
pdf_log_file = latex_file_re.sub(".log", pdf_latex_file)
|
||||||
@ -370,6 +374,7 @@ def legacy_conversion_pdflatex(latex_file, failed_pages, legacy_metrics,
|
|||||||
for index in error_pages:
|
for index in error_pages:
|
||||||
pdf_metrics.pop(index - 1)
|
pdf_metrics.pop(index - 1)
|
||||||
pdf_metrics.insert(index - 1, (index, -1.0))
|
pdf_metrics.insert(index - 1, (index, -1.0))
|
||||||
|
error_count += 1
|
||||||
|
|
||||||
original_bitmap = latex_file_re.sub("%d." + output_format, pdf_latex_file)
|
original_bitmap = latex_file_re.sub("%d." + output_format, pdf_latex_file)
|
||||||
destination_bitmap = latex_file_re.sub("%d." + output_format, latex_file)
|
destination_bitmap = latex_file_re.sub("%d." + output_format, latex_file)
|
||||||
@ -378,6 +383,8 @@ def legacy_conversion_pdflatex(latex_file, failed_pages, legacy_metrics,
|
|||||||
join_metrics_and_rename(legacy_metrics, pdf_metrics, failed_pages,
|
join_metrics_and_rename(legacy_metrics, pdf_metrics, failed_pages,
|
||||||
original_bitmap, destination_bitmap)
|
original_bitmap, destination_bitmap)
|
||||||
|
|
||||||
|
return error_count
|
||||||
|
|
||||||
|
|
||||||
# The file has been processed through latex and we expect dvi output.
|
# The file has been processed through latex and we expect dvi output.
|
||||||
# Run dvips, taking note whether it was successful.
|
# Run dvips, taking note whether it was successful.
|
||||||
|
Loading…
Reference in New Issue
Block a user