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