]> git.lyx.org Git - lyx.git/blob - lib/doc/Formula-numbering.lyx
EmbeddedObjects.lyx: describe caption above/below
[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]{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 \maintain_unincluded_children false
47 \language english
48 \language_package default
49 \inputencoding auto
50 \fontencoding global
51 \font_roman default
52 \font_sans default
53 \font_typewriter default
54 \font_default_family default
55 \use_non_tex_fonts false
56 \font_sc false
57 \font_osf false
58 \font_sf_scale 100
59 \font_tt_scale 100
60
61 \graphics default
62 \default_output_format default
63 \output_sync 0
64 \bibtex_command default
65 \index_command default
66 \paperfontsize 12
67 \spacing single
68 \use_hyperref false
69 \papersize default
70 \use_geometry false
71 \use_amsmath 2
72 \use_esint 0
73 \use_mhchem 1
74 \use_mathdots 1
75 \cite_engine basic
76 \use_bibtopic false
77 \use_indices false
78 \paperorientation portrait
79 \suppress_date false
80 \use_refstyle 0
81 \index Index
82 \shortcut idx
83 \color #008000
84 \end_index
85 \secnumdepth 4
86 \tocdepth 3
87 \paragraph_separation skip
88 \defskip medskip
89 \quotes_language english
90 \papercolumns 1
91 \papersides 1
92 \paperpagestyle empty
93 \tracking_changes false
94 \output_changes false
95 \html_math_output 0
96 \html_css_as_file 0
97 \html_be_strict false
98 \end_header
99
100 \begin_body
101
102 \begin_layout Standard
103 This document demonstrates the usage of two different formula categories.
104  One is Arabic, one is Roman numbered.
105 \end_layout
106
107 \begin_layout Standard
108 \begin_inset Formula 
109 \begin{equation}
110 A=B\label{eq:B}
111 \end{equation}
112
113 \end_inset
114
115
116 \begin_inset Formula 
117 \begin{equation}
118 A=C\label{eq:C}
119 \end{equation}
120
121 \end_inset
122
123
124 \begin_inset ERT
125 status collapsed
126
127 \begin_layout Plain Layout
128
129
130 \backslash
131 setrom
132 \end_layout
133
134 \end_inset
135
136
137 \begin_inset Formula 
138 \begin{equation}
139 A=D\label{eq:D}
140 \end{equation}
141
142 \end_inset
143
144
145 \begin_inset Formula 
146 \begin{equation}
147 A=E\label{eq:E}
148 \end{equation}
149
150 \end_inset
151
152
153 \begin_inset ERT
154 status collapsed
155
156 \begin_layout Plain Layout
157
158
159 \backslash
160 setarab
161 \end_layout
162
163 \end_inset
164
165
166 \begin_inset Formula 
167 \begin{equation}
168 A=F\label{eq:F}
169 \end{equation}
170
171 \end_inset
172
173
174 \begin_inset Formula 
175 \begin{equation}
176 A=G\label{eq:G}
177 \end{equation}
178
179 \end_inset
180
181
182 \begin_inset ERT
183 status collapsed
184
185 \begin_layout Plain Layout
186
187
188 \backslash
189 setrom
190 \end_layout
191
192 \end_inset
193
194
195 \begin_inset Formula 
196 \begin{equation}
197 A=H\label{eq:H}
198 \end{equation}
199
200 \end_inset
201
202
203 \begin_inset Formula 
204 \begin{equation}
205 A=I\label{eq:I}
206 \end{equation}
207
208 \end_inset
209
210
211 \end_layout
212
213 \begin_layout Standard
214 Cross-references: 
215 \begin_inset CommandInset ref
216 LatexCommand eqref
217 reference "eq:B"
218
219 \end_inset
220
221  , 
222 \begin_inset CommandInset ref
223 LatexCommand eqref
224 reference "eq:C"
225
226 \end_inset
227
228  , 
229 \begin_inset CommandInset ref
230 LatexCommand eqref
231 reference "eq:F"
232
233 \end_inset
234
235  , 
236 \begin_inset CommandInset ref
237 LatexCommand eqref
238 reference "eq:G"
239
240 \end_inset
241
242  , 
243 \begin_inset CommandInset ref
244 LatexCommand eqref
245 reference "eq:D"
246
247 \end_inset
248
249  , 
250 \begin_inset CommandInset ref
251 LatexCommand eqref
252 reference "eq:E"
253
254 \end_inset
255
256  , 
257 \begin_inset CommandInset ref
258 LatexCommand eqref
259 reference "eq:H"
260
261 \end_inset
262
263  , 
264 \begin_inset CommandInset ref
265 LatexCommand eqref
266 reference "eq:I"
267
268 \end_inset
269
270
271 \end_layout
272
273 \begin_layout Standard
274 \noindent
275 \begin_inset CommandInset line
276 LatexCommand rule
277 offset "0.5ex"
278 width "100line%"
279 height "1pt"
280
281 \end_inset
282
283
284 \begin_inset VSpace medskip
285 \end_inset
286
287 To create this example, first a counter must be defined for the Roman numbered
288  formulas.
289  To do this the following is inserted to the LaTeX-preamble:
290 \end_layout
291
292 \begin_layout Standard
293
294 \series bold
295
296 \backslash
297 newcounter{rom}
298 \begin_inset Newline newline
299 \end_inset
300
301
302 \backslash
303 renewcommand{
304 \backslash
305 therom}{
306 \backslash
307 roman{rom}}
308 \end_layout
309
310 \begin_layout Standard
311 \begin_inset Newpage newpage
312 \end_inset
313
314 To save the value of the Arabic counter 
315 \series bold
316 equation
317 \series default
318 , this is added to the preamble
319 \end_layout
320
321 \begin_layout Standard
322
323 \series bold
324
325 \backslash
326 newcommand{
327 \backslash
328 c@org@eq}{}
329 \begin_inset Newline newline
330 \end_inset
331
332
333 \backslash
334 let
335 \backslash
336 c@org@eq
337 \backslash
338 c@equation
339 \begin_inset Newline newline
340 \end_inset
341
342
343 \backslash
344 newcommand{
345 \backslash
346 org@theeq}{}
347 \begin_inset Newline newline
348 \end_inset
349
350
351 \backslash
352 let
353 \backslash
354 org@theeq
355 \backslash
356 theequation
357 \end_layout
358
359 \begin_layout Standard
360 To be able to switch in the document between the two numbering schemes,
361  the following commands are defined in the preamble:
362 \end_layout
363
364 \begin_layout Standard
365
366 \series bold
367
368 \backslash
369 newcommand{
370 \backslash
371 setrom}{
372 \backslash
373 let
374 \backslash
375 c@equation
376 \backslash
377 c@rom
378 \backslash
379 let
380 \backslash
381 theequation
382 \backslash
383 therom}
384 \end_layout
385
386 \begin_layout Standard
387 for Roman numbering and
388 \end_layout
389
390 \begin_layout Standard
391
392 \series bold
393
394 \backslash
395 newcommand{
396 \backslash
397 setarab}{
398 \backslash
399 let
400 \backslash
401 c@equation
402 \backslash
403 c@org@eq
404 \backslash
405 let
406 \backslash
407 theequation
408 \backslash
409 org@theeq}
410 \end_layout
411
412 \begin_layout Standard
413 for Arabic numbering.
414 \end_layout
415
416 \begin_layout Standard
417 Every formula will be by default numbered Arabic.
418  To switch to Roman numbering, the command 
419 \series bold
420
421 \backslash
422 setrom
423 \series default
424  is inserted in TeX-mode.
425  With the command 
426 \series bold
427
428 \backslash
429 setarab
430 \series default
431  the numbering is switched to Arabic.
432 \end_layout
433
434 \end_body
435 \end_document