[LyX/master] Modularize counter declarations.

Richard Kimberly Heck rikiheck at lyx.org
Sat Dec 5 23:11:40 UTC 2020


commit ccc7c641c64aac28791693ff0daa620a383f8aeb
Author: Richard Kimberly Heck <rikiheck at lyx.org>
Date:   Sat Dec 5 18:41:41 2020 -0500

    Modularize counter declarations.
---
 lib/layouts/theorems-ams-bytype.inc                |   50 +-------------------
 lib/layouts/theorems-ams-chap-bytype.inc           |   25 +---------
 lib/layouts/theorems-ams-extended-bytype.module    |   38 +--------------
 .../theorems-ams-extended-chap-bytype.module       |   15 +------
 lib/layouts/theorems-bytype.module                 |   50 +-------------------
 lib/layouts/theorems-chap-bytype.module            |   21 +-------
 lib/layouts/theorems-counters-bytype.inc           |   49 +++++++++++++++++++
 lib/layouts/theorems-counters-extended-bytype.inc  |   37 ++++++++++++++
 lib/layouts/theorems-sec-bytype.module             |   21 +-------
 9 files changed, 98 insertions(+), 208 deletions(-)

diff --git a/lib/layouts/theorems-ams-bytype.inc b/lib/layouts/theorems-ams-bytype.inc
index 64d928b..f784c38 100644
--- a/lib/layouts/theorems-ams-bytype.inc
+++ b/lib/layouts/theorems-ams-bytype.inc
@@ -21,55 +21,9 @@
 # - Claim
 # - Case (by inclusion)
 
-# We need separate counters for each theorem-like style.
 Format 89
-Counter theorem
-	GuiName Theorem
-	LaTeXName thm
-End
-Counter corollary
-	GuiName Corollary
-	LaTeXName cor
-End
-Counter lemma
-	GuiName Lemma
-	LaTeXName lem
-End
-Counter proposition
-	GuiName Proposition
-	LaTeXName prop
-End
-Counter conjecture
-	GuiName Conjecture
-End
-Counter fact
-	GuiName Fact
-End
-Counter definition
-	GuiName Definition
-	LaTeXName defn
-End
-Counter example
-	GuiName Example
-End
-Counter problem
-	GuiName Problem
-End
-Counter exercise
-	GuiName Exercise
-	LaTeXName xca
-End
-Counter solution
-	GuiName Solution
-	LaTeXName sol
-End
-Counter remark
-	GuiName Remark
-	LaTeXName rem
-End
-Counter claim
-	GuiName Claim
-End
+
+Input theorem-counters-bytype.inc
 
 OutlinerName thm "Definitions & Theorems"
 
diff --git a/lib/layouts/theorems-ams-chap-bytype.inc b/lib/layouts/theorems-ams-chap-bytype.inc
index 7bc2b73..4ab0f75 100644
--- a/lib/layouts/theorems-ams-chap-bytype.inc
+++ b/lib/layouts/theorems-ams-chap-bytype.inc
@@ -23,66 +23,47 @@
 # - Case (by inclusion)
 
 
-# We need separate counters for each theorem-like style.
 Format 89
+
+Input theorem-counters-bytype.inc
+
 Counter theorem
-	GuiName Theorem
 	Within chapter
-	LaTeXName thm
 End
 Counter corollary
-	GuiName Corollary
 	Within chapter
-	LaTeXName cor
 End
 Counter lemma
-	GuiName Lemma
 	Within chapter
-	LaTeXName lem
 End
 Counter proposition
-	GuiName Proposition
 	Within chapter
-	LaTeXName prop
 End
 Counter conjecture
-	GuiName Conjecture
 	Within chapter
 End
 Counter fact
-	GuiName Fact
 	Within chapter
 End
 Counter definition
-	GuiName Definition
 	Within chapter
-	LaTeXName defn
 End
 Counter example
-	GuiName Example
 	Within chapter
 End
 Counter problem
-	GuiName Problem
 	Within chapter
 End
 Counter exercise
-	GuiName Exercise
 	Within chapter
-	LaTeXName sca
 End
 Counter solution
-	GuiName Solution
 	Within chapter
-	LaTeXName sol
 End
 Counter remark
-	GuiName Remark
 	Within chapter
-	LaTeXName rem
 End
 Counter claim
-	GuiName Claim
 	Within chapter
 End
 
diff --git a/lib/layouts/theorems-ams-extended-bytype.module b/lib/layouts/theorems-ams-extended-bytype.module
index f376e89..850b575 100644
--- a/lib/layouts/theorems-ams-extended-bytype.module
+++ b/lib/layouts/theorems-ams-extended-bytype.module
@@ -36,43 +36,7 @@ Requires	amsmath
 # - Assumption
 # - Question
 
-# We need separate counters for each theorem-like style.
-Counter criterion
-	GuiName Criterion
-End
-Counter algorithm
-	GuiName Algorithm
-	LaTeXName lyxalgorithm
-End
-Counter axiom
-	GuiName Axiom
-	LaTeXName ax
-End
-Counter condition
-	GuiName Condition
-End
-Counter note
-	GuiName Note
-End
-Counter notation
-	GuiName Notation
-End
-Counter summary
-	GuiName Summary
-End
-Counter acknowledgement
-	GuiName Acknowledgement
-End
-Counter conclusion
-	GuiName Conclusion
-End
-Counter assumption
-	GuiName Assumption
-End
-Counter question
-	GuiName Question
-End
-
+Input theorems-counters-extended-bytype.inc
 
 Style Criterion
 	CopyStyle             Theorem
diff --git a/lib/layouts/theorems-ams-extended-chap-bytype.module b/lib/layouts/theorems-ams-extended-chap-bytype.module
index 3d0f4df..c1c9870 100644
--- a/lib/layouts/theorems-ams-extended-chap-bytype.module
+++ b/lib/layouts/theorems-ams-extended-chap-bytype.module
@@ -37,51 +37,38 @@ Requires	amsmath
 # - Assumption
 # - Question
 
-# We need separate counters for each theorem-like style.
+Input theorems-counters-extended-bytype.inc
 Counter criterion
-	GuiName Criterion
 	Within chapter
 End
 Counter algorithm
-	GuiName Algorithm
 	Within chapter
-	LaTeXName lyxalgorithm
 End
 Counter axiom
-	GuiName Axiom
 	Within chapter
-	LaTeXName ax
 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
 
diff --git a/lib/layouts/theorems-bytype.module b/lib/layouts/theorems-bytype.module
index ce8dc62..69bc2fb 100644
--- a/lib/layouts/theorems-bytype.module
+++ b/lib/layouts/theorems-bytype.module
@@ -14,55 +14,7 @@
 
 Format 89
 
-# We need separate counters for each theorem-like style.
-Counter theorem
-	GuiName Theorem
-	LaTeXName thm
-End
-Counter corollary
-	GuiName Corollary
-	LaTeXName cor
-End
-Counter lemma
-	GuiName Lemma
-	LaTeXName lem
-End
-Counter proposition
-	GuiName Proposition
-	LaTeXName prop
-End
-Counter conjecture
-	GuiName Conjecture
-End
-Counter fact
-	GuiName Fact
-End
-Counter definition
-	GuiName Definition
-	LaTeXName defn
-End
-Counter example
-	GuiName Example
-End
-Counter problem
-	GuiName Problem
-End
-Counter exercise
-	GuiName Exercise
-	LaTeXName xca
-End
-Counter solution
-	GuiName Solution
-	LaTeXName sol
-End
-Counter remark
-	GuiName Remark
-	LaTeXName rem
-End
-Counter claim
-	GuiName Claim
-End
-
+Input theorem-counters-bytype.inc
 Input theorems-bytype.inc
 Input theorems-proof.inc
 
diff --git a/lib/layouts/theorems-chap-bytype.module b/lib/layouts/theorems-chap-bytype.module
index 9938bf2..9adc4c9 100644
--- a/lib/layouts/theorems-chap-bytype.module
+++ b/lib/layouts/theorems-chap-bytype.module
@@ -14,59 +14,42 @@
 
 Format 89
 
-# We need separate counters for each theorem-like style.
+Input theorem-counters-bytype.inc
+
 Counter theorem
-	GuiName Theorem
 	Within chapter
-	LaTeXName thm
 End
 Counter corollary
-	GuiName Corollary
 	Within chapter
-	LaTeXName cor
 End
 Counter lemma
-	GuiName Lemma
 	Within chapter
-	LaTeXName lem
 End
 Counter proposition
-	GuiName Proposition
 	Within chapter
-	LaTeXName prop
 End
 Counter conjecture
-	GuiName Conjecture
 	Within chapter
 End
 Counter fact
-	GuiName Fact
 	Within chapter
 End
 Counter definition
-	GuiName Definition
 	Within chapter
-	LaTeXName defn
 End
 Counter example
-	GuiName Example
 	Within chapter
 End
 Counter problem
-	GuiName Problem
 	Within chapter
 End
 Counter exercise
-	GuiName Exercise
 	Within chapter
-	LaTeXName xca
 End
 Counter remark
-	GuiName Remark
 	Within chapter
 End
 Counter claim
-	GuiName Claim
 	Within chapter
 End
 
diff --git a/lib/layouts/theorems-counters-bytype.inc b/lib/layouts/theorems-counters-bytype.inc
new file mode 100644
index 0000000..9bba27e
--- /dev/null
+++ b/lib/layouts/theorems-counters-bytype.inc
@@ -0,0 +1,49 @@
+# Theorem-like counters, separately for each type of theorem
+
+Counter theorem
+	GuiName Theorem
+	LaTeXName thm
+End
+Counter corollary
+	GuiName Corollary
+	LaTeXName cor
+End
+Counter lemma
+	GuiName Lemma
+	LaTeXName lem
+End
+Counter proposition
+	GuiName Proposition
+	LaTeXName prop
+End
+Counter conjecture
+	GuiName Conjecture
+End
+Counter fact
+	GuiName Fact
+End
+Counter definition
+	GuiName Definition
+	LaTeXName defn
+End
+Counter example
+	GuiName Example
+End
+Counter problem
+	GuiName Problem
+End
+Counter exercise
+	GuiName Exercise
+	LaTeXName xca
+End
+Counter solution
+	GuiName Solution
+	LaTeXName sol
+End
+Counter remark
+	GuiName Remark
+	LaTeXName rem
+End
+Counter claim
+	GuiName Claim
+End
diff --git a/lib/layouts/theorems-counters-extended-bytype.inc b/lib/layouts/theorems-counters-extended-bytype.inc
new file mode 100644
index 0000000..32c18c2
--- /dev/null
+++ b/lib/layouts/theorems-counters-extended-bytype.inc
@@ -0,0 +1,37 @@
+# Theorem-like counters, extended, separately for each type of theorem
+
+Counter criterion
+	GuiName Criterion
+End
+Counter algorithm
+	GuiName Algorithm
+	LaTeXName lyxalgorithm
+End
+Counter axiom
+	GuiName Axiom
+	LaTeXName ax
+End
+Counter condition
+	GuiName Condition
+End
+Counter note
+	GuiName Note
+End
+Counter notation
+	GuiName Notation
+End
+Counter summary
+	GuiName Summary
+End
+Counter acknowledgement
+	GuiName Acknowledgement
+End
+Counter conclusion
+	GuiName Conclusion
+End
+Counter assumption
+	GuiName Assumption
+End
+Counter question
+	GuiName Question
+End
diff --git a/lib/layouts/theorems-sec-bytype.module b/lib/layouts/theorems-sec-bytype.module
index 1291d7e..0adb01c 100644
--- a/lib/layouts/theorems-sec-bytype.module
+++ b/lib/layouts/theorems-sec-bytype.module
@@ -14,59 +14,42 @@
 
 Format 89
 
-# We need separate counters for each theorem-like style.
+Input theorem-counters-bytype.inc
+
 Counter theorem
-	GuiName Theorem
 	Within section
-	LaTeXName thm
 End
 Counter corollary
-	GuiName Corollary
 	Within section
-	LaTeXName cor
 End
 Counter lemma
-	GuiName Lemma
 	Within section
-	LaTeXName lem
 End
 Counter proposition
-	GuiName Proposition
 	Within section
-	LaTeXName prop
 End
 Counter conjecture
-	GuiName Conjecture
 	Within section
 End
 Counter fact
-	GuiName Fact
 	Within section
 End
 Counter definition
-	GuiName Definition
 	Within section
-	LaTeXName defn
 End
 Counter example
-	GuiName Example
 	Within section
 End
 Counter problem
-	GuiName Problem
 	Within section
 End
 Counter exercise
-	GuiName Exercise
 	Within section
-	LaTeXName sca
 End
 Counter remark
-	GuiName Remark
 	Within section
 End
 Counter claim
-	GuiName Claim
 	Within section
 End
 


More information about the lyx-cvs mailing list