summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/bosisio/envmath.html
blob: 73862b442547b3825b876a118bbee2e002f0d5c3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
<html>
<!--
+ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
|            Copyright(C) 1997-2010 by F. Bosisio             |
|                                                             |
| This program can be redistributed and/or modified under     |
| the terms of the LaTeX Project Public License, either       |
| version 1.3 of this license or (at your option) any later   |
| version. The latest version of this license is in           |
|   http://www.latex-project.org/lppl.txt                     |
| and version 1.3 or later is part of all LaTeX distributions |
| version 2005/12/01 or later.                                |
|                                                             |
| This work has the LPPL maintenance status `maintained'.     |
| The Current Maintainer of this work is F. Bosisio.          |
|                                                             |
| This work consists of files envmath.dtx and envmath.html    |
| and of the derived files envmath.sty and envmath.pdf.       |
|                                                             |
| E-mail:   fbosisio@bigfoot.com                              |
| CTAN location: macros/latex/contrib/bosisio/                |
+ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
-->
<head>
  <title>Package envmath</title>
</head>
<body>

<h1 align="CENTER">
Package <tt>envmath</tt><br />
<small>
This is version 2.5, last revised 2010/02/10; documentation date 2005/04/09.
</small>
</h1>

<p align="CENTER">
<strong>
Author: <i>F. Bosisio</i><br />
<small>
E-mail: <a href="mailto:fbosisio@bigfoot.com">
	<tt>fbosisio@bigfoot.com</tt>
	</a><br />
CTAN location: <a href="http://mirror.ctan.org/macros/latex/contrib/bosisio">
	       <tt>macros/latex/contrib/bosisio</tt>
	       </a>
</small>
</strong>
</p>

<p align="LEFT"></p>

<!------------------------------------------------------------------------>
<p>

<h3>Abstract</h3>
<div>
Documentation for the package <tt>envmath</tt>.
</div>

<hr /><br />
<!------------------------------------------------------------------------>

<h2>Table of contents</h2>

<ul>
  <li><a href="#SECTION01">Introduction</a></li>
  <li><a href="#SECTION02">The options</a></li>
  <li><a href="#SECTION03">Math-mode environments</a>
    <ul>
      <li><a href="#SECTION03a">The <tt>Equation</tt> environment</a></li>
      <li><a href="#SECTION03b">The <tt>MultiLine</tt> equation environment</a></li>
      <li><a href="#SECTION03c">The <tt>System</tt> environment</a></li>
      <li><a href="#SECTION03d">The <tt>EqSystem</tt> environment</a></li>
    </ul></li>
  <li><a href="#SECTION04">Math-mode commands</a></li>
</ul>

<hr /><br />
<!------------------------------------------------------------------------>

<h2>
<a name="SECTION01">Introduction</a>
</h2>

<p>
This package provides some useful math-commands and enviroments, which
are simpler to use and prettier then their standard LaTeX counterpart.
</p>

<p>
In particular some commands are redefined
(see <a href="#SECTION02">next section</a> if you don't want them to be
redefined), so care should be taken, expecially when including this package
in an already existent LaTeX file.

<p>
The <a href="#SECTION04">redefined commands</a> are:<br />
<tt>\(</tt>, <tt>\)</tt>,
<tt>\[</tt>, <tt>\]</tt>,
<tt>\{</tt> and <tt>\}</tt>.<br />
The effect of ``<tt>\(</tt> ...<tt>\)</tt>'' can still be achieved by
the LaTeX equivalent commands ``<tt>\begin{math} ... \end{math}</tt>''
or ``<tt>$...$</tt>''.
</p>

<p>
Similarly, the effect of ``<tt>\[...\]</tt>'' can be achieved by the
LaTeX equivalent commands
``<tt>\begin{displaymath}...\end{displaymath}</tt>'' or
``<tt>$$...$$</tt>''.
</p>

<p>
The ``<tt>\{</tt>'' and ``<tt>\}</tt>'' commands are the more
error-prone, since one may try to use ``<tt>\left\{</tt>'', which now
is incorrect, because the ``<tt>\{</tt>'' command already contains a
``<tt>\left</tt>'' declaration.
In the rare occasions where a brace of normal size is needed, one can use
the LaTeX commands ``<tt>\lbrace</tt>'' and ``<tt>\rbrace</tt>''.
</p>

<p>
Also the <a href="#SECTION03a">``<tt>equation</tt>'' environment</a> has been
changed, but it is completly compatible with the original definition, so it
should be safe, perhaps except when the first character of the equation	is
an open square bracket or it is placed in a moving argument:
in fact, the new version of this command is fragile, and this is true also
for most of the commands defined by this package.
</p>

<hr /><br />
<!------------------------------------------------------------------------>

<h2>
<a name="SECTION02">The options</a>
</h2>

<p>
At now, five options are available with the <tt>envmath</tt> package.
</p>

<p>
The ``<tt>RedefEquation</tt>''/``<tt>StdEquation</tt>'' and
``<tt>RedefBrackets</tt>''/``<tt>StdBrackets</tt>'' options control
whether the ``<tt>equation</tt>'' environment and the brace commands
``<tt>\(</tt>'', ``<tt>\)</tt>'', ``<tt>\[</tt>'',
``<tt>\]</tt>'', ``<tt>\{</tt>'' and ``<tt>\}</tt>'' should
be redefined or retain their original LaTeX meaning.
</p>

<p>
More precisely, ``<tt>RedefEquation</tt>'' (default) redefines the
``equation'' environment to have an optional argument (used as a label),
while ``<tt>StdEquation</tt>'' leaves it unchanged.
In the first case, the ``equation'' environment will be equivalent to the
<a href="#SECTION03a">``Equation'' environment</a> (capitalized!) described
below, whereas in the second case they will be different.
</p>

<p>
Similarly, the ``<tt>RedefBrackets</tt>'' option (default) makes the
<a href="#SECTION04"> bracket commands</a> to be redefined, whilst
``<tt>StdBrackets</tt>'' leave them their original meaning.
</p>

<p>
Also a ``<tt>Standard</tt>'' option exists, which amounts to specify both
the ``<tt>StdEquation</tt>'' and ``<tt>StdBrackets</tt>'' options, thus making
the package fully standard, which may be useful when sending your
LaTeX files to someone else.
</p>

<hr /><br />
<!------------------------------------------------------------------------>

<h2>
<a name="SECTION03">Math-mode environments</a>
</h2>

<p>
This package provides some math-mode environments, each with a ``*-form''
which does not generates numbers (or produce sub-numbering).
</p>

<hr /><br />
<!------------------------------------------------------------------------>

<h3>
<a name="SECTION03a">The <tt>Equation</tt> environment</a>
</h3>

<p>
The ``<tt>Equation</tt>'' environment has an optional argument which is used
as a label to reference it.
<pre>
		\begin{Equation}[&lt;label&gt;]
		        ...
		\end{Equation}
</pre>
</p>

<p>
If the ``<tt>RedefEquation</tt>'' option is in effect (default), then
the ``<tt>equation</tt>'' environment is redefined to have the same optional
argument as ``<tt>Equation</tt>''.
</p>

<p>
There is also a *-form, which does not generate a number (so this *-form is
really a ``displaymath'' and not an equation, but it has been added for
simmetry and for making it easier to add or remove the number to a formula).
</p>

<p>
The *-form has an optional argument like the non-* form, which is
disregarded by the environment and is added only for simmetry reasons.
<pre>
		\begin{equation*}[&lt;disregarded-label&gt;]
		        ...
		\end{equation*}
</pre>
</p>

<hr /><br />
<!------------------------------------------------------------------------>

<h3>
<a name="SECTION03b">The <tt>MultiLine</tt> equation environment</a>
</h3>

<p>
The ``<tt>MultiLine</tt>'' environment is intended for formulas that don't
fit on a single line, and so must be broken across lines.
</p>

<p>
As for the <a href="#SECTION03a"><tt>Equation</tt> environment</a> above,
it has an optional argument which is used as a label.
</p>

<p>
All the lines but the first are automatically indented by the lenght
``<tt>\MultiLineIndent</tt>'', which is rougthly what one expects, but
can be changed at any time by the user with
``<tt>\setlenght\MultiLineIndent{...}</tt>''.
You can also control the alignment of the continuation rows by placing an
optional <tt>&amp;</tt> in the first row: is such a case all the others line
will <em>not</em> be indented by ``<tt>\MultiLineIndent</tt>'' but wil behave
<em>as if</em> there were an ampersand in front of them (i.e. they will be
left-aligned at the right of the &amp; in the first row).
</p>

<p>
Each line but the last must end with a ``<tt>\\</tt>'' command
(which can have an optional argument to add some vertical space between
lines).
When the line is broken in the middle (e.g. after a ``+'' sign) and not at
the end (i.e. after a ``='' or similar), the *-form ``<tt>\\*</tt>''
may be used to indicate the line-break, the difference being in an extra
space added at the beginning of	the next line.
The width of a this space defaults to 1em and can be changed by the user
with ``<tt>\setlenght\MultiLineStarIndent{...}</tt>''.
</p>

<p>
<pre>
		\begin{MultiLine}[&lt;label&gt;]
		      ... [&amp;]= ... =   \\
	        	     = ... +   \\*
		               + ... = \\
		             = ...
		\end{MultiLine}
</pre>
</p>

<p>
Also this environment has a *-form which differs only in that it does not
generate an equation number.
<pre>
		\begin{MultiLine*}[&lt;disregarded-label&gt;]
		      ... [&amp;]= ... =   \\
	        	     = ... +   \\*
		               + ... = \\
		             = ...
		\end{MultiLine*}
</pre>
</p>

<hr /><br />
<!------------------------------------------------------------------------>

<h3>
<a name="SECTION03c">The <tt>System</tt> environment</a>
</h3>

<p>
The ``<tt>System</tt>'' environment is used for grouping a set of equations
together inside a left brace, with one only equation number.
</p>

<p>
Again there is an optional argument to indicate a label and each equation
is separated by a ``<tt>\\</tt>'' or ``<tt>\\*</tt>'' command,
as for the <a href="#SECTION03b">``<tt>MultiLine</tt>'' environment</a>.
</p>

<p>
The rows (except the ones ended with the *-form ``<tt>\\*</tt>'')
may optionally contain one ``<tt>&amp;</tt>'', which is usually used when
some text should be added to the equation.
<pre>
		\begin{System}[&lt;label&gt;]
		    ... = ...   [&amp; ...] \\
		    ... = ... +         \\*
		      + ...     [&amp; ...] \\
		    ... = ...   [&amp; ...]
		\end{System}
</pre>
</p>

<p>
A *-form which does not generate any number is also provided.
<pre>
		\begin{System*}[&lt;disregarded-label&gt;]
		    ... = ...   [&amp; ...] \\
		    ... = ... +         \\*
		      + ...     [&amp; ...] \\
		    ... = ...   [&amp; ...]
		\end{System*}
</pre>
</p>

<hr /><br />
<!------------------------------------------------------------------------>

<h3>
<a name="SECTION03d">The <tt>EqSystem</tt> environment</a>
</h3>

<p>
The ``<tt>EqSystem</tt>'' environment is used for grouping a set of equations
together inside a left brace, each with its own equation number.
</p>

<p>
Again there is an optional argument to indicate a label and each equation is
separated by a ``<tt>\\</tt>'' or ``<tt>\\*</tt>'' command.
</p>

<p>
The rows may optionally contain one ``<tt>&amp;</tt>'', which is usually	used
when some text should be added to the equation.
<pre>
		\begin{EqSystem}[&lt;label&gt;]
		    ... = ...   [&amp; ...] \\    % (1.1)
		    ... = ... +         \\*   %
		      + ...     [&amp; ...] \\    % (1.2)
		    ... = ...   [&amp; ...]       % (1.3)
		\end{EqSystem}
</pre>
</p>

<p>
A *-form is also provided: it differs in that each equation is numbered with
the same number but with a lowercase letter added, i.e. like (1.1a), (1.1b),
etc. instead of (1.1), (1.2) and so on.
<pre>
		\begin{EqSystem*}[&lt;label&gt;]
		    ... = ...   [&amp; ...] \\   % (1.5a)
		    ... = ... +         \\*  %
		      + ...     [&amp; ...] \\   % (1.5b)
		    ... = ...   [&amp; ...]      % (1.5c)
		\end{EqSystem*}
</pre>
In both cases, if the optional argument is present, each equation can be
referenced by <tt>\ref{&lt;label&gt;:a}</tt>,
<tt>\ref{&lt;label&gt;:b}</tt>, ..., where <tt>&lt;label&gt;</tt>,
stands for the string used as optional argument.
In the case of the *-form, a reference of the kind
<tt>\ref{&lt;label&gt;}</tt> will print the equation number without
any letter, thus referring to the system as a whole, whereas such a
reference is meaningless (and indeed does not exists) when dealing with
the non *-form.
</p>

<hr /><br />
<!------------------------------------------------------------------------>

<h2>
<a name="SECTION04">Math-mode commands</a>
</h2>

<p>
In addition to the previously mentioned environments, the <tt>envmath</tt>
package defines also some of math-mode commands which considerably simplify
the use of adjustable-size parentheses.
</p>

<p>
The ``<tt>\(</tt>'', ``<tt>\[</tt>'', ``<tt>\{</tt>'',
``<tt>\)</tt>'', ``<tt>\]</tt>'' and ``<tt>\}</tt>'' generates
the corresponding parenthesis but with a ``<tt>\left</tt>'' or
``<tt>\right</tt>'' declaration (respectively) added, so they must come
in matched pairs or coupled with a ``<tt>\left.</tt>'' or
``<tt>\rigtht.</tt>'' or another adjustable-size delimiter.
</p>

<hr /><br />
<!------------------------------------------------------------------------>

<address>
  <i>F. Bosisio</i><br />
  E-mail: <a href="mailto:fbosisio@bigfoot.com"><tt>fbosisio@bigfoot.com</tt></a>
</address>

<!------------------------------------------------------------------------>

</body>
</html>