Thanks, Professor Ross Moore, for kindly writing to me on the mechanisms for the production and elimination of cropping bars. And thanks for mentioning the program MathJax to me. In an online form I wrote to someone involved with MathJax with some questions for him or her to see if MathJax can be used for the applications of printing mathematics onto paper and what amounts to sending an e-mail letter body with the .html file containing mathematics pasted onto it with the images in that letter as attachments to it.--Those two activities have been my primary end uses so far of the programs LaTeX for printing and LaTeX2HTML with the images as attachments to the e-mail letter. It is good that MathJax can handle LaTeX commands and uses open-source code; therefore I assume it would be provided free of charge. Also I think it is very honorable of you, since you have worked so much on the program LaTeX2HTML, to mention and suggest another program MathJax which performs the similar basic function, although in a somewhat different way, of making mathematical symbols capable of being displayed on Web pages. Some people might even consider that surprising. But I think it speaks well of you, Professor Moore. And thanks for your contributions to LaTeX2HTML, which has been a useful, free program for me! Thanks for your kindly provided help, Professor Moore!

Pat

--------------------------------------------------
From: "Ross Moore" <ross.mo...@mq.edu.au>
Sent: Friday, April 15, 2011 2:24 AM
To: "Pat Somerville" <l_pa...@hotmail.com>
Cc: "Latex2Hmtl list" <latex2html@tug.org>
Subject: Re: [l2h] Black bars under integral signs when thelimitsof integration are -\infty and +\infty or analgebraicfraction for each of the upper and lower limits

Hello Pat,

On 15/04/2011, at 2:42 PM, Pat Somerville wrote:


In GIMP I could see that the right-hand portion of the upper limit of positive infinity was either right at the right-hand edge of the dash-lined box surrounding the image or perhaps was cut off there; I'm not sure.

Can you or someone explain to me the mechanisms in detail that cause the unwanted black line segments to be generated? So far I know from you, Dr. Takeno, that if a mathematical expression inside an image would otherwise extend beyond the right border of the image, somehow the black line segment was generated underneath the image. You explained something about the first step of the cropping procedure which was involved.

The problem that needs to be solved is to align images inline,
so that they appear to sit nicely on the baseline when viewed
in a web-browser.

However, HTML only allows vertical alignments of:
 "top", "bottom" and "middle".

Thus it is "middle" alignment which must be used.
But to do this, there often needs to be sufficiently much
white-space below the baseline, to balance what is above it.
That is, the baseline has to be seen to be exactly in the
middle of the image.

The image is typeset on a smallish page, but not all of this
is actually needed, so first some excess white-space must be
cropped away. But you cannot crop all of it, else the middle
alignment will not do what is required.

Hence part of the image needs to be (at least part of) a frame,
that encompasses the full height, depth and width that is required.
This is the "black bars" that you see, when a step in the process
does not work as intended.

The TeX coding in  images.tex  is designed to produce those black
bars at exactly the right place so that they enclose neatly the
full image plus the correct amount of white-space padding so that
the final image will align appropriately, after:

 1.  crop away excess whitespace
 2.  crop away the "black bar" at the bottom
 3.  crop away the "black bar" at the left side

However, because colours can be used, both for the image content
and the background, and different scale factors can be chosen,
achieving the correct amount of cropping is not as easy as you
might think it should be.

It is done by cropping away whole rows and columns that are all
of the same colour.

Normally it will be "white" for step 1., leaving behind a rectangle
including the "black bars" --- "cropping bars" is a better term.

Then for steps 2. & 3. the bottom and left-side cropping bars
are removed "provided" the whole row (or column) is indeed all
of the same colour --- usually black.

Mostly this works pretty well, but it relies on the assumption
that the cropping bars do indeed enclose the full contents
that are to be shown. It is when this assumption is not actually
true that the black bars will remain.

Your example failed presumably because the width when TeX typesets
an \hbox  containing  \int_{-\infty}^{\infty}  has one of the
limits actually protruding outside the final box dimensions, by more
than the extra tolerance that LaTeX2HTML allows for the lengths
of the cropping bars.


I just guess from what you wrote, Dr. Takeno, that the script eqnfix.sh obtained from http://www.vyvy.org/main/en/node/102 on the Internet might not have been able to eliminate the black line segment under my integral sign due to a piece of the upper limit that otherwise would have extended beyond the right border of the .png image.

Yes. Adding that extra \hspace{...} presumably expands the width
of the typeset \hbox (described above).

You should be able to do it also using a TeX \phantom  :
viz.
    $\int_{-\infty}^{\infty} \phantom{dx}$

But this might be too wide, so just adding a bit of extra space
would probably do:
                   $\int_{-\infty}^{\infty}\;$

Similarly forcing extra space, either vertically or horizontally,
can be the best solution in other circumstances too;
e.g. when using fancy fonts with twirls and swashes, such as
with Zapf Chancery, or calligraphic styles.


Thanks, Professor Ross Moore, for suggesting I use the -debug option in a latex2html command.



While LaTeX2HTML is quite good for producing websites based on LaTeX
content --- I spent many man-hours working on it, along with others,
back in the 1990s and early this century --- it is now rather dated.

The software that you should be looking at for 21st century websites
is called MathJAX.
                   http://www.mathjax.org/

By Googling around, you should be able to find lots of articles
that decry the use of images of bit of mathematics.
It is better to get the browser to do proper TeX-based typesetting
using JavaScript, or other sophisticated scripting language.
However not all web browser software can support this.  :-(

This has always been the case, since the mid-1990s.
MathJAX is the best supported solution so far.


Hope this helps,

Ross

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




_______________________________________________
latex2html mailing list
latex2html@tug.org
http://tug.org/mailman/listinfo/latex2html

Reply via email to