From: Jukka K. Korpela (jkorpela@cs.tut.fi)
Date: Wed Nov 02 2005 - 00:39:24 CST
On Tue, 1 Nov 2005, Philippe Verdy wrote:
> Tip: for HTML you can use:
> 2<sup><span style="display:none;">^</span>2</sup>
That's an interesting idea, but there are three reasons why it does not
work:
- we cannot expect that people generally recognize "^" as indicating
exponentiation; it's basically computer programmin jargon
- whether <sup> is implemented suitably by a browser does not
depend on its CSS support, so on most browsers, when CSS is
disabled or the author style sheet is not used, the user would
see "^2" in superscript style
- browsers that cannot generally implement <sup>, e.g. because they
essentially render the document using plain text only ("character cell
browsers") or they work in non-visual mode, may well use some
special notations to indicate the presence of superscripting;
e.g., Lynx renders your example as 2^^2 because it renders
<sup>foo</sup> as ^foo (which is debatable, but surely useful
at times).
I think the morale is that expressing superscripting in _several_
ways generally not a good idea, because the ways may interact
undesirably.
Replacing <sup> with semantically empty markup and suitable CSS
would give more consistent results:
2<span class="aux">^</span><span class="sup">2</span>
with e.g. .sup { vertical-align: super; font-size: 80%; }
.aux { display: none; }
It's not safe, though; anything that expects CSS settings to be coupled
with each other is unsafe. Besides, it loses the semantics of <sup>
and gives suboptimal rendering when CSS is turned off on a graphic
browser.
So I would say that if you use markup for superscripts, then that should
be it. The markup might not be honored in all contexts, but attempts
to prepare for such situations will be both awkward and unreliable.
If you cannot rely on markup to a sufficient degree, then the options
are to use superscript characters (in the fairly limited situations
where they can be used and can be expected to work) and to express
yourself in other ways, e.g. using linearized plain text notations
that you explain in text, whether that be 2^2, 2**2, pow(2,2), or
something else. Incidentally, when exponentiation is to be expressed
compactly in plain text, then I think UPWARDS ARROW U+2191 would
be a better symbol than circumflex ^ (which was originally taken
into use in exponential expressions since it can be imagined to be
a simulation of an upwards arrow).
-- Jukka "Yucca" Korpela, http://www.cs.tut.fi/~jkorpela/
This archive was generated by hypermail 2.1.5 : Wed Nov 02 2005 - 00:43:21 CST