[l2h] problems with alignment environment

Ross Moore ross at ics.mq.edu.au
Sun Nov 2 02:26:18 CET 2003


Hello William,


On Tue, 28 Oct 2003, William Martin wrote:

> I am having problems with alignment in the following latex section:
>
> %\input{intro}
> \begin{align}
> \hat \nu(\cdot) =&\frac 1k \sum_{i=1}^n
> \epsilon_{\frac{\bZ_i }{\hat b(n/k)} }\label{defHatNu}\\
> \hat S_1(\cdot)=&\frac{ \hat \nu \{\bx:\|\bx\| >1,\arctan
> \frac{x^{(2)} }{x^{(1)} } \in \cdot \}}
> {\hat \nu \{\bx:\|\bx\|>1\}}\nonumber\\
> =& \frac{ \sum_{i=1}^n 1_{[\|\bZ_i\|/\hat b(n/k) >1]}
> \epsilon_{\Theta_i}(\cdot) } {\sum_{i=1}^n 1_{[\|\bZ_i\|/\hat
> b(n/k) >1]}
> }\label{defHatS}\\
> \intertext{where $\Theta_i=\arctan
> \bigl(Z_i^{(2)}/Z_i^{(1)}\bigr)$. Also define} \hat
> v=&\int_0^{\pi/2} (\theta -\pi/4)^2 \hat S_1 (d\theta)
> \nonumber\\
> =&\frac{
>   \sum_{i=1}^n 1_{[\|\bZ_i\|/\hat b(n/k) >1]}(\Theta_i -\pi/4)^2
> } {\sum_{i=1}^n 1_{[\|\bZ_i\|/\hat b(n/k) >1]} }\label{defHatv}
> \intertext{and} \hat \rho =&1-\frac{\hat
> v}{(\pi/4)^2}.\label{defHatrho}
> \end{align}
> \end{document}

That is a very complicated alignment, with your inclusion of
*two* \intertext portions --- each of which contains more mathematics!
I'm pretty sure it was not the intention of the AMS LaTeX programmers
for an {align} environment to be used in this way.

Logically, you have a single paragraph, with several sentences, containing
two separate pieces of aligned mathematics. This is the kind of thing that
LaTeX2HTML expects, and it would do a good job if your manuscript was
marked-up in that way.

If you stick to simple, clear, logical markup then LaTeX2HTML will do
a good job. If you obscure your markup, then some aspects of the
translation may fail, or you may get HTML coding that is not the most
desirable for the information that you are wishing to present.


So my first piece of advice is to *simplify* your coding.

e.g.
 Do *not* try to be cute by having some environments align with
others --- that's a layout issue, rather that a logical structure
issue; besides, the journal editor may not like that effect,
which may not even work properly anyway (e.g. in multiple-columns).


Secondly, if you are going to ignore the above advice, (as you are
entitled to do), then at least follow very closely to printed
examples that create the effects you desire...

>
> The last "=&1-\frac{\hat v}{(\pi/4)^2}" part is not aligned on the
> '=' as the other sections of the are.

  ... by including \\  to end the alignment row before the \intertext
command. (You do this in the first instance, but not the second.)

This should give a result like what you can see at:
  http://www-texdev.ics.mq.edu.au/MARTIN/aligntest/

In LaTeX, the spacing is unaffected:

  http://www-texdev.ics.mq.edu.au/MARTIN/aligntest.pdf

(In this PDF you can see also many other subtle differences from your
coding, which contribute to making the complicated mathematical
expressions easier to read and understand.
For the source that I used, get  aligntest.tex  in the same directory.)



> $HTML_VERSION = '3.2,math';
>
> in the l2hinit file.
>
> This latex file renders properly under Miktex.

LaTeX (via MikTeX) is building up an image of a page for itself.
LaTeX2HTML is trying to encode the structure of your information
to present in a logical way to (many different) web-browsers, so that
they can build their own idea of how the page should appear.

That is a quite different problem, which in some senses is more
difficult. The hints as to the logical structure must come from the
markup commands that you use in the LaTeX source of your document.
If you use convoluted LaTeX coding constructions, then you are less
likely to get the result that you think you want.

>
> Thank you.


Hope this helps,

	Ross moore


>
> -- Bill --
>
> _______________________________________________
> latex2html mailing list
> latex2html at tug.org
> http://tug.org/mailman/listinfo/latex2html
>


More information about the latex2html mailing list