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