[LyX/master] Ignore TheoremParentCounter if we have TheoremCounter

Juergen Spitzmueller spitz at lyx.org
Sat Sep 20 14:12:32 UTC 2025


commit b3e7aa657d6f1ba9d6025dcd30f23b2666ab4252
Author: Juergen Spitzmueller <spitz at lyx.org>
Date:   Sat Sep 20 16:10:54 2025 +0200

    Ignore TheoremParentCounter if we have TheoremCounter
    
    The two options are mutually exclusive (with theorem counter,
    the parent counter of that, if any, will be used)
---
 src/LaTeXFeatures.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/LaTeXFeatures.cpp b/src/LaTeXFeatures.cpp
index 7d522b7e94..30bb2db46f 100644
--- a/src/LaTeXFeatures.cpp
+++ b/src/LaTeXFeatures.cpp
@@ -2025,7 +2025,8 @@ string const LaTeXFeatures::getThmDefinitions() const
 				tmp << "[" << thm.counter << "]";
 		}
 		tmp << "{\\protect\\" << thm.latexname << "}";
-		if (!thm.parent_counter.empty()) {
+		// counter and parent counter are mutually exclusive
+		if (!thm.parent_counter.empty() && thm.counter.empty()) {
 			if (thm.parent_counter != "chapter"
 			    || params_.documentClass().hasLaTeXLayout("chapter"))
 				tmp << "[" << thm.parent_counter << "]";


More information about the lyx-cvs mailing list