[LyX/2.3.x] Fix bug #11741.

Richard Kimberly Heck rikiheck at lyx.org
Sun Aug 9 17:10:01 UTC 2020


commit 8898b3d881e7ba82d5234206ee069927024399ec
Author: Daniel Ramoeller <d.lyx at web.de>
Date:   Sun Aug 9 13:09:41 2020 -0400

    Fix bug #11741.
    
    Theorems weren't being numbered by chapter.
    
    (cherry picked from commit e6de6c2b596d1554c4489a00cb82416010ae91c1)
---
 lib/layouts/theorems-ams-bytype.module             |   28 ----------
 lib/layouts/theorems-ams-chap-bytype.inc           |   53 +++++++++++++++-----
 lib/layouts/theorems-ams-chap-bytype.module        |   44 ----------------
 .../theorems-ams-extended-chap-bytype.module       |   50 ++++++++++++++----
 4 files changed, 79 insertions(+), 96 deletions(-)

diff --git a/lib/layouts/theorems-ams-bytype.module b/lib/layouts/theorems-ams-bytype.module
index 8b27b58..9fa0638 100644
--- a/lib/layouts/theorems-ams-bytype.module
+++ b/lib/layouts/theorems-ams-bytype.module
@@ -21,34 +21,6 @@ Format 66
 
 Requires	amsmath,amsthm
 
-# We need separate counters for each theorem-like style.
-Counter theorem
-End
-Counter corollary
-End
-Counter lemma
-End
-Counter proposition
-End
-Counter conjecture
-End
-Counter fact
-End
-Counter definition
-End
-Counter example
-End
-Counter solution
-End
-Counter problem
-End
-Counter exercise
-End
-Counter remark
-End
-Counter claim
-End
-
 Input theorems-order.inc
 Input theorems-ams-bytype.inc
 Input theorems-starred.inc
diff --git a/lib/layouts/theorems-ams-chap-bytype.inc b/lib/layouts/theorems-ams-chap-bytype.inc
index 5af0450..9c01e2e 100644
--- a/lib/layouts/theorems-ams-chap-bytype.inc
+++ b/lib/layouts/theorems-ams-chap-bytype.inc
@@ -25,31 +25,58 @@
 
 # We need separate counters for each theorem-like style.
 Format 66
+
 Counter theorem
+	GuiName Theorem
+	Within         chapter
 End
 Counter corollary
+	GuiName Corollary
+	Within         chapter
 End
 Counter lemma
+	GuiName Lemma
+	Within         chapter
 End
 Counter proposition
+	GuiName Proposition
+	Within         chapter
 End
 Counter conjecture
+	GuiName Conjecture
+	Within         chapter
 End
 Counter fact
+	GuiName Fact
+	Within         chapter
 End
 Counter definition
+	GuiName Definition
+	Within         chapter
 End
 Counter example
+	GuiName Example
+	Within         chapter
 End
 Counter problem
+	GuiName Problem
+	Within         chapter
 End
 Counter exercise
+	GuiName Exercise
+	Within         chapter
 End
 Counter solution
+	GuiName Solution
+	Within         chapter
 End
 Counter remark
+	GuiName Remark
+	Within         chapter
 End
 Counter claim
+	GuiName Claim
+	Within         chapter
 End
 
 OutlinerName thm "Definitions & Theorems"
@@ -79,7 +106,7 @@ Style Theorem
 	AlignPossible         Left
 	LabelType             Static
 	LabelCounter          theorem
-	LabelString           "Theorem \thechapter.\thetheorem."
+	LabelString           "Theorem \thetheorem."
 	Font
 	  Shape               Italic
 	  Size                Normal
@@ -109,7 +136,7 @@ End
 Style Corollary
 	CopyStyle             Theorem
 	LatexName             cor
-	LabelString           "Corollary \thechapter.\thecorollary."
+	LabelString           "Corollary \thecorollary."
 	Preamble
 	  \theoremstyle{plain}
     \ifx\thechapter\undefined
@@ -131,7 +158,7 @@ End
 Style Lemma
 	CopyStyle             Theorem
 	LatexName             lem
-	LabelString           "Lemma \thechapter.\thelemma."
+	LabelString           "Lemma \thelemma."
 	Preamble
 	  \theoremstyle{plain}
     \ifx\thechapter\undefined
@@ -153,7 +180,7 @@ End
 Style Proposition
 	CopyStyle             Theorem
 	LatexName             prop
-	LabelString           "Proposition \thechapter.\theproposition."
+	LabelString           "Proposition \theproposition."
 	Preamble
 	  \theoremstyle{plain}
     \ifx\thechapter\undefined
@@ -175,7 +202,7 @@ End
 Style Conjecture
 	CopyStyle             Theorem
 	LatexName             conjecture
-	LabelString           "Conjecture \thechapter.\theconjecture."
+	LabelString           "Conjecture \theconjecture."
 	Preamble
 	  \theoremstyle{plain}
     \ifx\thechapter\undefined
@@ -197,7 +224,7 @@ End
 Style Fact
 	CopyStyle             Theorem
 	LatexName             fact
-	LabelString           "Fact \thechapter.\thefact."
+	LabelString           "Fact \thefact."
 	Preamble
 	  \theoremstyle{plain}
     \ifx\thechapter\undefined
@@ -219,7 +246,7 @@ End
 Style Definition
 	CopyStyle             Theorem
 	LatexName             defn
-	LabelString           "Definition \thechapter.\thedefinition."
+	LabelString           "Definition \thedefinition."
 	Font
 	  Shape               Up
 	EndFont
@@ -248,7 +275,7 @@ End
 Style Example
 	CopyStyle             Definition
 	LatexName             example
-	LabelString           "Example \thechapter.\theexample."
+	LabelString           "Example \theexample."
 	Preamble
 	  \theoremstyle{definition}
     \ifx\thechapter\undefined
@@ -271,7 +298,7 @@ End
 Style Problem
 	CopyStyle             Definition
 	LatexName             problem
-	LabelString           "Problem \thechapter.\theproblem."
+	LabelString           "Problem \theproblem."
 	Preamble
 	  \theoremstyle{definition}
     \ifx\thechapter\undefined
@@ -294,7 +321,7 @@ End
 Style Exercise
 	CopyStyle             Definition
 	LatexName             xca
-	LabelString           "Exercise \thechapter.\theexercise."
+	LabelString           "Exercise \theexercise."
 	Preamble
 	  \theoremstyle{definition}
     \ifx\thechapter\undefined
@@ -317,7 +344,7 @@ End
 Style Solution
 	CopyStyle             Definition
 	LatexName             sol
-	LabelString           "Solution \thechapter.\thesolution."
+	LabelString           "Solution \thesolution."
 	Preamble
 	  \theoremstyle{definition}
     \ifx\thechapter\undefined
@@ -340,7 +367,7 @@ End
 Style Remark
 	CopyStyle             Theorem
 	LatexName             rem
-	LabelString           "Remark \thechapter.\theremark."
+	LabelString           "Remark \theremark."
 	Font
 	  Shape               Up
 	  Size                Normal
@@ -370,7 +397,7 @@ End
 Style Claim
 	CopyStyle             Remark
 	LatexName             claim
-	LabelString           "Claim \thechapter.\theclaim."
+	LabelString           "Claim \theclaim."
 	Preamble
 	  \theoremstyle{remark}
     \ifx\thechapter\undefined
diff --git a/lib/layouts/theorems-ams-chap-bytype.module b/lib/layouts/theorems-ams-chap-bytype.module
index 475fe99..63f9c01 100644
--- a/lib/layouts/theorems-ams-chap-bytype.module
+++ b/lib/layouts/theorems-ams-chap-bytype.module
@@ -22,50 +22,6 @@ Format 66
 
 Requires	amsmath,amsthm
 
-# The environments defined (regular and starred) are :
-# - theorem
-# - corollary
-# - lemma
-# - proposition
-# - conjecture
-# - fact
-# - definition
-# - example
-# - solution
-# - problem
-# - exercise
-# - remark
-# - claim
-
-# We need separate counters for each theorem-like style.
-Counter theorem
-End
-Counter corollary
-End
-Counter lemma
-End
-Counter proposition
-End
-Counter conjecture
-End
-Counter fact
-End
-Counter definition
-End
-Counter example
-End
-Counter solution
-End
-Counter problem
-End
-Counter exercise
-End
-Counter remark
-End
-Counter claim
-End
-
-
 Input theorems-order.inc
 Input theorems-ams-chap-bytype.inc
 Input theorems-starred.inc
diff --git a/lib/layouts/theorems-ams-extended-chap-bytype.module b/lib/layouts/theorems-ams-extended-chap-bytype.module
index f389ef9..634e79a 100644
--- a/lib/layouts/theorems-ams-extended-chap-bytype.module
+++ b/lib/layouts/theorems-ams-extended-chap-bytype.module
@@ -44,20 +44,48 @@ End
 Counter axiom
 End
 Counter condition
+	GuiName Criterion
+	Within         chapter
+End
+Counter algorithm
+	GuiName Algorithm
+	Within         chapter
+End
+Counter axiom
+	GuiName Axiom
+	Within         chapter
+End
+Counter condition
+	GuiName Condition
+	Within         chapter
 End
 Counter note
+	GuiName Note
+	Within         chapter
 End
 Counter notation
+	GuiName Notation
+	Within         chapter
 End
 Counter summary
+	GuiName Summary
+	Within         chapter
 End
 Counter acknowledgement
+	GuiName Acknowledgement
+	Within         chapter
 End
 Counter conclusion
+	GuiName Conclusion
+	Within         chapter
 End
 Counter assumption
+	GuiName Assumption
+	Within         chapter
 End
 Counter question
+	GuiName Question
+	Within         chapter
 End
 
 
@@ -66,7 +94,7 @@ End
 Style Criterion
 	CopyStyle             Theorem
 	LatexName             criterion
-	LabelString           "Criterion \thechapter.\thecriterion."
+	LabelString           "Criterion \thecriterion."
 	Preamble
 	  \theoremstyle{plain}
     \ifx\thechapter\undefined
@@ -105,7 +133,7 @@ End
 Style Algorithm
 	CopyStyle             Theorem
 	LatexName             lyxalgorithm
-	LabelString           "Algorithm \thechapter.\thealgorithm."
+	LabelString           "Algorithm \thealgorithm."
 	Preamble
 	  \theoremstyle{plain}
     \ifx\thechapter\undefined
@@ -144,7 +172,7 @@ End
 Style Axiom
 	CopyStyle             Theorem
 	LatexName             ax
-	LabelString           "Axiom \thechapter.\theaxiom."
+	LabelString           "Axiom \theaxiom."
 	Preamble
 	  \theoremstyle{plain}
     \ifx\thechapter\undefined
@@ -183,7 +211,7 @@ End
 Style Condition
 	CopyStyle             Definition
 	LatexName             condition
-	LabelString           "Condition \thechapter.\thecondition."
+	LabelString           "Condition \thecondition."
 	Preamble
 	  \theoremstyle{definition}
     \ifx\thechapter\undefined
@@ -222,7 +250,7 @@ End
 Style Note
 	CopyStyle             Remark
 	LatexName             note
-	LabelString           "Note \thechapter.\thenote."
+	LabelString           "Note \thenote."
 	Preamble
 	  \theoremstyle{remark}
     \ifx\thechapter\undefined
@@ -261,7 +289,7 @@ End
 Style Notation
 	CopyStyle             Remark
 	LatexName             notation
-	LabelString           "Notation \thechapter.\thenotation."
+	LabelString           "Notation \thenotation."
 	Preamble
 	  \theoremstyle{remark}
     \ifx\thechapter\undefined
@@ -300,7 +328,7 @@ End
 Style Summary
 	CopyStyle             Remark
 	LatexName             summary
-	LabelString           "Summary \thechapter.\thesummary."
+	LabelString           "Summary \thesummary."
 	Preamble
 	  \theoremstyle{remark}
     \ifx\thechapter\undefined
@@ -340,7 +368,7 @@ End
 Style Acknowledgement
 	CopyStyle             Remark
 	LatexName             acknowledgement
-	LabelString           "Acknowledgement \thechapter.\theacknowledgement."
+	LabelString           "Acknowledgement \theacknowledgement."
 	Preamble
 	  \theoremstyle{remark}
     \ifx\thechapter\undefined
@@ -379,7 +407,7 @@ End
 Style Conclusion
 	CopyStyle             Remark
 	LatexName             conclusion
-	LabelString           "Conclusion \thechapter.\theconclusion."
+	LabelString           "Conclusion \theconclusion."
 	Preamble
 	  \theoremstyle{remark}
     \ifx\thechapter\undefined
@@ -418,7 +446,7 @@ End
 Style Assumption
 	CopyStyle             Theorem
 	LatexName             assumption
-	LabelString           "Assumption \thechapter.\theassumption."
+	LabelString           "Assumption \theassumption."
 	Preamble
 	  \theoremstyle{plain}
     \ifx\thechapter\undefined
@@ -457,7 +485,7 @@ Style Question
 	CopyStyle             Theorem
 	DependsOn             Theorem
 	LatexName             question
-	LabelString           "Question \thechapter.\thequestion."
+	LabelString           "Question \thequestion."
 	Preamble
 	  \theoremstyle{plain}
     \ifx\thechapter\undefined


More information about the lyx-cvs mailing list