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