[l2h] Format of array of formulae

Ross Moore ross at ics.mq.edu.au
Mon Nov 20 22:05:03 CET 2006


Hello Algis,

On 20/11/2006, at 9:31 PM, Algis Kabaila wrote:

> Hello Ross and Mailing List Friends,
>
> In latex2html output is very different for entries in an "eqnarray"  
> and
> "equation".  The "equation" markup causes more or less central  
> placement of
> the formula, whilst the "eqnarray" more or less right-justifies it.
>
> I take the liberty to attach a small tex file of data which, when  
> processed,
> shows the differences very clearly.  I hope I will be forgiven for  
> sending an
> attachment.  Generally attachments are a "no-no" in mailing lists,  
> but this
> is such a small file = 1.3 KB.

I'm sorry, but you are quite wrong here.

\begin{eqnarray}
\label{eq:2}
\bar P_{1} = - \bar P_{4} \\
\bar P_{2} = - \bar P_{5}
\end{eqnarray}

The {eqnarray} environment is (almost) equivalent inLaTeX
to an array, specified via:   {array}{rcl}
However, you are not *required* to use all 3 columns.

Try the effect (in typeset LaTeX) of something like:

\begin{eqnarray}
\label{eq:2}
\bar P_{1111} = - \bar P_{4} \\
\bar P_{2} = - \bar P_{555555}
\end{eqnarray}

--- your alignment will be quite skew.


Your example is better written as:

\begin{eqnarray}
\label{eq:2}
&&\bar P_{1} = - \bar P_{4} \\
&&\bar P_{2} = - \bar P_{5}
\end{eqnarray}

to get left-alignment, or as

\begin{eqnarray}
\label{eq:2}
\bar P_{1} &=& - \bar P_{4} \\
\bar P_{2} &=& - \bar P_{5}
\end{eqnarray}

to align around the "=" signs.

Alternatively, \usepackage{amsmath}  and then use:

\begin{align}
\label{eq:2}
&\bar P_{1} = - \bar P_{4} \\
&\bar P_{2} = - \bar P_{5}
\end{align}

or

\begin{align}
\label{eq:2}
\bar P_{1} &= - \bar P_{4} \\
\bar P_{2} &= - \bar P_{5}
\end{align}


The other little-appreciated aspect of {eqnarray} is that
the math-style of the 3 columns is not all the same.
Rather it is  {DTD}  where D = \displaystyle  T=\textstyle .

e.g.  try the effect of:

\begin{eqnarray}
\label{eq:2}
\frac12\bar P_{1} &+\frac12 =& - \frac12\bar P_{4} \\
\frac12\bar P_{2} &- \frac12 =& - \frac12\bar P_{5}
\end{eqnarray}

This can have an effect on how you code with {eqnarray}.

Personally, many of my mathematician friends who need to
do a lot of LaTeX coding feel that it is generally better
to use the {amsmath} environments.
LaTeX2HTML handles these quite well too.


>
> Looking at the html source, it would seem to me that a replacement  
> of "RIGHT"
> spec in a couple of places by "middle" would make the output much more
> consistent.  This is the listing of the modified html source snippet:

These changes would cause far more complications and damage to correct
usage of  {eqnarray}  than would be fixed by them in cases such as
yours where you have many alternative choices in the LaTeX source.


>
> <TABLE CELLPADDING="0" ALIGN="CENTER" WIDTH="100%">
> <TR VALIGN="MIDDLE"><TD NOWRAP ALIGN="middle"><IMG
>  WIDTH="72" HEIGHT="33" ALIGN="MIDDLE" BORDER="0"
>  SRC="img1.png"
>  ALT="$\displaystyle \bar P_{1} = - \bar P_{4}$"></TD>
> <TD>&nbsp;</TD>
> <TD>&nbsp;</TD>
> <TD WIDTH=10 ALIGN="RIGHT">
> (2)</TD></TR>
> <TR VALIGN="MIDDLE"><TD NOWRAP ALIGN="middle"><IMG
>  WIDTH="72" HEIGHT="33" ALIGN="MIDDLE" BORDER="0"
>  SRC="img2.png"
>  ALT="$\displaystyle \bar P_{2} = - \bar P_{5}$"></TD>
>
> The "RIGHT" replacements by "middle" are made in lower case to  
> indicate what I
> would change as a "quick fix".  But not by hand...
>
> Ross, thank you for your patience.  A person who some 25-30 years  
> ago attended
> some of my lectures read my manuscript, translated by latex2html,  
> and in the
> two pages of comments, complained about my inconsistent formatting of
> equation arrays with respect to other equations.  I think he  
> underestimated
> the automated nature of LaTeX formatting!
>
> Kind regards,
>
> Al.
> -- 
> Algis Kabaila (Dr)
> http://www.pcug.org.au/~akabaila/StructuralAnalysis/
> <DemoOfFormulae.tex>


Hope this helps,

	Ross Moore

------------------------------------------------------------------------
Ross Moore                                         ross at maths.mq.edu.au
Mathematics Department                             office: E7A-419
Macquarie University                               tel: +61 +2 9850 8955
Sydney, Australia  2109                            fax: +61 +2 9850 8114
------------------------------------------------------------------------




More information about the latex2html mailing list