473,487 Members | 2,474 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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?

Thanks,

todd.
Jul 23 '05 #1
5 7878
mo**@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.
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:

&radic;<span style="border-top:1px solid black;">103</span>
Jul 23 '05 #2
Leif K-Brooks wrote:
mo**@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="&radic;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:
&radic;<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
Jul 23 '05 #3
On Fri, 19 Nov 2004 mo**@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/nht...thematics.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 &radic; 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/...cklist.html#s6
If you want to make a fool of yourself, you could write &Ouml;
for the square root sign.
http://google.com/search?ie=ISO-8859...title:Stockton

--
http://www.unics.uni-hannover.de/nht...quareroot.html

Jul 23 '05 #4
Andreas Prilop <nh******@rrzn-user.uni-hannover.de> wrote:
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

Jul 23 '05 #5
On Fri, 19 Nov 2004, Andreas Prilop wrote:
If you want to make a fool of yourself, you could write &Ouml;
for the square root sign.
http://google.com/search?ie=ISO-8859...title: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.

&Ouml; in HTML is definitively the O-umlaut/trema character. Any
browser which allows itself to be persuaded otherwise is in a state of
sin.
Jul 23 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

72
4328
by: Raymond Hettinger | last post by:
Peter Norvig's creative thinking triggered renewed interest in PEP 289. That led to a number of contributors helping to re-work the pep details into a form that has been well received on the...
0
1498
by: Bengt Richter | last post by:
Still looking for a unifying concept ;-) It struck me that @deco1 @deco2 def foo():pass uses '@' to register at-next-name-binding processing in a way similar to atexit's registering of...
1
4154
by: Kenneth McDonald | last post by:
I'm working on the 0.8 release of my 'rex' module, and would appreciate feedback, suggestions, and criticism as I work towards finalizing the API and feature sets. rex is a module intended to make...
7
3991
by: Christopher Jeris | last post by:
I am relatively new to JavaScript, though not to programming, and I'm having trouble finding the idiomatic JS solution to the following problem. I have a table with (say) fields f1, f2, f3. I...
29
1949
by: John Devereux | last post by:
Hi, What is the best way to ensure an integer is a multiple of a given power of 2? How about int size; ...
0
308
by: JoanneC | last post by:
Hi, Just a quick question, why is radical sorting not supported in .NET framework for Traditional Chinese, since this is a popular sorting method. Thanks
351
12693
by: CBFalconer | last post by:
We often find hidden, and totally unnecessary, assumptions being made in code. The following leans heavily on one particular example, which happens to be in C. However similar things can (and...
10
3408
by: JurgenvonOerthel | last post by:
Consider the classes Base, Derived1 and Derived2. Both Derived1 and Derived2 derive publicly from Base. Given a 'const Base &input' I want to initialize a 'const Derived1 &output'. If the...
1
1491
by: dhall5 | last post by:
Hi everyone, My company advertises "not off the shelf" programming and what we provide can be fit to each clients needs. With that the biggest goal I have is to have the 80% of what everyone...
0
6967
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7137
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6846
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
4565
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3076
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3071
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1381
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
600
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
267
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.