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