commit 79f5bbf0142d3547ebb11387f7319d1084556b09
Author: Juergen Spitzmueller <[email protected]>
Date: Thu May 15 08:16:41 2025 +0200
Amend 05fa236829
If the document class (not only a module) provides arguments
for lists, we handle them.
Since we also account for special delims in the beamer case,
fall though to that in such cases and limit the special handling
to the case where a list gets arguments only by a module (such
as enumitem).
(cherry picked from commit 3c6f0076f0d7e9711ad53ccada63fec71a74f7bf)
---
src/tex2lyx/text.cpp | 13 ++++++++++---
status.24x | 2 +-
2 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/src/tex2lyx/text.cpp b/src/tex2lyx/text.cpp
index 2362c6f26b..6b49b86a7a 100644
--- a/src/tex2lyx/text.cpp
+++ b/src/tex2lyx/text.cpp
@@ -2550,9 +2550,16 @@ void parse_environment(Parser & p, ostream & os, bool
outer,
parent_context.layout,
parent_context.font);
if ((context.layout->latextype == LATEX_LIST_ENVIRONMENT
|| context.layout->latextype ==
LATEX_ITEM_ENVIRONMENT)
- && p.hasOpt()) {
- // if a list environment has an optional
argument
- // (e.g., with enumitem), store it to output it
later
+ && p.hasOpt()
+ && context.layout->latexargs().empty()) {
+ // FIXME: findLayout() looks for layouts in the
class
+ // first and only in modules if a layout is not
found.
+ // So if a module adds arguments to existing
layouts
+ // (e.g., enumitem to itemize), they wont't be
recognized (#13185).
+ // Workaround: If a list environment has an
optional argument,
+ // and the document class layout does not
provide for
+ // an optional argument (some, e.g. beamer,
do!),
+ // store it here to output it manually later
// in the first list paragraph.
context.list_options = p.getArg('[', ']');
p.skip_spaces(true);
diff --git a/status.24x b/status.24x
index 14f5bb0d35..baf70a07a4 100644
--- a/status.24x
+++ b/status.24x
@@ -158,7 +158,7 @@ What's new
* TEX2LYX
-
+- Fix import of enumitem lists with optional argument (bug 13185).
* LYXHTML
--
lyx-cvs mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-cvs