[LyX/master] Fix bug #11741.

Richard Kimberly Heck rikiheck at lyx.org
Sun Aug 9 16:44:31 UTC 2020


commit e6de6c2b596d1554c4489a00cb82416010ae91c1
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.
---
 lib/layouts/theorems-ams-bytype.module             |   41 --------------
 lib/layouts/theorems-ams-chap-bytype.inc           |   39 +++++++++-----
 lib/layouts/theorems-ams-chap-bytype.module        |   57 --------------------
 .../theorems-ams-extended-chap-bytype.module       |   26 +++++----
 4 files changed, 41 insertions(+), 122 deletions(-)

diff --git a/lib/layouts/theorems-ams-bytype.module b/lib/layouts/theorems-ams-bytype.module
index 0d39a1a..8c328c6 100644
--- a/lib/layouts/theorems-ams-bytype.module
+++ b/lib/layouts/theorems-ams-bytype.module
@@ -22,47 +22,6 @@ Format 82
 
 Requires	amsmath,amsthm
 
-# We need separate counters for each theorem-like style.
-Counter theorem
-	GuiName Theorem
-End
-Counter corollary
-	GuiName Corollary
-End
-Counter lemma
-	GuiName Lemma
-End
-Counter proposition
-	GuiName Proposition
-End
-Counter conjecture
-	GuiName Conjecture
-End
-Counter fact
-	GuiName Fact
-End
-Counter definition
-	GuiName Definition
-End
-Counter example
-	GuiName Example
-End
-Counter solution
-	GuiName Solution
-End
-Counter problem
-	GuiName Problem
-End
-Counter exercise
-	GuiName Exercise
-End
-Counter remark
-	GuiName Remark
-End
-Counter claim
-	GuiName 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 ffca387..e4528f7 100644
--- a/lib/layouts/theorems-ams-chap-bytype.inc
+++ b/lib/layouts/theorems-ams-chap-bytype.inc
@@ -27,42 +27,55 @@
 Format 82
 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"
@@ -92,7 +105,7 @@ Style Theorem
 	AlignPossible         Left
 	LabelType             Static
 	LabelCounter          theorem
-	LabelString           "Theorem \thechapter.\thetheorem."
+	LabelString           "Theorem \thetheorem."
 	Font
 	  Shape               Italic
 	  Size                Normal
@@ -122,7 +135,7 @@ End
 Style Corollary
 	CopyStyle             Theorem
 	LatexName             cor
-	LabelString           "Corollary \thechapter.\thecorollary."
+	LabelString           "Corollary \thecorollary."
 	Preamble
 	  \theoremstyle{plain}
     \ifx\thechapter\undefined
@@ -144,7 +157,7 @@ End
 Style Lemma
 	CopyStyle             Theorem
 	LatexName             lem
-	LabelString           "Lemma \thechapter.\thelemma."
+	LabelString           "Lemma \thelemma."
 	Preamble
 	  \theoremstyle{plain}
     \ifx\thechapter\undefined
@@ -166,7 +179,7 @@ End
 Style Proposition
 	CopyStyle             Theorem
 	LatexName             prop
-	LabelString           "Proposition \thechapter.\theproposition."
+	LabelString           "Proposition \theproposition."
 	Preamble
 	  \theoremstyle{plain}
     \ifx\thechapter\undefined
@@ -188,7 +201,7 @@ End
 Style Conjecture
 	CopyStyle             Theorem
 	LatexName             conjecture
-	LabelString           "Conjecture \thechapter.\theconjecture."
+	LabelString           "Conjecture \theconjecture."
 	Preamble
 	  \theoremstyle{plain}
     \ifx\thechapter\undefined
@@ -210,7 +223,7 @@ End
 Style Fact
 	CopyStyle             Theorem
 	LatexName             fact
-	LabelString           "Fact \thechapter.\thefact."
+	LabelString           "Fact \thefact."
 	Preamble
 	  \theoremstyle{plain}
     \ifx\thechapter\undefined
@@ -232,7 +245,7 @@ End
 Style Definition
 	CopyStyle             Theorem
 	LatexName             defn
-	LabelString           "Definition \thechapter.\thedefinition."
+	LabelString           "Definition \thedefinition."
 	Font
 	  Shape               Up
 	EndFont
@@ -261,7 +274,7 @@ End
 Style Example
 	CopyStyle             Definition
 	LatexName             example
-	LabelString           "Example \thechapter.\theexample."
+	LabelString           "Example \theexample."
 	Preamble
 	  \theoremstyle{definition}
     \ifx\thechapter\undefined
@@ -284,7 +297,7 @@ End
 Style Problem
 	CopyStyle             Definition
 	LatexName             problem
-	LabelString           "Problem \thechapter.\theproblem."
+	LabelString           "Problem \theproblem."
 	Preamble
 	  \theoremstyle{definition}
     \ifx\thechapter\undefined
@@ -307,7 +320,7 @@ End
 Style Exercise
 	CopyStyle             Definition
 	LatexName             xca
-	LabelString           "Exercise \thechapter.\theexercise."
+	LabelString           "Exercise \theexercise."
 	Preamble
 	  \theoremstyle{definition}
     \ifx\thechapter\undefined
@@ -330,7 +343,7 @@ End
 Style Solution
 	CopyStyle             Definition
 	LatexName             sol
-	LabelString           "Solution \thechapter.\thesolution."
+	LabelString           "Solution \thesolution."
 	Preamble
 	  \theoremstyle{definition}
     \ifx\thechapter\undefined
@@ -353,7 +366,7 @@ End
 Style Remark
 	CopyStyle             Theorem
 	LatexName             rem
-	LabelString           "Remark \thechapter.\theremark."
+	LabelString           "Remark \theremark."
 	Font
 	  Shape               Up
 	  Size                Normal
@@ -385,7 +398,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 b5c5a30..cc26eab 100644
--- a/lib/layouts/theorems-ams-chap-bytype.module
+++ b/lib/layouts/theorems-ams-chap-bytype.module
@@ -23,63 +23,6 @@ Format 82
 
 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
-	GuiName Theorem
-End
-Counter corollary
-	GuiName Corollary
-End
-Counter lemma
-	GuiName Lemma
-End
-Counter proposition
-	GuiName Proposition
-End
-Counter conjecture
-	GuiName Conjecture
-End
-Counter fact
-	GuiName Fact
-End
-Counter definition
-	GuiName Definition
-End
-Counter example
-	GuiName Example
-End
-Counter solution
-	GuiName Solution
-End
-Counter problem
-	GuiName Problem
-End
-Counter exercise
-	GuiName Exercise
-End
-Counter remark
-	GuiName Remark
-End
-Counter claim
-	GuiName 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 b2aced5..75a7858 100644
--- a/lib/layouts/theorems-ams-extended-chap-bytype.module
+++ b/lib/layouts/theorems-ams-extended-chap-bytype.module
@@ -40,15 +40,19 @@ Requires	amsmath
 # We need separate counters for each theorem-like style.
 Counter criterion
 	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
@@ -78,7 +82,7 @@ End
 Style Criterion
 	CopyStyle             Theorem
 	LatexName             criterion
-	LabelString           "Criterion \thechapter.\thecriterion."
+	LabelString           "Criterion \thecriterion."
 	Preamble
 	  \theoremstyle{plain}
     \ifx\thechapter\undefined
@@ -117,7 +121,7 @@ End
 Style Algorithm
 	CopyStyle             Theorem
 	LatexName             lyxalgorithm
-	LabelString           "Algorithm \thechapter.\thealgorithm."
+	LabelString           "Algorithm \thealgorithm."
 	Preamble
 	  \theoremstyle{plain}
     \ifx\thechapter\undefined
@@ -156,7 +160,7 @@ End
 Style Axiom
 	CopyStyle             Theorem
 	LatexName             ax
-	LabelString           "Axiom \thechapter.\theaxiom."
+	LabelString           "Axiom \theaxiom."
 	Preamble
 	  \theoremstyle{plain}
     \ifx\thechapter\undefined
@@ -195,7 +199,7 @@ End
 Style Condition
 	CopyStyle             Definition
 	LatexName             condition
-	LabelString           "Condition \thechapter.\thecondition."
+	LabelString           "Condition \thecondition."
 	Preamble
 	  \theoremstyle{definition}
     \ifx\thechapter\undefined
@@ -234,7 +238,7 @@ End
 Style Note
 	CopyStyle             Remark
 	LatexName             note
-	LabelString           "Note \thechapter.\thenote."
+	LabelString           "Note \thenote."
 	Preamble
 	  \theoremstyle{remark}
     \ifx\thechapter\undefined
@@ -273,7 +277,7 @@ End
 Style Notation
 	CopyStyle             Remark
 	LatexName             notation
-	LabelString           "Notation \thechapter.\thenotation."
+	LabelString           "Notation \thenotation."
 	Preamble
 	  \theoremstyle{remark}
     \ifx\thechapter\undefined
@@ -312,7 +316,7 @@ End
 Style Summary
 	CopyStyle             Remark
 	LatexName             summary
-	LabelString           "Summary \thechapter.\thesummary."
+	LabelString           "Summary \thesummary."
 	Preamble
 	  \theoremstyle{remark}
     \ifx\thechapter\undefined
@@ -352,7 +356,7 @@ End
 Style Acknowledgement
 	CopyStyle             Remark
 	LatexName             acknowledgement
-	LabelString           "Acknowledgement \thechapter.\theacknowledgement."
+	LabelString           "Acknowledgement \theacknowledgement."
 	Preamble
 	  \theoremstyle{remark}
     \ifx\thechapter\undefined
@@ -391,7 +395,7 @@ End
 Style Conclusion
 	CopyStyle             Remark
 	LatexName             conclusion
-	LabelString           "Conclusion \thechapter.\theconclusion."
+	LabelString           "Conclusion \theconclusion."
 	Preamble
 	  \theoremstyle{remark}
     \ifx\thechapter\undefined
@@ -430,7 +434,7 @@ End
 Style Assumption
 	CopyStyle             Theorem
 	LatexName             assumption
-	LabelString           "Assumption \thechapter.\theassumption."
+	LabelString           "Assumption \theassumption."
 	Preamble
 	  \theoremstyle{plain}
     \ifx\thechapter\undefined
@@ -469,7 +473,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