commit 5266e5ffc364bf35bfc4f4abb39eb4c0ded982f6
Author: Enrico Forestieri <[email protected]>
Date: Mon May 19 23:19:15 2025 +0200
Rerun latex if necessary when generating previews
Recent versions of dvipng may produce a last page whose content
simply states that "LaTeX was unable to guess the total number
of pages correctly. As there was some unprocessed data that
should have been added to the final page this extra page has
been added to receive it. If you rerun the document (without
altering it) this surplus page will go away, because LaTeX now
knows how many pages to expect for this document."
This confuses the lyxpreview2bitmap.py script, making it unable
to distinguish pages that should follow the dvipng route or the
legacy route. However, the presence of the extra page is reported
in the log file and hence we know we have to rerun latex.
(cherry picked from commit 1888d50eb18277fd93aab2859233887ae5919ebf)
---
lib/scripts/lyxpreview_tools.py | 3 ++-
status.24x | 2 ++
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/lib/scripts/lyxpreview_tools.py b/lib/scripts/lyxpreview_tools.py
index c75563d464..e6a461e88d 100644
--- a/lib/scripts/lyxpreview_tools.py
+++ b/lib/scripts/lyxpreview_tools.py
@@ -293,7 +293,8 @@ def run_latex(latex, latex_file, bibtex = None):
latex_status, latex_stdout = run_tex(latex, latex_file)
# Rerun latex if necessary
progress("Checking if a latex rerun is necessary")
- if string_in_file("Warning: (Citation|Reference)", log_file):
+ if string_in_file("Warning: (Citation|Reference)", log_file) or \
+ string_in_file("Warning: Temporary extra page", log_file):
latex_status, latex_stdout = run_tex(latex, latex_file)
return latex_status, latex_stdout
diff --git a/status.24x b/status.24x
index 70d3d92229..b68de897ab 100644
--- a/status.24x
+++ b/status.24x
@@ -82,6 +82,8 @@ What's new
- Improve fix for crash when exporting a recursive macro (bug 12633).
+- Try to handle differences in how divpng reports certain kinds of errors.
+
- Fix erroneous whitespace before and after math preview (bug 13127).
- Ask to save unsaved changes before closing document dialog via ESC key or
--
lyx-cvs mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-cvs