]> git.lyx.org Git - lyx.git/blob - lib/doc/Formula-numbering.lyx
b5a7d845e85f63e308c245c7332e8e9ea53ed031
[lyx.git] / lib / doc / Formula-numbering.lyx
1 #LyX 2.0 created this file. For more info see http://www.lyx.org/
2 \lyxformat 413
3 \begin_document
4 \begin_header
5 \textclass scrartcl
6 \begin_preamble
7 \usepackage{ifpdf}
8
9 \ifpdf
10
11 \usepackage[colorlinks=true,
12  pdftitle=Formelnummerierung, pdfpagemode=none,
13  pdfpagelayout=OneColumn, pdfstartview=XYZ,
14  pdfauthor={Uwe Stöhr},
15  pdfsubject={LaTeX/LyX numbering example},
16  pdfkeywords={LaTeX, numbering, LyX}]{hyperref}
17
18 \else % if DVI
19
20 \usepackage[colorlinks=true, hypertex]{hyperref}
21
22 \fi
23
24 % define Roman counter
25 \newcounter{rom}
26 \renewcommand{\therom}{\roman{rom}}
27
28 % remember the original counter
29 \newcommand{\c@org@eq}{}
30 \let\c@org@eq\c@equation
31 \newcommand{\org@theeq}{}
32 \let\org@theeq\theequation
33
34 % \setrom activates the Roman counter
35 \newcommand{\setrom}{
36   \let\c@equation\c@rom
37   \let\theequation\therom}
38
39 % \setarab activates the original Arabic counter
40 \newcommand{\setarab}{
41   \let\c@equation\c@org@eq
42   \let\theequation\org@theeq}
43 \end_preamble
44 \options fleqn
45 \use_default_options false
46 \language english
47 \language_package default
48 \inputencoding auto
49 \font_roman default
50 \font_sans default
51 \font_typewriter default
52 \font_default_family default
53 \font_sc false
54 \font_osf false
55 \font_sf_scale 100
56 \font_tt_scale 100
57 \graphics default
58 \paperfontsize 12
59 \spacing single
60 \use_hyperref false
61 \papersize default
62 \use_geometry false
63 \use_amsmath 2
64 \use_esint 0
65 \use_mhchem 1
66 \use_mathdots 1
67 \cite_engine basic
68 \use_bibtopic false
69 \paperorientation portrait
70 \secnumdepth 4
71 \tocdepth 3
72 \paragraph_separation skip
73 \defskip medskip
74 \quotes_language english
75 \papercolumns 1
76 \papersides 1
77 \paperpagestyle empty
78 \tracking_changes false
79 \output_changes false
80 \author 1 "" 
81 \author 2 "" 
82 \use_refstyle 0
83 \end_header
84
85 \begin_body
86
87 \begin_layout Standard
88 This document demonstrates the usage of two different formula categories.
89  One is Arabic, one is Roman numbered.
90 \end_layout
91
92 \begin_layout Standard
93 \begin_inset Formula \begin{equation}
94 A=B\label{eq:B}\end{equation}
95
96 \end_inset
97
98
99 \begin_inset Formula \begin{equation}
100 A=C\label{eq:C}\end{equation}
101
102 \end_inset
103
104
105 \begin_inset ERT
106 status collapsed
107
108 \begin_layout Plain Layout
109
110
111 \backslash
112 setrom
113 \end_layout
114
115 \end_inset
116
117
118 \begin_inset Formula \begin{equation}
119 A=D\label{eq:D}\end{equation}
120
121 \end_inset
122
123
124 \begin_inset Formula \begin{equation}
125 A=E\label{eq:E}\end{equation}
126
127 \end_inset
128
129
130 \begin_inset ERT
131 status collapsed
132
133 \begin_layout Plain Layout
134
135
136 \backslash
137 setarab
138 \end_layout
139
140 \end_inset
141
142
143 \begin_inset Formula \begin{equation}
144 A=F\label{eq:F}\end{equation}
145
146 \end_inset
147
148
149 \begin_inset Formula \begin{equation}
150 A=G\label{eq:G}\end{equation}
151
152 \end_inset
153
154
155 \begin_inset ERT
156 status collapsed
157
158 \begin_layout Plain Layout
159
160
161 \backslash
162 setrom
163 \end_layout
164
165 \end_inset
166
167
168 \begin_inset Formula \begin{equation}
169 A=H\label{eq:H}\end{equation}
170
171 \end_inset
172
173
174 \begin_inset Formula \begin{equation}
175 A=I\label{eq:I}\end{equation}
176
177 \end_inset
178
179
180 \end_layout
181
182 \begin_layout Standard
183 Cross-references: 
184 \begin_inset CommandInset ref
185 LatexCommand eqref
186 reference "eq:B"
187
188 \end_inset
189
190  , 
191 \begin_inset CommandInset ref
192 LatexCommand eqref
193 reference "eq:C"
194
195 \end_inset
196
197  , 
198 \begin_inset CommandInset ref
199 LatexCommand eqref
200 reference "eq:F"
201
202 \end_inset
203
204  , 
205 \begin_inset CommandInset ref
206 LatexCommand eqref
207 reference "eq:G"
208
209 \end_inset
210
211  , 
212 \begin_inset CommandInset ref
213 LatexCommand eqref
214 reference "eq:D"
215
216 \end_inset
217
218  , 
219 \begin_inset CommandInset ref
220 LatexCommand eqref
221 reference "eq:E"
222
223 \end_inset
224
225  , 
226 \begin_inset CommandInset ref
227 LatexCommand eqref
228 reference "eq:H"
229
230 \end_inset
231
232  , 
233 \begin_inset CommandInset ref
234 LatexCommand eqref
235 reference "eq:I"
236
237 \end_inset
238
239
240 \end_layout
241
242 \begin_layout Standard
243 \noindent
244
245 \begin_inset CommandInset line
246 LatexCommand rule
247 offset "0.5ex"
248 width "100line%"
249 height "1pt"
250
251 \end_inset
252
253
254
255 \begin_inset VSpace medskip
256 \end_inset
257
258 To create this example, first a counter must be defined for the Roman numbered
259  formulas.
260  To do this the following is inserted to the LaTeX-preamble:
261 \end_layout
262
263 \begin_layout Standard
264
265 \series bold
266
267 \backslash
268 newcounter{rom}
269 \begin_inset Newline newline
270 \end_inset
271
272
273 \backslash
274 renewcommand{
275 \backslash
276 therom}{
277 \backslash
278 roman{rom}}
279 \end_layout
280
281 \begin_layout Standard
282 \begin_inset Newpage newpage
283 \end_inset
284
285 To save the value of the Arabic counter 
286 \series bold
287 equation
288 \series default
289 , this is added to the preamble
290 \end_layout
291
292 \begin_layout Standard
293
294 \series bold
295
296 \backslash
297 newcommand{
298 \backslash
299 c@org@eq}{}
300 \begin_inset Newline newline
301 \end_inset
302
303
304 \backslash
305 let
306 \backslash
307 c@org@eq
308 \backslash
309 c@equation
310 \begin_inset Newline newline
311 \end_inset
312
313
314 \backslash
315 newcommand{
316 \backslash
317 org@theeq}{}
318 \begin_inset Newline newline
319 \end_inset
320
321
322 \backslash
323 let
324 \backslash
325 org@theeq
326 \backslash
327 theequation
328 \end_layout
329
330 \begin_layout Standard
331 To be able to switch in the document between the two numbering schemes,
332  the following commands are defined in the preamble:
333 \end_layout
334
335 \begin_layout Standard
336
337 \series bold
338
339 \backslash
340 newcommand{
341 \backslash
342 setrom}{
343 \backslash
344 let
345 \backslash
346 c@equation
347 \backslash
348 c@rom
349 \backslash
350 let
351 \backslash
352 theequation
353 \backslash
354 therom}
355 \end_layout
356
357 \begin_layout Standard
358 for Roman numbering and
359 \end_layout
360
361 \begin_layout Standard
362
363 \series bold
364
365 \backslash
366 newcommand{
367 \backslash
368 setarab}{
369 \backslash
370 let
371 \backslash
372 c@equation
373 \backslash
374 c@org@eq
375 \backslash
376 let
377 \backslash
378 theequation
379 \backslash
380 org@theeq}
381 \end_layout
382
383 \begin_layout Standard
384 for Arabic numbering.
385 \end_layout
386
387 \begin_layout Standard
388 Every formula will be by default numbered Arabic.
389  To switch to Roman numbering, the command 
390 \series bold
391
392 \backslash
393 setrom
394 \series default
395  is inserted in TeX-mode.
396  With the command 
397 \series bold
398
399 \backslash
400 setarab
401 \series default
402  the numbering is switched to Arabic.
403 \end_layout
404
405 \end_body
406 \end_document