]> git.lyx.org Git - lyx.git/commitdiff
* Add new modules for more fine-grained control over theorem numbering.
authorJürgen Spitzmüller <spitz@lyx.org>
Sat, 7 Nov 2009 10:44:08 +0000 (10:44 +0000)
committerJürgen Spitzmüller <spitz@lyx.org>
Sat, 7 Nov 2009 10:44:08 +0000 (10:44 +0000)
Modules provided by Paul Rubin (#5880).
* Fix some minor module description issues.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@31885 a592a061-630c-0410-9148-cb99ea01b6c8

15 files changed:
development/scons/scons_manifest.py
lib/Makefile.am
lib/layouts/theorems-ams-bytype.inc [new file with mode: 0644]
lib/layouts/theorems-ams-bytype.module [new file with mode: 0644]
lib/layouts/theorems-ams-extended-bytype.module [new file with mode: 0644]
lib/layouts/theorems-ams-extended.module
lib/layouts/theorems-ams.module
lib/layouts/theorems-bytype.inc [new file with mode: 0644]
lib/layouts/theorems-bytype.module [new file with mode: 0644]
lib/layouts/theorems-chap-bytype.module [new file with mode: 0644]
lib/layouts/theorems-chap.module
lib/layouts/theorems-sec-bytype.module [new file with mode: 0644]
lib/layouts/theorems-sec.module
lib/layouts/theorems-starred.module
lib/layouts/theorems-std.module

index cd104c24772438440f8637998d8a95030305ec74..f5de1cde43c4708e3ce566c3b13004faf11270d9 100644 (file)
@@ -2794,6 +2794,8 @@ lib_layouts_inc_files = Split('''
     svjour.inc
     theorems.inc
     theorems-ams.inc
+    theorems-ams-bytype.inc
+    theorems-bytype.inc
     theorems-order.inc
     theorems-proof.inc
     theorems-proof-std.inc
@@ -2816,9 +2818,14 @@ lib_layouts_module_files = Split('''
     noweb.module
     sweave.module
     tabs-within-sections.module
+    theorems-ams-bytype.module
     theorems-ams-extended.module
+    theorems-ams-extended-bytype.module
     theorems-ams.module
+    theorems-bytype.module
+    theorems-chap-bytype.module
     theorems-chap.module
+    theorems-sec-bytype.module
     theorems-sec.module
     theorems-starred.module
     theorems-std.module
index be773fc5dcebba98a72d7c9ea5b4a57fe51b56e4..bab07328c95b205f98da1e74340809d8c0db06d3 100644 (file)
@@ -1138,11 +1138,18 @@ dist_layouts_DATA =\
        layouts/tabs-within-sections.module \
        layouts/tarticle.layout \
        layouts/tbook.layout \
-       layouts/theorems-ams-extended.module \
        layouts/theorems-ams.inc \
        layouts/theorems-ams.module \
+       layouts/theorems-ams-bytype.inc \
+       layouts/theorems-ams-bytype.module \
+       layouts/theorems-ams-extended.module \
+       layouts/theorems-ams-extended-bytype.module \
        layouts/theorems-chap.module \
        layouts/theorems.inc \
+       layouts/theorems-bytype.inc \
+       layouts/theorems-bytype.module \
+       layouts/theorems-chap-bytype.module \
+       layouts/theorems-sec-bytype.module \
        layouts/theorems-order.inc \
        layouts/theorems-proof.inc \
        layouts/theorems-proof-std.inc \
diff --git a/lib/layouts/theorems-ams-bytype.inc b/lib/layouts/theorems-ams-bytype.inc
new file mode 100644 (file)
index 0000000..7b64075
--- /dev/null
@@ -0,0 +1,272 @@
+# Original Author : David L. Johnson <dlj0@lehigh.edu>
+# Probably broken by Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
+# modified and modularized by Emmanuel GUREGHIAN <gureghia@boston.bertin.fr>
+# Tinkered with Sep. '07 by Paul Rubin <rubin@msu.edu>
+# Modularized Jan 08 by Richard Heck <rgheck@comcast.net>
+# Hacked June '09 by Paul Rubin <rubin@msu.edu> to use separate counters
+
+# The environnements defined are :
+# - Theorem
+# - Corollary
+# - Lemma
+# - Proposition
+# - Conjecture
+# - Fact
+# - Definition
+# - Example
+# - Problem
+# - Exercise
+# - Remark
+# - Claim
+# - Case (regular only -- defined as an enumeration)
+
+# 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 problem
+End
+Counter exercise
+End
+Counter remark
+End
+Counter claim
+End
+
+Format 11
+
+Style Theorem
+       Category              Theorem
+       Margin                First_Dynamic
+       LatexType             Environment
+       LatexName             thm
+       NextNoIndent          1
+       OptionalArgs          1
+       LabelSep              xx
+       ParIndent             MMM
+       ParSkip               0.4
+       ItemSep               0.2
+       TopSep                0.7
+       BottomSep             0.7
+       ParSep                0.3
+       Align                 Block
+       AlignPossible         Left
+       LabelType             Counter
+       LabelCounter          theorem
+       LabelString           "Theorem \thetheorem."
+       Font
+         Shape               Italic
+         Size                Normal
+       EndFont
+       LabelFont
+         Shape               Up
+         Series              Bold
+       EndFont
+       Preamble
+               \theoremstyle{plain}
+               \newtheorem{thm}{Theorem}
+       EndPreamble
+       Requires              amsthm
+End
+
+
+Style Corollary
+       CopyStyle             Theorem
+       LatexName             cor
+       LabelString           "Corollary \thecorollary."
+       Preamble
+         \theoremstyle{plain}
+         \newtheorem{cor}{Corollary}
+       EndPreamble
+       LabelCounter          corollary
+End
+
+
+Style Lemma
+       CopyStyle             Theorem
+       LatexName             lem
+       LabelString           "Lemma \thelemma."
+       Preamble
+         \theoremstyle{plain}
+         \newtheorem{lem}{Lemma}
+       EndPreamble
+       LabelCounter          lemma
+End
+
+
+Style Proposition
+       CopyStyle             Theorem
+       LatexName             prop
+       LabelString           "Proposition \theproposition."
+       Preamble
+         \theoremstyle{plain}
+         \newtheorem{prop}{Proposition}
+       EndPreamble
+       LabelCounter          proposition
+End
+
+
+Style Conjecture
+       CopyStyle             Theorem
+       LatexName             conjecture
+       LabelString           "Conjecture \theconjecture."
+       Preamble
+         \theoremstyle{plain}
+         \newtheorem{conjecture}{Conjecture}
+       EndPreamble
+       LabelCounter          conjecture
+End
+
+
+Style Fact
+       CopyStyle             Theorem
+       LatexName             fact
+       LabelString           "Fact \thefact."
+       Preamble
+         \theoremstyle{plain}
+         \newtheorem{fact}{Fact}
+       EndPreamble
+       LabelCounter          fact
+End
+
+
+Style Definition
+       CopyStyle             Theorem
+       LatexName             defn
+       LabelString           "Definition \thedefinition."
+       Font
+         Shape               Up
+       EndFont
+       LabelFont
+         Shape               Up
+         Series              Bold
+       EndFont
+       Preamble
+         \theoremstyle{definition}
+         \newtheorem{defn}{Definition}
+       EndPreamble
+       LabelCounter          definition
+End
+
+
+Style Example
+       CopyStyle             Definition
+       LatexName             example
+       LabelString           "Example \theexample."
+       Preamble
+        \theoremstyle{definition}
+         \newtheorem{example}{Example}
+       EndPreamble
+       Requires              amsthm
+       LabelCounter          example
+End
+
+
+Style Problem
+       CopyStyle             Definition
+       LatexName             problem
+       LabelString           "Problem \theproblem."
+       Preamble
+         \theoremstyle{definition}
+         \newtheorem{problem}{Problem}
+       EndPreamble
+       Requires              amsthm
+       LabelCounter          problem
+End
+
+
+Style Exercise
+       CopyStyle             Definition
+       LatexName             xca
+       LabelString           "Exercise \theexercise."
+       Preamble
+         \theoremstyle{definition}
+         \newtheorem{xca}{Exercise}
+       EndPreamble
+       Requires              amsthm
+       LabelCounter          exercise
+End
+
+
+Style Remark
+       CopyStyle             Theorem
+       LatexName             rem
+       LabelString           "Remark \theremark."
+       Font
+         Shape               Up
+         Size                Normal
+       EndFont
+       LabelFont
+         Series              Medium
+         Shape               Italic
+       EndFont
+       Preamble
+         \theoremstyle{remark}
+         \newtheorem{rem}{Remark}
+       EndPreamble
+       LabelCounter          remark
+End
+
+
+Style Claim
+       CopyStyle             Remark
+       LatexName             claim
+       LabelString           "Claim \theclaim."
+       Preamble
+         \theoremstyle{remark}
+         \newtheorem{claim}{Claim}
+       EndPreamble
+       Requires              amsthm
+       LabelCounter          claim
+End
+
+
+# Define Case as an enumeration environment
+Style Case
+       Category              Theorem
+       Margin                Static
+       LatexType             Item_Environment
+       LatexName             caseenv
+       LabelType             Static
+       NextNoIndent          1
+       LeftMargin            "Case ###."
+       ParSkip               0.0
+       ItemSep               0.2
+       TopSep                0.7
+       BottomSep             0.7
+       ParSep                0.3
+       Align                 Block
+       AlignPossible         Block, Left
+       LabelSep              xx
+       LabelString           "Case #."
+       LabelFont
+         Series              Medium
+         Shape               Italic
+       EndFont
+       Preamble
+         \newcounter{casectr}
+         \newenvironment{caseenv}
+         {\begin{list}{{\itshape\ Case} \arabic{casectr}.}{%
+          \setlength{\leftmargin}{\labelwidth}
+          \addtolength{\leftmargin}{\parskip}
+          \setlength{\itemindent}{\listparindent}
+          \setlength{\itemsep}{\medskipamount}
+          \setlength{\topsep}{\itemsep}}
+          \setcounter{casectr}{0}
+          \usecounter{casectr}}
+         {\end{list}}
+       EndPreamble
+End
diff --git a/lib/layouts/theorems-ams-bytype.module b/lib/layouts/theorems-ams-bytype.module
new file mode 100644 (file)
index 0000000..93fbd47
--- /dev/null
@@ -0,0 +1,53 @@
+#\DeclareLyXModule{Theorems (AMS, Numbered by Type)}
+#DescriptionBegin
+#Defines theorem environments and the proof environment using the extended 
+#AMS machinery. Both numbered and unnumbered types are provided. Contrary to the
+#plain AMS Theorem module, the different theorem types provided here each have 
+#a separate counter (e.g., theorem 1, theorem 2, lemma 1, proposition 1, theorem 3,
+#lemma 2, ..., as opposed to theorem 1, theorem 2, lemma 3, proposition 4, ...).
+#The numbering's scope is the whole document. For chapter- and section-wide numbering,
+#use one of the 'within Sections'/'within Chapters' modules, respectively.
+#DescriptionEnd
+#Excludes: theorems-std | theorems-starred | theorems-ams | theorems-bytype
+
+# Original Author : David L. Johnson <dlj0@lehigh.edu>
+# Probably broken by Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
+# modified and modularized by Emmanuel GUREGHIAN <gureghia@boston.bertin.fr>
+# Tinkered with Sep. '07 by Paul Rubin <rubin@msu.edu>
+# Modularized Jan 08 by Richard Heck <rgheck@comcast.net>
+# Hacked June '09 by Paul Rubin <rubin@msu.edu> to use separate counters
+
+Format 11
+
+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 problem
+End
+Counter exercise
+End
+Counter remark
+End
+Counter claim
+End
+
+Input theorems-order.inc
+Input theorems-ams-bytype.inc
+Input theorems-starred.inc
+Input theorems-proof.inc
diff --git a/lib/layouts/theorems-ams-extended-bytype.module b/lib/layouts/theorems-ams-extended-bytype.module
new file mode 100644 (file)
index 0000000..cf391c0
--- /dev/null
@@ -0,0 +1,286 @@
+#\DeclareLyXModule{Theorems (AMS-Extended, Numbered by Type)}
+#DescriptionBegin
+#Defines some additional theorem environments for use with the
+#AMS theorems packages. Includes Criterion, Algorithm, Axiom,
+#Condition, Note, Notation, Summary, Acknowledgement, Conclusion,
+#Assumption, and Case, in both numbered and non-numbered forms.
+#Contrary to the plain AMS-Extended module, the different theorem 
+#types provided here each have a separate counter (e.g., criterion 1,
+#criterion 2, axiom 1, assumption 1, criterion 3, ...,
+#as opposed to criterion 1, criterion 2, axiom 3, assumption 4, ...).
+#DescriptionEnd
+#Requires: theorems-ams-bytype
+
+# Original Author : David L. Johnson <dlj0@lehigh.edu>
+# Probably broken by Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
+# modified and modularized by Emmanuel GUREGHIAN <gureghia@boston.bertin.fr>
+# Tinkered with Sep. '07 by Paul Rubin <rubin@msu.edu>
+# Modularized Jan 08 by Richard Heck <rgheck@comcast.net>
+# Hacked June '09 by Paul Rubin <rubin@msu.edu> to use separate counters
+
+Format 11
+
+Requires       amsmath
+
+# The environnements defined (regular and starred) are :
+# - Criterion
+# - Algorithm
+# - Axiom
+# - Condition
+# - Note
+# - Notation
+# - Summary
+# - Acknowledgement
+# - Conclusion
+# - Assumption
+
+# We need separate counters for each theorem-like style.
+Counter criterion
+End
+Counter algorithm
+End
+Counter axiom
+End
+Counter condition
+End
+Counter note
+End
+Counter notation
+End
+Counter summary
+End
+Counter acknowledgement
+End
+Counter conclusion
+End
+Counter assumption
+End
+
+
+Style Criterion
+       CopyStyle             Theorem
+       LatexName             criterion
+       LabelString           "Criterion \thecriterion."
+       Preamble
+         \theoremstyle{plain}
+         \newtheorem{criterion}{Criterion}
+       EndPreamble
+       LabelCounter          criterion
+End
+
+Style Criterion*
+       CopyStyle             Theorem*
+       LatexName             criterion*
+       LabelString           "Criterion."
+       Preamble
+         \theoremstyle{plain}
+         \newtheorem*{criterion*}{Criterion}
+       EndPreamble
+End
+
+
+Style Algorithm
+       CopyStyle             Theorem
+       LatexName             algorithm
+       LabelString           "Algorithm \thealgorithm."
+       Preamble
+         \theoremstyle{plain}
+         \newtheorem{algorithm}{Algorithm}
+       EndPreamble
+       LabelCounter          algorithm
+End
+
+
+Style Algorithm*
+       CopyStyle             Theorem*
+       LatexName             algorithm*
+       LabelString           "Algorithm."
+       Preamble
+         \theoremstyle{plain}
+         \newtheorem*{algorithm*}{Algorithm}
+       EndPreamble
+End
+
+
+Style Axiom
+       CopyStyle             Theorem
+       LatexName             ax
+       LabelString           "Axiom \theaxiom."
+       Preamble
+         \theoremstyle{plain}
+         \newtheorem{ax}{Axiom}
+       EndPreamble
+       LabelCounter          axiom
+End
+
+
+Style Axiom*
+       CopyStyle             Theorem*
+       LatexName             ax*
+       LabelString           "Axiom."
+       Preamble
+         \theoremstyle{plain}
+         \newtheorem*{ax*}{Axiom}
+       EndPreamble
+End
+
+
+Style Condition
+       CopyStyle             Definition
+       LatexName             condition
+       LabelString           "Condition \thecondition."
+       Preamble
+         \theoremstyle{definition}
+         \newtheorem{condition}{Condition}
+       EndPreamble
+       LabelCounter          condition
+End
+
+
+Style Condition*
+       CopyStyle             Definition*
+       LatexName             condition*
+       LabelString           "Condition."
+       Preamble
+         \theoremstyle{definition}
+         \newtheorem*{condition*}{Condition}
+       EndPreamble
+End
+
+
+Style Note
+       CopyStyle             Remark
+       LatexName             note
+       LabelString           "Note \thenote."
+       Preamble
+         \theoremstyle{remark}
+         \newtheorem{note}{Note}
+       EndPreamble
+       LabelCounter          note
+End
+
+
+Style Note*
+       CopyStyle             Remark*
+       LatexName             note*
+       LabelString           "Note."
+       Preamble
+         \theoremstyle{remark}
+         \newtheorem*{note*}{Note}
+       EndPreamble
+End
+
+
+Style Notation
+       CopyStyle             Remark
+       LatexName             notation
+       LabelString           "Notation \thenotation."
+       Preamble
+         \theoremstyle{remark}
+         \newtheorem{notation}{Notation}
+       EndPreamble
+       LabelCounter          notation
+End
+
+
+Style Notation*
+       CopyStyle             Remark*
+       LatexName             notation*
+       LabelString           "Notation."
+       Preamble
+         \theoremstyle{remark}
+         \newtheorem*{notation*}{Notation}
+       EndPreamble
+End
+
+
+Style Summary
+       CopyStyle             Remark
+       LatexName             summary
+       LabelString           "Summary \thesummary."
+       Preamble
+         \theoremstyle{remark}
+         \newtheorem{summary}{Summary}
+       EndPreamble
+       LabelCounter          summary
+End
+
+
+Style Summary*
+       CopyStyle             Remark*
+       LatexName             summary*
+       LabelString           "Summary."
+       Preamble
+         \theoremstyle{remark}
+         \newtheorem*{summary*}{Summary}
+       EndPreamble
+End
+
+
+Style Acknowledgement
+       CopyStyle             Remark
+       LatexName             acknowledgement
+       LabelString           "Acknowledgement \theacknowledgement."
+       Preamble
+         \theoremstyle{remark}
+         \newtheorem{acknowledgement}{Acknowledgement}
+       EndPreamble
+       LabelCounter          acknowledgement
+End
+
+
+Style Acknowledgement*
+       CopyStyle             Remark*
+       LatexName             acknowledgement*
+       LabelString           "Acknowledgement."
+       Preamble
+         \theoremstyle{remark}
+         \newtheorem*{acknowledgement*}{Acknowledgement}
+       EndPreamble
+End
+
+
+Style Conclusion
+       CopyStyle             Remark
+       LatexName             conclusion
+       LabelString           "Conclusion \theconclusion."
+       Preamble
+         \theoremstyle{remark}
+         \newtheorem{conclusion}{Conclusion}
+       EndPreamble
+       LabelCounter          conclusion
+End
+
+
+Style Conclusion*
+       CopyStyle             Remark*
+       LatexName             conclusion*
+       LabelString           "Conclusion."
+       Preamble
+         \theoremstyle{remark}
+         \newtheorem*{conclusion*}{Conclusion}
+       EndPreamble
+End
+
+
+Style Assumption
+       CopyStyle             Theorem
+       LatexName             assumption
+       LabelString           "Assumption \theassumption."
+       Preamble
+         \theoremstyle{plain}
+         \newtheorem{assumption}{Assumption}
+       EndPreamble
+       LabelCounter          assumption
+End
+
+
+Style Assumption*
+       CopyStyle             Theorem*
+       LatexName             assumption*
+       LabelString           "Assumption."
+       Preamble
+         \theoremstyle{plain}
+         \newtheorem*{assumption*}{Assumption}
+       EndPreamble
+End
index 90cc62681715835d58f6abd9ae6062646356616e..c75a88b106299f24006993e323f7a07ae97b030e 100644 (file)
@@ -3,7 +3,7 @@
 #Defines some additional theorem environments for use with the
 #AMS theorems packages. Includes Criterion, Algorithm, Axiom,
 #Condition, Note, Notation, Summary, Acknowledgement, Conclusion,
-#Fact, Assumption, Case, and Question, in both starred and non-starred
+#Fact, Assumption, Case, and Question, in both numbered and non-numbered
 #forms.
 #DescriptionEnd
 #Requires: theorems-ams
index 649a31fe66f948a5fa0c6b9bdef67992dce1e1fa..ab59e735c8fbfb61f99e21dfcce461e35f11e36d 100644 (file)
@@ -3,7 +3,7 @@
 #Defines theorem environments and the proof environment using the extended 
 #AMS machinery. Both numbered and unnumbered types are provided. By default, 
 #the theorems are numbered consecutively throughout the document. This can be
-#changed by loading one of the Theorems (By ...) modules.
+#changed by loading one of the 'Theorems (Numbered by ...)' modules.
 #DescriptionEnd
 #Excludes: theorems-std | theorems-starred
 #Category: theorems
diff --git a/lib/layouts/theorems-bytype.inc b/lib/layouts/theorems-bytype.inc
new file mode 100644 (file)
index 0000000..f2e0df1
--- /dev/null
@@ -0,0 +1,237 @@
+# Original Author : David L. Johnson <dlj0@lehigh.edu>
+# Probably broken by Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
+# modified and modularized by Emmanuel GUREGHIAN <gureghia@boston.bertin.fr>
+# Tinkered with Sep. '07 by Paul Rubin <rubin@msu.edu>
+# Modularized Jan 08 by Richard Heck <rgheck@comcast.net>
+# Hacked June '09 by Paul Rubin <rubin@msu.edu> to use separate counters
+
+# The environnements defined are :
+# - Theorem
+# - Corollary
+# - Lemma
+# - Proposition
+# - Conjecture
+# - Fact
+# - Definition
+# - Example
+# - Problem
+# - Exercise
+# - Remark
+# - Claim
+# - Proof
+# - Case (regular only -- defined as an enumeration)
+
+Format 11
+
+Style Theorem
+       Category              Theorem
+       Margin                First_Dynamic
+       LatexType             Environment
+       LatexName             thm
+       NextNoIndent          1
+       OptionalArgs          1
+       LabelSep              xx
+       ParIndent             MMM
+       ParSkip               0.4
+       ItemSep               0.2
+       TopSep                0.7
+       BottomSep             0.7
+       ParSep                0.3
+       Align                 Block
+       AlignPossible         Left
+       LabelType             Counter
+       LabelCounter          theorem
+       LabelString           "Theorem \thetheorem."
+       Font
+         Shape               Italic
+         Size                Normal
+       EndFont
+       LabelFont
+         Shape               Up
+         Series              Bold
+       EndFont
+       Preamble
+         \theoremstyle{plain}
+         \newtheorem{thm}{Theorem}
+       EndPreamble
+       Requires              amsthm
+End
+
+
+Style Corollary
+       CopyStyle             Theorem
+       LatexName             cor
+       LabelString           "Corollary \thecorollary."
+       Preamble
+         \theoremstyle{plain}
+         \newtheorem{cor}{Corollary}
+       EndPreamble
+       LabelCounter          corollary
+End
+
+
+Style Lemma
+       CopyStyle             Theorem
+       LatexName             lem
+       LabelString           "Lemma \thelemma."
+       Preamble
+         \theoremstyle{plain}
+         \newtheorem{lem}{Lemma}
+       EndPreamble
+       LabelCounter          lemma
+End
+
+
+Style Proposition
+       CopyStyle             Theorem
+       LatexName             prop
+       LabelString           "Proposition \theproposition."
+       Preamble
+         \theoremstyle{plain}
+         \newtheorem{prop}{Proposition}
+       EndPreamble
+       LabelCounter          proposition
+End
+
+
+Style Conjecture
+       CopyStyle             Theorem
+       LatexName             conjecture
+       LabelString           "Conjecture \theconjecture."
+       Preamble
+         \theoremstyle{plain}
+         \newtheorem{conjecture}{Conjecture}
+       EndPreamble
+       LabelCounter          conjecture
+End
+
+
+Style Fact
+       CopyStyle             Theorem
+       LatexName             fact
+       LabelString           "Fact \thefact."
+       Preamble
+         \theoremstyle{plain}
+         \newtheorem{fact}{Fact}
+       EndPreamble
+       LabelCounter          fact
+End
+
+
+Style Definition
+       CopyStyle             Theorem
+       LatexName             defn
+       LabelString           "Definition \thedefinition."
+       Font
+         Shape               Up
+       EndFont
+       LabelFont
+         Shape               Up
+         Series              Bold
+       EndFont
+       Preamble
+         \theoremstyle{definition}
+         \newtheorem{defn}{Definition}
+       EndPreamble
+       LabelCounter          definition  
+End
+
+
+Style Example
+       CopyStyle             Definition
+       LatexName             example
+       LabelString           "Example \theexample."
+       Preamble
+         \theoremstyle{definition}
+         \newtheorem{example}{Example}
+       EndPreamble
+       Requires              amsthm
+       LabelCounter          example
+End
+
+
+Style Problem
+       CopyStyle             Definition
+       LatexName             problem
+       LabelString           "Problem \theproblem."
+       Preamble
+         \theoremstyle{definition}
+         \newtheorem{problem}{Problem}
+       EndPreamble
+       Requires              amsthm
+       LabelCounter          problem
+End
+
+
+Style Exercise
+       CopyStyle             Definition
+       LatexName             xca
+       LabelString           "Exercise \theexercise."
+       Preamble
+         \theoremstyle{definition}
+         \newtheorem{xca}{Exercise}
+       EndPreamble
+       Requires              amsthm
+       LabelCounter          exercise
+End
+
+
+Style Remark
+       CopyStyle             Theorem
+       LatexName             rem
+       LabelString           "Remark \theremark."
+       Font
+         Shape               Up
+         Size                Normal
+       EndFont
+       LabelFont
+         Series              Medium
+         Shape               Italic
+       EndFont
+       Preamble
+         \theoremstyle{remark}
+         \newtheorem{rem}{Remark}
+       EndPreamble
+       LabelCounter          remark
+End
+
+
+Style Claim
+       CopyStyle             Remark
+       LatexName             claim
+       LabelString           "Claim \theclaim."
+       Preamble
+         \theoremstyle{remark}
+         \newtheorem{claim}{Claim}
+       EndPreamble
+       Requires              amsthm
+       LabelCounter          claim
+End
+
+
+# Define Case as an enumeration environment
+Style Case
+       Category              Theorem
+       CopyStyle             Enumerate
+       LatexName             caseenv
+       LabelType             Static
+       LeftMargin            "Case ###."
+       LabelString           "Case #."
+       LabelFont
+         Series              Medium
+         Shape               Italic
+       EndFont
+       Preamble
+         \newcounter{casectr}
+         \newenvironment{caseenv}
+         {\begin{list}{{\itshape\ Case} \arabic{casectr}.}{%
+          \setlength{\leftmargin}{\labelwidth}
+          \addtolength{\leftmargin}{\parskip}
+          \setlength{\itemindent}{\listparindent}
+          \setlength{\itemsep}{\medskipamount}
+          \setlength{\topsep}{\itemsep}}
+          \setcounter{casectr}{0}
+          \usecounter{casectr}}
+         {\end{list}}
+       EndPreamble
+End
diff --git a/lib/layouts/theorems-bytype.module b/lib/layouts/theorems-bytype.module
new file mode 100644 (file)
index 0000000..b55c0c2
--- /dev/null
@@ -0,0 +1,62 @@
+#\DeclareLyXModule{Theorems (Numbered by Type)}
+#DescriptionBegin
+#Defines some theorem environments for use with non-AMS classes. Contrary to the
+#plain Theorem module, the different theorem types provided here each have a separate
+#counter (e.g., theorem 1, theorem 2, lemma 1, proposition 1, theorem 3, lemma 2, ...,
+#as opposed to theorem 1, theorem 2, lemma 3, proposition 4, ...).
+#The numbering's scope is the whole document. For chapter- and section-wide numbering,
+#use one of the 'within Sections'/'within Chapters' modules, respectively.
+#DescriptionEnd
+#Excludes: theorems-std | theorems-ams | theorems-starred | theorems-ams-bytype
+
+# Author: Paul Rubin <rubin@msu.edu> (hacked from Richard Heck's theorems-std.module)
+
+Format 11
+
+# 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 problem
+End
+Counter exercise
+End
+Counter remark
+End
+Counter claim
+End
+
+Input theorems-bytype.inc
+Input theorems-proof.inc
+
+#This is just a hacked version of the AMS proof environment
+Style Proof
+  Preamble
+    \ifx\proof\undefined\
+      \newenvironment{proof}[1][\proofname]{\par
+        \normalfont\topsep6\p@\@plus6\p@\relax
+        \trivlist
+        \itemindent\parindent
+        \item[\hskip\labelsep
+              \scshape
+          #1]\ignorespaces
+      }{%
+        \endtrivlist\@endpefalse
+      }
+      \providecommand{\proofname}{Proof}
+    \fi
+  EndPreamble
+End
\ No newline at end of file
diff --git a/lib/layouts/theorems-chap-bytype.module b/lib/layouts/theorems-chap-bytype.module
new file mode 100644 (file)
index 0000000..5929b70
--- /dev/null
@@ -0,0 +1,195 @@
+#\DeclareLyXModule{Theorems (Numbered by Type within Chapters)}
+#DescriptionBegin
+#Defines some theorem environments for use with non-AMS classes. Contrary to the
+#plain Theorem module, the different theorem types provided here each have a separate
+#counter (e.g., theorem 1, theorem 2, lemma 1, proposition 1, theorem 3, lemma 2, ...,
+#as opposed to theorem 1, theorem 2, lemma 3, proposition 4, ...). The numbering is reset
+#at each chapter start.
+#DescriptionEnd
+#Requires: theorems-bytype | theorems-ams-bytype
+#Excludes: theorems-std | theorems-ams | theorems-starred | theorems-sec | theorems-sec-bytype
+
+# Author: Paul Rubin <rubin@msu.edu> (hacked from Richard Heck's various modules)
+
+Format 11
+
+# We need separate counters for each theorem-like style.
+Counter theorem
+       Within         chapter
+End
+Counter corollary
+       Within         chapter
+End
+Counter lemma
+       Within         chapter
+End
+Counter proposition
+       Within         chapter
+End
+Counter conjecture
+       Within         chapter
+End
+Counter fact
+       Within         chapter
+End
+Counter definition
+       Within         chapter
+End
+Counter example
+       Within         chapter
+End
+Counter problem
+       Within         chapter
+End
+Counter exercise
+       Within         chapter
+End
+Counter remark
+       Within         chapter
+End
+Counter claim
+       Within         chapter
+End
+
+Style Theorem
+       Preamble
+         \theoremstyle{plain}
+         \ifx\thechapter\undefined
+           \newtheorem{thm}{Theorem}
+         \else
+           \newtheorem{thm}{Theorem}[chapter]
+         \fi
+       EndPreamble
+End
+
+
+Style Corollary
+       Preamble
+         \theoremstyle{plain}
+         \ifx\thechapter\undefined
+           \newtheorem{cor}{Corollary}
+         \else
+           \newtheorem{cor}{Corollary}[chapter]
+         \fi
+       EndPreamble
+End
+
+
+Style Lemma
+       Preamble
+         \theoremstyle{plain}
+         \ifx\thechapter\undefined
+           \newtheorem{lem}{Lemma}
+         \else
+           \newtheorem{lem}{Lemma}[chapter]
+         \fi
+       EndPreamble
+End
+
+
+Style Proposition
+       Preamble
+         \theoremstyle{plain}
+         \ifx\thechapter\undefined
+           \newtheorem{prop}{Proposition}
+         \else
+           \newtheorem{prop}{Proposition}[chapter]
+         \fi
+       EndPreamble
+End
+
+
+Style Conjecture
+       Preamble
+         \theoremstyle{plain}
+         \ifx\thechapter\undefined
+           \newtheorem{conjecture}{Conjecture}
+         \else
+           \newtheorem{conjecture}{Conjecture}[chapter]
+         \fi
+       EndPreamble
+End
+
+
+Style Fact
+       Preamble
+         \theoremstyle{plain}
+         \ifx\thechapter\undefined
+           \newtheorem{fact}{Fact}
+         \else
+           \newtheorem{fact}{Fact}[chapter]
+         \fi
+       EndPreamble
+End
+
+
+Style Definition
+       Preamble
+         \theoremstyle{definition}
+         \ifx\thechapter\undefined
+           \newtheorem{defn}{Definition}
+         \else
+           \newtheorem{defn}{Definition}[chapter]
+         \fi
+       EndPreamble
+End
+
+
+Style Example
+       Preamble
+         \theoremstyle{definition}
+         \ifx\thechapter\undefined
+           \newtheorem{example}{Example}
+         \else
+           \newtheorem{example}{Example}[chapter]
+         \fi
+       EndPreamble
+End
+
+
+Style Problem
+       Preamble
+         \theoremstyle{definition}
+         \ifx\thechapter\undefined
+           \newtheorem{problem}{Problem}
+         \else
+           \newtheorem{problem}{Problem}[chapter]
+         \fi
+       EndPreamble
+End
+
+
+Style Exercise
+       Preamble
+         \theoremstyle{definition}
+         \ifx\thechapter\undefined
+           \newtheorem{xca}{Exercise}
+         \else
+           \newtheorem{xca}{Exercise}[chapter]
+         \fi
+       EndPreamble
+End
+
+
+Style Remark
+       Preamble
+         \theoremstyle{remark}
+         \ifx\thechapter\undefined
+           \newtheorem{rem}{Remark}
+         \else
+           \newtheorem{rem}{Remark}[chapter]
+         \fi
+       EndPreamble
+End
+
+
+Style Claim
+       Preamble
+         \theoremstyle{remark}
+         \ifx\thechapter\undefined
+           \newtheorem{claim}{Claim}
+         \else
+           \newtheorem{claim}{Claim}[chapter]
+         \fi
+       EndPreamble
+End
index 07d83f80b6c914eaaf30cbaf6836ef7fc5b03c4c..2971ec0288e628eb801d6031b6079a45c793922e 100644 (file)
@@ -1,7 +1,8 @@
-#\DeclareLyXModule{Theorems (By Chapter)}
+#\DeclareLyXModule{Theorems (Numbered by Chapter)}
 #DescriptionBegin
-#Numbers theorems and the like by chapter. Use this module only with
-#layouts that provide a chapter environment.
+#Numbers theorems and the like by chapter (i.e., the counter is reset at
+#each chapter start). Use this module only with layouts that provide a chapter
+#environment.
 #DescriptionEnd
 #Requires: theorems-std | theorems-ams
 #Excludes: theorems-sec
diff --git a/lib/layouts/theorems-sec-bytype.module b/lib/layouts/theorems-sec-bytype.module
new file mode 100644 (file)
index 0000000..498a0a3
--- /dev/null
@@ -0,0 +1,147 @@
+#\DeclareLyXModule{Theorems (Numbered by Type within Sections)}
+#DescriptionBegin
+#Defines some theorem environments for use with non-AMS classes. Contrary to the
+#plain Theorem module, the different theorem types provided here each have a separate
+#counter (e.g., theorem 1, theorem 2, lemma 1, proposition 1, theorem 3, lemma 2, ...,
+#as opposed to theorem 1, theorem 2, lemma 3, proposition 4, ...). The numbering is reset
+#at each section start.
+#DescriptionEnd
+#Requires: theorems-bytype | theorems-ams-bytype
+#Excludes: theorems-std | theorems-ams | theorems-starred | theorems-chap | theorems-chap-bytype
+
+# Author: Paul Rubin <rubin@msu.edu> (hacked from Richard Heck's various modules)
+
+Format 11
+
+# We need separate counters for each theorem-like style.
+Counter theorem
+       Within         section
+End
+Counter corollary
+       Within         section
+End
+Counter lemma
+       Within         section
+End
+Counter proposition
+       Within         section
+End
+Counter conjecture
+       Within         section
+End
+Counter fact
+       Within         section
+End
+Counter definition
+       Within         section
+End
+Counter example
+       Within         section
+End
+Counter problem
+       Within         section
+End
+Counter exercise
+       Within         section
+End
+Counter remark
+       Within         section
+End
+Counter claim
+       Within         section
+End
+
+Style Theorem
+       Preamble
+         \theoremstyle{plain}
+         \newtheorem{thm}{Theorem}[section]
+       EndPreamble
+End
+
+
+Style Corollary
+       Preamble
+         \theoremstyle{plain}
+         \newtheorem{cor}{Corollary}[section]
+       EndPreamble
+End
+
+
+Style Lemma
+       Preamble
+         \theoremstyle{plain}
+         \newtheorem{lem}{Lemma}[section]
+       EndPreamble
+End
+
+
+Style Proposition
+       Preamble
+         \theoremstyle{plain}
+         \newtheorem{prop}{Proposition}[section]
+       EndPreamble
+End
+
+
+Style Conjecture
+       Preamble
+         \theoremstyle{plain}
+         \newtheorem{conjecture}{Conjecture}[section]
+       EndPreamble
+End
+
+
+Style Fact
+       Preamble
+         \theoremstyle{plain}
+         \newtheorem{fact}{Fact}[section]
+       EndPreamble
+End
+
+
+Style Definition
+       Preamble
+         \theoremstyle{definition}
+         \newtheorem{defn}{Definition}[section]
+       EndPreamble
+End
+
+
+Style Example
+       Preamble
+         \theoremstyle{definition}
+         \newtheorem{example}{Example}[section]
+       EndPreamble
+End
+
+
+Style Problem
+       Preamble
+         \theoremstyle{definition}
+         \newtheorem{problem}{Problem}[section]
+       EndPreamble
+End
+
+
+Style Exercise
+       Preamble
+         \theoremstyle{definition}
+         \newtheorem{xca}{Exercise}[section]
+       EndPreamble
+End
+
+
+Style Remark
+       Preamble
+         \theoremstyle{remark}
+         \newtheorem{rem}{Remark}[section]
+       EndPreamble
+End
+
+
+Style Claim
+       Preamble
+         \theoremstyle{remark}
+         \newtheorem{claim}{Claim}[section]
+       EndPreamble
+End
index 754ebc965bde9228490fe048766cce975abea8c3..c838960af17587a26550e5c46c39ec8d41fbedb3 100644 (file)
@@ -1,6 +1,7 @@
-#\DeclareLyXModule{Theorems (By Section)}
+#\DeclareLyXModule{Theorems (Numbered by Section)}
 #DescriptionBegin
-#Numbers theorems and the like by section.
+#Numbers theorems and the like by section (i.e., the counter is reset at
+#each section start).
 #DescriptionEnd
 #Requires: theorems-std | theorems-ams
 #Excludes: theorems-chap
index d2072c1098b8cf8c088530a132ada51407d097ac..314e3221bf1b7162abbfbec35a899b6bca2c2e8f 100644 (file)
@@ -1,4 +1,4 @@
-#\DeclareLyXModule{Theorems (Starred)}
+#\DeclareLyXModule{Theorems (Unnumbered)}
 #DescriptionBegin
 #Defines only unnumbered theorem environments, and the proof environment, using 
 #the extended AMS machinery. 
index ff4664791294e58d681f1639d3e18885c1cf7040..94394dcc40d34774affb48c97bc6e8a42bd04231 100644 (file)
@@ -2,7 +2,7 @@
 #DescriptionBegin
 #Defines some theorem environments for use with non-AMS classes. By default, 
 #the theorems are numbered consecutively throughout the document. This can be
-#changed by loading one of the Theorems (Ordered By ...) modules.
+#changed by loading one of the 'Theorems (Numbered by ...)' modules.
 #DescriptionEnd
 #Excludes: theorems-ams | theorems-starred
 #Category: theorems