Mailing List Archive

Ugly <math>
I decided to move this discussion from the village pump to here.

|The result of &lt;math> tags is ugly. The pictures are too big, and
|the ALT text shows the awful-looking raw markup when people move their
|mouse over it in most browsers. Any hope of some more user preferences
|in this area, hopefully with sensible defaults? -- [[User:Tim
|Starling|Tim Starling]]
|
|:I tend to agree on the size; font sizes can be manually bumped up on
|equations that really need it. (But the PNGs are limited to fixed
|pixel sizes, which does not have a guaranteed relation to a readable
|font size for any given user.) What other improvements would you
|suggest? I'm afraid "not ugly" and "more sensible" aren't things we
|can code. ;) Eventually output as inline [[MathML]] is hoped for, but
|few browsers currently support it and we would need to beef up our
|wiki->HTML translator to produce proper XHTML. --[[User:Brion
|VIBBER|Brion]] 06:42 Jan 9, 2003 (UTC)

By "user preferences with sensible defaults", I just meant two more items in
the user preferences:

* TeX formulas display raw markup in ALT text
* TeX formula size

IMHO the first one should be off, and the second should line up with the
most common browser configuration. Whoever made [[Image:del.gif]] seemed to
be on the right track. As for other improvements: perhaps you could find
some way to convert most formulas to ASCII art and use that for the ALT
text. Maple can do it, why not Wikipedia? ;) That said, I think you guys
have more pressing matters. I made a feature suggestion on SourceForge a few
weeks ago requiring only a few extra lines of code, and AFAIK it hasn't been
touched.

I've heard rumours you can get JavaScript to tell you the font size in
pixels, but I'm not sure if they're true. Barring that, half-blind people
can probably find their way to the preferences and enlarge the formulas.

MathML sounds nice, although I can't stand messages in articles saying "if
the formulas on this page aren't displaying correctly, you need to get a
better browser", e.g. in [[Table of mathematical symbols]]. As long as we
don't get any more of them, I'll be happy.

-- Tim Starling.


_________________________________________________________________
MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*
http://join.msn.com/?page=features/virus
Re: Ugly <math> [ In reply to ]
On Sun, Jan 12, 2003 at 02:52:22AM +1100, Tim Starling wrote:
> |The result of <math> tags is ugly. The pictures are too big, and
> |the ALT text shows the awful-looking raw markup when people move their
> |mouse over it in most browsers. Any hope of some more user preferences
> |in this area, hopefully with sensible defaults? -- [[User:Tim
> |Starling|Tim Starling]]
> |
> |:I tend to agree on the size; font sizes can be manually bumped up on
> |equations that really need it. (But the PNGs are limited to fixed
> |pixel sizes, which does not have a guaranteed relation to a readable
> |font size for any given user.) What other improvements would you
> |suggest? I'm afraid "not ugly" and "more sensible" aren't things we
> |can code. ;) Eventually output as inline [[MathML]] is hoped for, but
> |few browsers currently support it and we would need to beef up our
> |wiki->HTML translator to produce proper XHTML. --[[User:Brion
> |VIBBER|Brion]] 06:42 Jan 9, 2003 (UTC)
>
> By "user preferences with sensible defaults", I just meant two more items
> in the user preferences:
>
> * TeX formulas display raw markup in ALT text
> * TeX formula size
>
> IMHO the first one should be off, and the second should line up with the
> most common browser configuration. Whoever made [[Image:del.gif]] seemed to
> be on the right track. As for other improvements: perhaps you could find
> some way to convert most formulas to ASCII art and use that for the ALT
> text. Maple can do it, why not Wikipedia? ;) That said, I think you guys
> have more pressing matters. I made a feature suggestion on SourceForge a
> few weeks ago requiring only a few extra lines of code, and AFAIK it hasn't
> been touched.

TeX in ALT by default is necessary to make it look readable in text browsers.
It is the only possibility, as readable ascii-arts would have to be
two-dimensional and ALT doesn't support such thing.

What else do you think could go there ?

> I've heard rumours you can get JavaScript to tell you the font size in
> pixels, but I'm not sure if they're true. Barring that, half-blind people
> can probably find their way to the preferences and enlarge the formulas.

It's almost impossible to get PNGs well-aligned with text,
one reason being that TeX doesn't tell us where is base line ($a^i$ and $a_i$
may have the same height, but they should be treated differently).

> MathML sounds nice, although I can't stand messages in articles saying "if
> the formulas on this page aren't displaying correctly, you need to get a
> better browser", e.g. in [[Table of mathematical symbols]]. As long as we
> don't get any more of them, I'll be happy.

Does any browser other than Mozilla support MathML ?
I'm not going to work on that thing until Konqueror supports it.
Re: Ugly <math> [ In reply to ]
On 11 Jan 2003 at 19:22, Tomasz Wegrzanowski wrote:

> Does any browser other than Mozilla support MathML ?
> I'm not going to work on that thing until Konqueror supports it.

Amaya? First browser that implemented MathML...

Youandme

----------------------------------------------------------------------
Oficjalny serwis Polskiej Reprezentacji Skoczkow Narciarskich!
>>> http://link.interia.pl/f16b1
Re: Ugly <math> [ In reply to ]
On 11 Jan 2003 at 19:22, Tomasz Wegrzanowski wrote:

> TeX in ALT by default is necessary to make it look readable in text
> browsers. It is the only possibility, as readable ascii-arts would
> have to be two-dimensional and ALT doesn't support such thing.
>
> What else do you think could go there ?

At least, TeX with backslashes stripped off would give a nicer "look".

BTW, what do you think about
rendering TeX to PNG only in <math>s that stand in lines alone?
Leaving inline <math>s rendered to HTML
(or suppressing usage of such if that's impossible - I mean one would be
forced to put such <math> to a separate line)

Youandme


----------------------------------------------------------------------
Nowa MOTORYZACJA w portalu INTERIA.PL >>> http://link.interia.pl/f16ba
Re: Ugly <math> [ In reply to ]
youandme@poczta.fm wrote:

>On 11 Jan 2003 at 19:22, Tomasz Wegrzanowski wrote:
>
>
>
>BTW, what do you think about
>rendering TeX to PNG only in <math>s that stand in lines alone?
>Leaving inline <math>s rendered to HTML
>(or suppressing usage of such if that's impossible - I mean one would be
>forced to put such <math> to a separate line)
>
>
>
Maybe instead of <math> ... </math> we should have used a different syntax.
Something like:

:$$ ...

where the ":" indents the line. The math markup block is closed by a
double newline (so single linebreaks can be used for clarity)


>
>
Re: Ugly <math> [ In reply to ]
--- youandme@poczta.fm wrote:
> BTW, what do you think about
> rendering TeX to PNG only in <math>s that stand in lines alone?

Right now, I see as the only legitimate use of <math> these stand-alone
formulas, specifically only those that we formerly approximated with
ASCII art (which is extremely hostile to blind users). Other uses of
<math> are ugly because of alignment/font size/background issues, make
the site less usable for text-mode browsers, and increase the download
time for others.

Some of the stand-alone formulas are also ugly because of missing \big,
\bigg, \Big and \Bigg.

Axel

__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com
Re: Ugly <math> [ In reply to ]
On Sun, Jan 12, 2003 at 10:58:44AM -0800, Axel Boldt wrote:
> Some of the stand-alone formulas are also ugly because of missing \big,
> \bigg, \Big and \Bigg.

Could you elaborate and tell us about a few such formulas
and in which articles they are ?
Re: Ugly <math> [ In reply to ]
From "Tomasz Wegrzanowski" <taw@users.sourceforge.net>:


> TeX in ALT by default is necessary to make it look readable in text
browsers.
> It is the only possibility, as readable ascii-arts would have to be
> two-dimensional and ALT doesn't support such thing.

Sorry, I thought for a second that they could be two dimensional, becuase
the formula I was looking at was so long that it ran on the the next line in
the IE6 tooltip.

I've always thought IE's and Navigator's handling of ALT text was flawed,
and that it should be much more discreet than a tooltip popping up. And
perhaps we do owe users of text browsers a little more courtesy than
expecting them to find the appropriate user preference before they can see
formulas. However, I think it's our job to work around browser problems,
rather than ignore them.

Perhaps we could put in a JavaScript browser test, and strip the ALT text
for browsers recognised as graphical, such as IE and Navigator. The handful
of rebellious users who use a graphical browser with the pictures turned off
can just turn them back on, or find the user preference I suggested.

From youandme@poczta.fm:

>At least, TeX with backslashes stripped off would give a nicer "look".

Yes, I think that would definitely be a good start. Removing various
formatting instructions (such as \mathbf and \left) would also be nice.

From "Tomasz Wegrzanowski" <taw@users.sourceforge.net>:

> It's almost impossible to get PNGs well-aligned with text,
> one reason being that TeX doesn't tell us where is base line ($a^i$ and
$a_i$
> may have the same height, but they should be treated differently).

The idea is not to get it aligned with text, the idea is to get it roughly
the same size as text. <math>\mathbf{F}=ma</math> should look roughly the
same as '''F''' = ''ma''. At the moment even formulas on their own line look
ugly, because they are too big relative to the text of the article. I
recognise that different browsers/people use different font sizes, and
therefore have different ideas of how big formulas should be, but I think
the *default* sizes of PNGs should reflect the most common browser
configuration, not just whatever it was set to by the authors of TeX.

-- Tim Starling.
Re: Ugly <math> [ In reply to ]
On dim, 2003-01-12 at 22:32, Tim Starling wrote:
> >From "Tomasz Wegrzanowski" <taw@users.sourceforge.net>:
> > TeX in ALT by default is necessary to make it look readable in text
> browsers.
> > It is the only possibility, as readable ascii-arts would have to be
> > two-dimensional and ALT doesn't support such thing.
>
> Sorry, I thought for a second that they could be two dimensional, becuase
> the formula I was looking at was so long that it ran on the the next line in
> the IE6 tooltip.

The spec doesn't mention anything about linebreaks in alt text, so we
can't rely on them to actually break lines; Lynx for instance (quite
correctly) considers linebreaks in put to be regular whitespace, and
only breaks alt text for long lines.

Also, Multiline ASCII art would likely be much worse than TeX for blind
users with a screen reader.

I notice there's also a "longdesc" attribute for images, does anything
support it? (It references an external URl, though.)

> I've always thought IE's and Navigator's handling of ALT text was flawed,
> and that it should be much more discreet than a tooltip popping up.

The alt text isn't *for* those graphical browsers; they oughtn't to show
it at all, unless the image isn't available in which case they by
default become "user agents that cannot display images, forms, or
applets".

> Perhaps we could put in a JavaScript browser test, and strip the ALT text
> for browsers recognised as graphical, such as IE and Navigator. The handful
> of rebellious users who use a graphical browser with the pictures turned off
> can just turn them back on, or find the user preference I suggested.

I got a better idea, and it takes a lot less coding: move your mouse. :)
Seriously, "the alt text looks ugly when I let my mouse sit on top of an
image for several seconds" is what I would consider a non-problem.

> >From youandme@poczta.fm:
> >At least, TeX with backslashes stripped off would give a nicer "look".
>
> Yes, I think that would definitely be a good start. Removing various
> formatting instructions (such as \mathbf and \left) would also be nice.

The point is not to look good (though if we can, great), but to get
information across. How much can we strip out of the TeX without losing
information?


--

Brion Vibber <brion@pobox.com>
Re: Ugly <math> [ In reply to ]
On Monday, January 13,2003, Brion Vibber <brion@pobox.com> wrote:

The spec doesn't mention anything about linebreaks in alt text, so we
> can't rely on them to actually break lines; Lynx for instance (quite
> correctly) considers linebreaks in put to be regular whitespace, and
> only breaks alt text for long lines.
>
> Also, Multiline ASCII art would likely be much worse than TeX for blind
> users with a screen reader.
>
> I notice there's also a "longdesc" attribute for images, does anything
> support it? (It references an external URl, though.)

In regard to the "alt" attribute, my html books say that the text does not
wrap around.
In regard to the "longdesc" attribute, according to the www3c guidelines
on accessibility at:

http://www.w3.org/TR/WCAG10-HTML-TECHS/#image-text-equivalent

the "longdesc" attribute is used when a short text-equivalent is not sufficient
to convey all of the information one wants to about an image. It points to an
html file that contains the description and is used in addition to the "alt"
attribute.

Example:

<IMG src="97sales.gif" alt="Sales for 1997"
longdesc="sales97.html">


In sales97.html:

A chart showing how sales in 1997 progressed. The chart
is a bar-chart showing percentage increases in sales
by month. Sales in January were up 10% from December 1996,
sales in February dropped 3%, ..

(example taken directly from "HTML Techniques for Web Accessibility Guidelines
1.0", Secs. 7.1, 7.2 at above address)

Hope I'm answering the right question...

Best Regards,

Ruth Ifcher
--
Re: Ugly <math> [ In reply to ]
--- Tomasz Wegrzanowski <taw@users.sourceforge.net> wrote:
> On Sun, Jan 12, 2003 at 10:58:44AM -0800, Axel Boldt wrote:
> > Some of the stand-alone formulas are also ugly because of missing
> \big,
> > \bigg, \Big and \Bigg.
>
> Could you elaborate and tell us about a few such formulas
> and in which articles they are ?

Every formula that has lots of nested parentheses needs the outer ones
to be larger than the innner ones for readability. For example: logical
formulas with many quantifiers as on the various set theory axiom
pages, lambda expressions, higher order associative laws, lisp etc.

Also, formulas where one pair of absolute values |x| is nested inside
another pair are unreadable without the outer pair being bigger than
the inner pair. Shows up for example if you want to prove that the
absolute value function is continuous.

Why don't you just implement \big? All you have to do is check that the
next symbol is a delimiter, then pass it straight through to TeX.

Axel

__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com
Re: Ugly <math> [ In reply to ]
>From: Brion Vibber <brion@pobox.com>

<snip>

>I got a better idea, and it takes a lot less coding: move your mouse. :)
>Seriously, "the alt text looks ugly when I let my mouse sit
>on top of an image for several seconds" is what I would consider a
>non-problem.

I think I've been pretty much shouted down on this. But what about the font
size issue?

>The point is not to look good (though if we can, great), but to get
>information across. How much can we strip out of the TeX without losing
>information?

How does "\mathbf{F} = q\mathbf{E}" convey more information than "F = qE"?
Perhaps it conveys more information in the sense defined by Shannon, but
certainly not to the poor human attempting to read the thing. Commands such
as \left and \mathbf serve only to obscure the useful information. Of course
when it comes down to the coding it's a question of judgement. How about I
give you a start?

\sin -> sin, etc.
\nabla -> \/
\approx -> ~=
\le -> <=
\ge -> >=
\ne -> =/=
^\prime -> `
\frac{%1}{%2} -> (%1)/(%2)
\alpha -> alpha, etc.
\rightarrow -> ->
\leftarrow -> <-
\Leftarrow -> =>
\Rightarrow -> <=
\left ->
\right ->
\mathbf{%1} -> %1
\mathbb{%1} -> %1
\mathfrak{%1} -> %1
\mathcal{%1} -> %1
\sqrt{%1} -> sqrt(%1)
\in -> in
\cap -> intersection
\cup -> union
a\,b -> a b
a\;b -> a b
a\ b -> a b
a \quad b -> a b
a \qquad b -> a b
\! ->

There you go. If you're too busy, I might even consider coding it. Does PHP
have regular expressions the same as Perl?

-- Tim Starling.



_________________________________________________________________
MSN 8: advanced junk mail protection and 2 months FREE*.
http://join.msn.com/?page=features/junkmail
Re: Ugly <math> [ In reply to ]
Tim Starling wrote:

>\sin -> sin, etc.
...
>\! ->

>There you go. If you're too busy, I might even consider coding it. Does PHP
>have regular expressions the same as Perl?

This too is a wheel that's already been invented.
Ask on comp.text.tex about TeX to ASCII converters.


-- Toby
Re: Ugly <math> [ In reply to ]
On Wed, Jan 15, 2003 at 07:00:53PM +1100, Tim Starling wrote:
> \le -> <=
> \Rightarrow -> <=

Do you see now how does it in fact encode more information ?
Arrows and weak inequality must not use the same symbol.

> There you go. If you're too busy, I might even consider coding it. Does PHP
> have regular expressions the same as Perl?

I think you'll get much further using syntax trees of texvc.
TeX markup is not a regular language, so you can't parse it
well with regular expressions.
Re: Ugly <math> [ In reply to ]
Brion Vibber wrote in part:

>The point is not to look good (though if we can, great), but to get
>information across. How much can we strip out of the TeX without losing
>information?

When I see mathematicians' emails, the tendency seems to be
to use straight ASCII when things are just letters
but to leave in the TeX markup when things are symbols.
Thus, TeX's "\int_0^1 \sin x \, dx"
would become ASCII's "\int_0^1 sin x dx".


-- Toby