On Thu, Aug 27, 2026 at 05:30:57AM +0000, Juergen Spitzmueller wrote:
> +- The layout "LyX-Code" (used by most document classes) has been replaced by
> a new
> + layout, "Code". This employs the established alltt package and environment
> rather
> + than rolling an own (rather deficient) definition. Since the output of the
> old
> + and new layout is not identical, old documents will retain the LyX-Code
> layout
> + as a local layout (see Document > Settings > Local Layout).
Are there some functional differences for the new Code environment I should be
aware of
as a non-expert user?
Apart from that you might be interested in the lyx2lyx-checker report below
(run by our silicon colleague).
Pavel
---
New bug: revert_alltt prefix-match corruption
revert_alltt renames \begin_layout Code -> \begin_layout LyX-Code using
find_token, which is a prefix (startswith) match. So "\begin_layout Code" also
matches
any layout whose name starts with "Code". The copernicus class ships
CodeAvailability and CodeAndDataAvailability styles.
Reproduced: a copernicus doc with \begin_layout CodeAvailability +
\begin_layout Code, down-converted -t 658 -> both become \begin_layout
LyX-Code. The "Code
Availability" statement loses its style and its text is reinterpreted as
verbatim code. Silent, on the down-conversion path.
Here's the one-line fix for revert_alltt (format 659):
diff --git a/lib/lyx2lyx/lyx_2_6.py b/lib/lyx2lyx/lyx_2_6.py
--- a/lib/lyx2lyx/lyx_2_6.py
+++ b/lib/lyx2lyx/lyx_2_6.py
@@ -2056,7 +2056,7 @@ def revert_alltt(document):
i = 0
while True:
- i = find_token(document.body, "\\begin_layout Code", i)
+ i = find_token_exact(document.body, "\\begin_layout Code", i)
if i == -1:
return
Verified: with the fix, the repro doc down-converts correctly - \begin_layout
CodeAvailability stays intact (line 2554) and only the exact \begin_layout Code
becomes LyX-Code (2558).
--
lyx-devel mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-devel