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