Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Subject
- Posted on
- Making radical expressions?
- 11-19-2004
posted on
November 19, 2004, 11:18 am
November 19, 2004, 11:18 am
that contain radical symbols (square root, cube root, ..., nth root)
that look nice.
The best I can come up with is by having a table, a CSS border, the
radical sign:
<TABLE>
<TR>
<TD>&radic</TD><TD style="border-top: 1pt solid black;">103</TD>
</TR>
</TABLE>
This seems kind of cruddy. Is there a better way to represent
mathematical expressions without having to make complex tables?
Thanks,
todd.
Re: Making radical expressions?
> Is there a nice way to have HTML display mathematical expressions
> that contain radical symbols (square root, cube root, ..., nth root)
> that look nice.
> The best I can come up with is by having a table, a CSS border, the
> radical sign:
>
> <TABLE>
> <TR>
> <TD>&radic</TD><TD style="border-top: 1pt solid black;">103</TD>
> </TR>
> </TABLE>
>
> This seems kind of cruddy. Is there a better way to represent
> mathematical expressions without having to make complex tables?
Wait until MathML gets better browser support, and use an image in the
mean time. Or if you absolutely have to use pure HTML, slightly less
ugly markup is this, only with a class instead of inline CSS:
√<span style="border-top:1px solid black;">103</span>
Re: Making radical expressions?
> mojo@spamcop.net wrote:
>
>> Is there a nice way to have HTML display mathematical expressions
>> that contain radical symbols (square root, cube root, ..., nth root)
>> that look nice.
>
> Wait until MathML gets better browser support,
MathML is supported just fine in Mozilla based browsers, and there is an
extension available for it in IE. However, to use it properly, the
document *should* be served with an XML mime type (application/xhtml+xml
or application/xml).
The problem is that to serve it as text/html to IE, since it does not
support XHTML properly, is in violation of the specifactions. The only
other option would be to serve it as application/xml, but then you need
to also provide the XSL stylesheet in order for IE to render it properly
as HTML. If you don't it just renders the XML pretty-print source tree.
Jacques Distler uses MathML in his blog [1]. He uses XHTML 1.1 + MathML
DTD. Though he incorrectly serves it as text/html to IE, but he does it
correctly for standards compliant browsers, so it's not too bad.
> and use an image in the mean time.
The problem with images is that it may be difficult to provide adequate
alternate text for more complicated equations. Simple equations like
square root, you could write alt="âˆš103" or alt="√103", but it may
be harder for other kinds of equations and symbols, though Unicode
probably supports most of them that you'll need in the various
mathematical symbols and operators sections.
> Or if you absolutely have to use pure HTML, slightly less ugly markup
> is this, only with a class instead of inline CSS:
> √<span style="border-top:1px solid black;">103</span>
I think the image is a better alternative than that, but that text may
be suitable alt text for the image, as shown above.
[1] http://golem.ph.utexas.edu/~distler/blog /
--
Lachlan Hunt
http://lachy.id.au /
http://GetFirefox.com/ Rediscover the Web
http://SpreadFirefox.com/ Igniting the Web
Re: Making radical expressions?
On Fri, 19 Nov 2004 mojo@spamcop.net wrote:
> Is there a nice way to have HTML display mathematical expressions
> that contain radical symbols (square root, cube root, ..., nth root)
> that look nice.
See http://www.unics.uni-hannover.de/nhtcapri/mathematics.html
and http://www.cs.tut.fi/~jkorpela/math/ .
> <TABLE>
> <TR>
> <TD>&radic</TD><TD style="border-top: 1pt solid black;">103</TD>
> </TR>
> </TABLE>
First, don't write √ but √ , which is better
supported among browsers (Netscape 4.x) and editors.
Second, don't attempt to make a horizontal bar but simply write
V(a²+b²)
where I used "V" to represent the square root sign.
Third, set the encoding (charset) to UTF-8.
http://ppewww.ph.gla.ac.uk/~flavell/charset/checklist.html#s6
If you want to make a fool of yourself, you could write Ö
for the square root sign.
http://google.com/search?ie=ISO-8859-1&q=%D62+intitle:Stockton
--
http://www.unics.uni-hannover.de/nhtcapri/temp/squareroot.html
> Is there a nice way to have HTML display mathematical expressions
> that contain radical symbols (square root, cube root, ..., nth root)
> that look nice.
See http://www.unics.uni-hannover.de/nhtcapri/mathematics.html
and http://www.cs.tut.fi/~jkorpela/math/ .
> <TABLE>
> <TR>
> <TD>&radic</TD><TD style="border-top: 1pt solid black;">103</TD>
> </TR>
> </TABLE>
First, don't write √ but √ , which is better
supported among browsers (Netscape 4.x) and editors.
Second, don't attempt to make a horizontal bar but simply write
V(a²+b²)
where I used "V" to represent the square root sign.
Third, set the encoding (charset) to UTF-8.
http://ppewww.ph.gla.ac.uk/~flavell/charset/checklist.html#s6
If you want to make a fool of yourself, you could write Ö
for the square root sign.
http://google.com/search?ie=ISO-8859-1&q=%D62+intitle:Stockton
--
http://www.unics.uni-hannover.de/nhtcapri/temp/squareroot.html
Re: Making radical expressions?
> Second, don't attempt to make a horizontal bar but simply write
> V(a²+b²)
> where I used "V" to represent the square root sign.
I'm not so sure about it - in some cases, a horizontal bar might improve
the appearance, as I discuss at
http://www.cs.tut.fi/~jkorpela/math/#uol
Note that using text-decoration: overline puts it a little lower than
using a top border. There's still the minor problem that the square root
sign does not connect with the overline. We can make the gap smaller, at
the risk of causing higher actual line height if this appears inside
running text:
<big>√</big><span style="text-decoration:overline">103</span>
On the other hand, there's the low-tech reliable approach of using
sqrt(103), though it's possible that some people won't recognize it but
would understand the root sign - but this can usually be handled by
giving an explanation - perhaps on the fly, by using
<a href="expl.html#sqrt" title="square root of">sqrt</a>(103)
But in a relatively mathematical text, I would try the root sign method,
with overline, though probably using parentheses as well if the radicand
contains any binary operators.
--
Yucca, http://www.cs.tut.fi/~jkorpela /
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html
Re: Making radical expressions?
On Fri, 19 Nov 2004, Andreas Prilop wrote:
> If you want to make a fool of yourself, you could write Ö
> for the square root sign.
> http://google.com/search?ie=ISO-8859-1&q=%D62+intitle:Stockton
I suppose you're leaving it to me to point out that, at:
http://www.merlyn.demon.co.uk/www-use0.htm
Dr. John says:
Some pestilential authors override your default text and background
with undesirable choices of font, colour or pattern.
^^^^^^^^^^^^^^^^^^^^^^^^^^^
And sometimes Dr. John is right. Font changes are *not* the HTML way
of extending the character repertoire.
Ö in HTML is definitively the O-umlaut/trema character. Any
browser which allows itself to be persuaded otherwise is in a state of
sin.
> If you want to make a fool of yourself, you could write Ö
> for the square root sign.
> http://google.com/search?ie=ISO-8859-1&q=%D62+intitle:Stockton
I suppose you're leaving it to me to point out that, at:
http://www.merlyn.demon.co.uk/www-use0.htm
Dr. John says:
Some pestilential authors override your default text and background
with undesirable choices of font, colour or pattern.
^^^^^^^^^^^^^^^^^^^^^^^^^^^
And sometimes Dr. John is right. Font changes are *not* the HTML way
of extending the character repertoire.
Ö in HTML is definitively the O-umlaut/trema character. Any
browser which allows itself to be persuaded otherwise is in a state of
sin.
Site Timeline
- » Size of IE input button
- — Next thread in » HTML Authoring Forum
- » Simple fix..validation errors at W3C...
- — Previous thread in » HTML Authoring Forum
- » HTML 5 validation software?
- — Newest thread in » HTML Authoring Forum
- » Adblock Testscript problem
- — The site's Newest Thread. Posted in » HTML Markup Language