Welcome to the deleq package!

This is a short document to demonstrate the use of the deleq package and its commands. It uses deleq version 4.41 (July 7, 1997). deleq was written by Mats Dahlgren (matsd@physchem.kth.se). Suggestions for improvements and bug reports are most welcome, see the documentation. deleq is fully compatible with the leqno option and most of the fleqn option.

We start this demonstration by a simple and well-known equation to get the equation number counter going:

sin^{2} α + cos^{2} α = 1  (1)

The first example will be to make use of the deqn environment to get a partially numbered equation:

sin(−α) = − sin α  (2a)

This equation has its cosine companion, here written in the ddeqn environment:

cos(−α) = cos α  (2b)

Not so exciting, so far. :–)

In the next example we introduce the deqarr environment for writing equations:

sin(α + β) = sin α cos β + sin β cos α  (3a)
sin(α − β) = sin α cos β − sin β cos α  (3b)

where we also have put in the label Demo1 in the second equation. Next, notice how the environment ddeqar uses the same main equation number as the previous equations:

cos(α + β) = cos α cos β − sin α sin β  (3c)
cos(α − β) = cos α cos β + sin α sin β  (3d)

In the first of these equations, an \arrlabel command with the label Demo2 is included. Now, we will make another eqnarray-like structure, again in the ddeqar environment:

sin 2α = 2 sin α cos α  (4)
cos 2α = cos^{2} α − sin^{2} α  (5a)

or

= 2 cos^{2} α − 1  (5b)

This example shows the use of \heqno in the first equation, which produces an ordinary equation number. The first equation is also labelled, with the label Demo3. The next equation’s number was produced by the command \nydeqno. Also, notice the use of \rem{or}, which results in the text “or” without changing the alignment. To illustrate the use of \arrlabel{Demo2} above, we here make a reference to it: … in equations 3 … which was

created by typing ‘\ldots{} in equations \ref{Demo2} \ldots’.

To step the equation number counter, we want the following equations typeset in ordinary eqnarray environment:

tan^{2} α = \frac{sin^{2} α}{cos^{2} α}  (6)
tan α = \frac{sin α}{cos α}  (7)

The upper equation was given the label Demo4.

Now one of the “recycling” commands is to be demonstrated. First of all, let’s make an ordinary reference to equation 4, and then “recycle” it:

sin 2α = 2 sin α cos α  (4)

This was obtained with $$ ... $$ with the command \reqno{Demo3} at the end. Also partially numbered equations can be recycled with the \reqno{FOO} command, as with equation 3b:

sin(α − β) = sin α cos β − sin β cos α  (3b)

(However, the use of \rndeqno{FOO} and \rdeqno{FOO} will produce strange results with two (different) partial equation numbers if FOO refers to a partially numbered equation.)

The next equation was written with $$ ... $$ and a \deleqno command at the end:

tan 2α = \frac{2 tan α}{1 − tan^{2} α}  (7a)

Notice how the main equation number counter is still the same, despite that we now are outside of the ddeqar environment. Also, notice how the use of \reqno above did not affect the equation number counter. The following equation is also set within $$ ... $$, but it uses the command \nydeleqno to produce an equation number with a new main number:

sin^{2} α = 1 − cos^{2} α  (8a)

Now we will elaborate a little on \rndeqno{FOO} and \rdeqno{FOO}. Let us use equation 6, and see what happens if we use the \rndeqno{FOO} command:

tan^{2} α = \frac{sin^{2} α}{cos^{2} α}  (6a)

which we rewrite:

tan^{2} α = \frac{sin^{2} α}{1 − sin^{2} α}  (6b)

with \rdeqno{Demo4} at the end. This is great fun, so why not one more:

tan^{2} α = \frac{1 − cos^{2} α}{cos^{2} α}  (6c)

Also, the middle form of equation 6 got a label, Demo5. In the last example, the construct

  \ddeqreqno[-\jotbaseline]{Demo4}   \nonumber

in a deqrarr environment is used, to obtain fleqn compatibility.

There is still one equation to write. This time we again use the deqarr environment:

cot α = \frac{cos α}{sin α}  (9a)

where

= \frac{1}{tan α}  (9b)

This example also shows the use of the \where command, which is a special case of the \rem command. Now, the interesting thing of referring to the recycled equations is ahead. If one writes \ref{Demo5}, this is what L^{A}TEX will return: b. That is not too instructive, since the partial equation numbers are quite common in this document. To make the complete reference, use \ref{Demo4}\ref{Demo5}. The reference 6b is much more comprehensible, right? (If you get bad line-breaks at such references, put them in an \mbox{...}.)

Now we will show the use of the commands to recycle equation numbers in eqnarray-like

structures. These commands are \eqreqno{FOO}, \deqreqno{FOO}, and \ddeqreqno{FOO}.

We start by repeating equation 3b in an deqrarr environment:

sin(α − β) = sin α cos β − sin β cos α  (3b)
sin 2α = 2 sin α cos α

The second equation here shows how the alignment of the equations is preserved. Next, we can use the equation 4 for some variations:

sin 2α = 2 sin α cos α  (4a)
sin 4α = 2 sin 2α cos 2α
= 2 (2 sin α cos α (cos^{2} α − sin^{2} α))  (4b)
= 4 (sin α cos α (cos^{2} α − sin^{2} α))  (4c)

The features used here are \deqreqno{Demo3} on the first line, \ddeqreqno{Demo3} on the second line, and \deqreqno[-\jotbaseline]{Demo3} on the third. Note how the inclusion of [-\jotbaseline] on the third line prevents L^{A}TEX from inserting an extra blank line. The second line ends with ‘\\’, and has thus no equation number at all.

The last part shows how you may use \eqreqno and its relatives in deqarr environment:

sin α = sin α cos 0 + sin 0 cos α  (10a)
sin 2α = 2 sin α cos α  (4)
sin 3α = sin 2α cos α + sin α cos 2α  (10b)
sin 4α = 2 sin 2α cos 2α  (10c)
sin 5α = sin 3α cos 2α + sin 2α cos 3α  (4d)
sin 6α = 2 sin 3α cos 3α  (10d)

The interesting part here is an ‘\eqreqno{Demo3}’ at the end of the second line and a ‘\ddeqreqno{Demo3}’ at the end of the fifth line. Notice how the partial equation number counter in unaffected by the enetering of the deqarr environment.

Finally, the EN D! If you want your equation numbers left-aligned, just specify the leqno option for the documentclass you are using. It should work! If you have any suggestions, corrections or contributions, please contact me. Enjoy L^{A}TEX!

mats d.