[l2h] Format of array of formulae

Algis Kabaila akabaila at pcug.org.au
Mon Nov 20 23:35:27 CET 2006


Hello Ross,

Thank you very much for the reply and the promptness of - it  never ceases to 
amaze me how people like you find the time to give an instantaneous and 
valuable lesson! 

I have n "computer old timers' " (PCUG SIG) meeting this morning and will come 
back to you and the list asp. Just wanted to promptly say thank you!

Algis.

On Tuesday 21 November 2006 08:05, Ross Moore wrote:
> 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
> ------------------------------------------------------------------------
>
>
> _______________________________________________
> latex2html mailing list
> latex2html at tug.org
> http://tug.org/mailman/listinfo/latex2html

-- 
Algis Kabaila (Dr)
http://www.pcug.org.au/~akabaila/StructuralAnalysis/


More information about the latex2html mailing list