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