Re: [l2h] problems with alignment environment

2003-11-01 Thread Ross Moore

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
 [EMAIL PROTECTED]
 http://tug.org/mailman/listinfo/latex2html

___
latex2html mailing list
[EMAIL PROTECTED]
http://tug.org/mailman/listinfo/latex2html


Re: [l2h] tableofcontents UL type

2003-11-01 Thread Ross Moore

Hello Peter,

On Tue, 28 Oct 2003, Peter Morling wrote:

 Hi,

 when l2h produces the table of contents its done with the HTML UL tags. That
 will produce a list as in the example shown in the following:

 ---example
 Table of Contents
   a.. 1.1 What is Chemometrics?
 a.. 1.1.1 Chemometrics: an example
 b.. 1.1.2 Chemometrics data matrices
 c.. 1.1.3 Calibration and test problems
 ---end example


 Is there a way to avoid the discs (bullets) in front of each line of the toc
 ?? I can think of one way: to post-process my html-document using a
 perl-script and modify the toc UL's using a CSS class. But is there a easier
 way?

That certainly should work.
It's easiest if you have  $USE_STYLES set (automatic with HTML 4.0 and
later, but this is not set with the standard default of HTML 3.2),
for the laTeX2HTML inserts the attribute:CLASS=ChildLinks
as has been mentioned already on this list.
Post-processing to search for this string and extend it:
 e.g. to   CLASS=ChildLinks TYPE=square
should be quite easy to do.
You could even add a line of Perl coding to an initialisation file,
defining:   sub post_post_process
to do a regular-expression search and replace.
This will then cause LaTeX2HTML to do the post-processing for you.


Alternatively, you could have LaTeX2HTML use a different set of
attributes from the outset. For this you will need to know that
the coding that controls this is within the subroutine:
add_real_child_links
within the main  latex2html  script.
You should be able to find the lines:

$list_class = ' CLASS=ChildLinks' if ($USING_STYLES);

$startlist = UL$list_class unless $CHILD_NOLIST;

You could then simply alter the first line to read something like:
   $list_class = ' CLASS=ChildLinks TYPE=square';

If you do this, then you should copy the *entire* subroutine block
 sub add_real_child_links { . }
into an initialisation file and make the changes there.



 Best,

Hope this helps,

Ross Moore


 Peter





 Programmer Peter Morling, University of Southern Denmark
 Department of Statistics, Sdr. Boulevard 23A, DK-5000 Odense C
 Phone (+45) 6550 3399

 ___
 latex2html mailing list
 [EMAIL PROTECTED]
 http://tug.org/mailman/listinfo/latex2html

___
latex2html mailing list
[EMAIL PROTECTED]
http://tug.org/mailman/listinfo/latex2html


Re: [l2h] problems with alignment environment

2003-11-01 Thread Ross Moore

Hi again Bill,

On Sat, 1 Nov 2003, William Martin wrote:

 I have been reading the Latex Web Companion very closely.  I haven't
 quite figured out out to use CSS styles, but I am really close.  Is this
 valid?:

 \documentclass{article}
 \usepackage{html}
 \htmlsetstyle[junk]{UL}{list-style-type=square;
 list-style-image=url(http://www.orie.cornell.edu/redcircle.jpg)}

OK; I was intending to answer this question, that you posted
earlier --- last week, wasn't it ?
So this message is going to the latex2html email list too.



There are several problems here.

Firstly, the syntax is:

  \htmlsetstyle[UL]{junk}{list-style-type=square;

as the CLASS is 'junk' which need not qualify anything,
though in this case you want it for  UL.junk .

That will write the rule into the .css file...


Secondly.

  ... *provided* you delete or rename the existing one.

That is, you must *force* LaTeX2HTML to write out the information.
If a CSS file of the correct name already exists, then a new one is
*not* created. This is a rather crude way of not writing .css files
which generally do not change often.



Thirdly,


 \begin{document}
 \begin[junk.UL]{itemize}

this should be  \begin[junk]{itemize}
as the UL is implicit in the kind of environment being processed.

However, for some reason the  'CLASS=junk' isn't being
applied to the list tagging in the HTML output.
I'll need to diagnose why not.


Fourthly,

This will not write to .css properly:

 list-style-image=url(http://www.orie.cornell.edu/redcircle.jpg)}
   ^
since the ':' is interpreted as a delimiter of CSS properties.

I guess the correct logic is to treat the '(' and ')' as delimiters
that bind more tightly, cancelling the special interpretation of ':'.
This means adding a line of Perl coding to the subroutine:
  sub  process_htmlstyles .
to revert some replacements  ( ':' -- ' : ' ) made earlier,
or to rethink this processing altogether.


 \item item1
 \item item2
 \item item3
 \end{itemize}

 \end{document}

 The resulting UL stuff does not contain any tag information.


Thanks for the reports.
Clearly more work is needed to make use of CSS styles more robust.


Cheers

Ross



 Thank you,

 -- Bill --

 On Sun, Nov 02, 2003 at 01:50:55PM +1100, Ross Moore wrote:
 
  Hello William,
 
  On Sat, 1 Nov 2003, William Martin wrote:
 
   Thank you for your input.  I will pass your comments along to the
   author of the paper that this Latex code is from.  Latex2html did much
   better with the remainder of the paper.
  
   The Windows version of Latex2html strips out commas from the command
   line, so something like latex2html -html_version
   4.0,latin1,unicode,utf8 does not work, though I can set the options
   in the init file.  One interesting observation was that if I specify
 
  I never use windows for this kind of work; its special requirements
  are usually handled by others, sorry.
  However, the init file mechanism allows full customisation anyway.
 
 
   an invalid -html option, I get an error message, but Latex2html
   renders equation I sent you properly, though as one large image file.
 
  Yes; the requested level of HTML output affects what LaTeX2HTML produces,
  so as to conform with the published W3C recommendations.
  With lots of mathematics, including aligned environments, it's often
  best to use larger images rather than lots of smaller images.
 
  The LaTeX Web Companion (Addison-Wesley, CSE series) has a whole chapter
  devoted to LaTeX2HTML and all of its output options, especially for
  mathematics.
 
 
  
   In http://www-texdev.ics.mq.edu.au/MARTIN/aligntest/
   http://www-texdev.ics.mq.edu.au/MARTIN/aligntest.pdf, the equation
   label are on different sides of the page.  Is this a settable option?
 
  It's a package option to AMS styles and document classes:
 
  landau.ics.mq.edu.au grep eqn `kpsewhich amsmath.sty`
  [EMAIL PROTECTED]
  [EMAIL PROTECTED]
 
  landau.ics.mq.edu.au grep eqn `kpsewhich amsart.cls`
  \DeclareOption{leqno}{%
[EMAIL PROTECTED] \PassOptionsToPackage{leqno}{amsmath}}
  \DeclareOption{reqno}{%
[EMAIL PROTECTED] \PassOptionsToPackage{reqno}{amsmath}}
 
  e.g.
   \documentclass[reqno]{amsart}
   \usepackage{amsmath}
 
  is the same as
 
\documentclass{amsart}
\usepackage[reqno]{amsmath}
 
  In the first case, the \usepackage{amsmath}  may even be redundant.
 
 
  LaTeX2HTML defaults to having the tags on the right, as this
  seems to be the most commmon practice. However, it *does* recognise
  the options, if you provide them explicitly.
 
  
   Thank you for your help.
  
 
  You're welcome,
 
  Ross Moore
 
 
   -- Bill Martin --
  
  

 --
 ===
 William T. Martin email:  [EMAIL PROTECTED]
 Cornell University/ORIE   Fax:(607) 255-9129
 257 Rhodes Hall   Phone:  (607) 255-9134
 Ithaca, NY 14853
 Public Key: