[l2h] Format of array of formulae

Algis Kabaila akabaila at pcug.org.au
Tue Nov 21 11:39:47 CET 2006


Hello Ross,

On Tuesday 21 November 2006 08:05, Ross Moore wrote:
> Hello Algis,
>
(snip...)
> > 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.
>

You need not apologise - I am used to be wrong.  And I do try to learn from my 
mistakes..

I must say that this is the first time ever that I started using LaTeX, so I 
am quite ignorant of many finer aspects.  My aim is to get an acceptable 
format in both pdf version, obtained straight from my latex client "Kile" as 
well as in html format, obtained, again preferably from "Kile" invoking 
latex2html, and acceptable html presentation.

So it would be easiest for me to simply modify the tex source to get a better 
alignment of equations. Not necessarily perfect, but better.  I already use 
the {amsmath} package and feel no attachment to {eqnarray}.  I did use it 
rather blindly, as it gave me perfect alignment in the display after 
compiling it with LaTeX.  It also gave a perfect alignment when compiled into 
the pdf format.

I find it curious that all the formats that you have kindly shown in your 
email are equally well displayed in the pdf format - they all centre-align 
near perfectly.

I am quite happy to change to \begin{align} markup.  Again, I should make a 
visit to Uni Coop bookshop here in ANU and see if I can get hold of a decent 
LaTeX text book.

> \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}
>
Actually, in the text it would seem that the best alignment (that is most 
closely related alignment to the single equation) is by the following markup:
> \begin{align}
> \label{eq:2}
> \bar P_{1} = &- \bar P_{4} \\
> \bar P_{2} = &- \bar P_{5}
> \end{align}
>
Unfortunately for me, I am doing this rather blindly as I do not understand 
the {align} markup at all.   And I did not understand the {eqnarray} either - 
just used it as it looked good in the output on the screen that is pretty 
well identical to pdf.  

I have not as yet experimented with Shigeru Takeno's suggestions as they 
require more substantial departure from my manuscript writing method. In 
fact, I must return to the writing itself.  After all, that is my primary 
purpose in all of this.

Thank you for the really detailed explanation. All great stuff!  
>
> 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

OldAl in sweltering Canberra - concerned about the coming bush fire season.
-- 
Algis Kabaila (Dr)
http://www.pcug.org.au/~akabaila/StructuralAnalysis/


More information about the latex2html mailing list