]> git.lyx.org Git - lyx.git/blob - lib/layouts/theorems-chap-bytype.module
c2026392386878a13f7f45c9292e7436b2a17a47
[lyx.git] / lib / layouts / theorems-chap-bytype.module
1 #\DeclareLyXModule{Theorems (Numbered by Type within Chapters)}
2 #DescriptionBegin
3 #Defines some theorem environments for use with non-AMS classes. Contrary to the
4 #plain Theorem module, the different theorem types provided here each have a separate
5 #counter (e.g., theorem 1, theorem 2, lemma 1, proposition 1, theorem 3, lemma 2, ...,
6 #as opposed to theorem 1, theorem 2, lemma 3, proposition 4, ...). The numbering is reset
7 #at each chapter start.
8 #DescriptionEnd
9 #Requires: theorems-bytype | theorems-ams-bytype
10 #Excludes: theorems-std | theorems-ams | theorems-starred | theorems-sec | theorems-sec-bytype
11
12 # Author: Paul Rubin <rubin@msu.edu> (hacked from Richard Heck's various modules)
13
14 Format 68
15
16 # We need separate counters for each theorem-like style.
17 Counter theorem
18         Within         chapter
19 End
20 Counter corollary
21         Within         chapter
22 End
23 Counter lemma
24         Within         chapter
25 End
26 Counter proposition
27         Within         chapter
28 End
29 Counter conjecture
30         Within         chapter
31 End
32 Counter fact
33         Within         chapter
34 End
35 Counter definition
36         Within         chapter
37 End
38 Counter example
39         Within         chapter
40 End
41 Counter problem
42         Within         chapter
43 End
44 Counter exercise
45         Within         chapter
46 End
47 Counter remark
48         Within         chapter
49 End
50 Counter claim
51         Within         chapter
52 End
53
54 Style Theorem
55         Preamble
56           \theoremstyle{plain}
57           \ifx\thechapter\undefined
58             \newtheorem{thm}{\protect\theoremname}
59           \else
60             \newtheorem{thm}{\protect\theoremname}[chapter]
61           \fi
62         EndPreamble
63 End
64
65
66 Style Corollary
67         Preamble
68           \theoremstyle{plain}
69           \ifx\thechapter\undefined
70             \newtheorem{cor}{\protect\corollaryname}
71           \else
72             \newtheorem{cor}{\protect\corollaryname}[chapter]
73           \fi
74         EndPreamble
75 End
76
77
78 Style Lemma
79         Preamble
80           \theoremstyle{plain}
81           \ifx\thechapter\undefined
82             \newtheorem{lem}{\protect\lemmaname}
83           \else
84             \newtheorem{lem}{\protect\lemmaname}[chapter]
85           \fi
86         EndPreamble
87 End
88
89
90 Style Proposition
91         Preamble
92           \theoremstyle{plain}
93           \ifx\thechapter\undefined
94             \newtheorem{prop}{\protect\propositionname}
95           \else
96             \newtheorem{prop}{\protect\propositionname}[chapter]
97           \fi
98         EndPreamble
99 End
100
101
102 Style Conjecture
103         Preamble
104           \theoremstyle{plain}
105           \ifx\thechapter\undefined
106             \newtheorem{conjecture}{\protect\conjecturename}
107           \else
108             \newtheorem{conjecture}{\protect\conjecturename}[chapter]
109           \fi
110         EndPreamble
111 End
112
113
114 Style Fact
115         Preamble
116           \theoremstyle{plain}
117           \ifx\thechapter\undefined
118             \newtheorem{fact}{\protect\factname}
119           \else
120             \newtheorem{fact}{\protect\factname}[chapter]
121           \fi
122         EndPreamble
123 End
124
125
126 Style Definition
127         Preamble
128           \theoremstyle{definition}
129           \ifx\thechapter\undefined
130             \newtheorem{defn}{\protect\definitionname}
131           \else
132             \newtheorem{defn}{\protect\definitionname}[chapter]
133           \fi
134         EndPreamble
135 End
136
137
138 Style Example
139         Preamble
140           \theoremstyle{definition}
141           \ifx\thechapter\undefined
142             \newtheorem{example}{\protect\examplename}
143           \else
144             \newtheorem{example}{\protect\examplename}[chapter]
145           \fi
146         EndPreamble
147 End
148
149
150 Style Problem
151         Preamble
152           \theoremstyle{definition}
153           \ifx\thechapter\undefined
154             \newtheorem{problem}{\protect\problemname}
155           \else
156             \newtheorem{problem}{\protect\problemname}[chapter]
157           \fi
158         EndPreamble
159 End
160
161
162 Style Exercise
163         Preamble
164           \theoremstyle{definition}
165           \ifx\thechapter\undefined
166             \newtheorem{xca}{\protect\exercisename}
167           \else
168             \newtheorem{xca}{\protect\exercisename}[chapter]
169           \fi
170         EndPreamble
171 End
172
173
174 Style Remark
175         Preamble
176           \theoremstyle{remark}
177           \ifx\thechapter\undefined
178             \newtheorem{rem}{\protect\remarkname}
179           \else
180             \newtheorem{rem}{\protect\remarkname}[chapter]
181           \fi
182         EndPreamble
183 End
184
185
186 Style Claim
187         Preamble
188           \theoremstyle{remark}
189           \ifx\thechapter\undefined
190             \newtheorem{claim}{\protect\claimname}
191           \else
192             \newtheorem{claim}{\protect\claimname}[chapter]
193           \fi
194         EndPreamble
195 End