[whatwg] Physical quantities: <var> or <i>?

Jukka K. Korpela jkorpela at cs.tut.fi
Mon Jul 25 23:22:17 PDT 2011

25.07.2011 22:02, Ian Hickson wrote:

>> So what markup should we use for E = mc�, given that by the applicable
>> standards, E, M, and c should appear in italics and the other characters as
>> normal (upright)?
> It sounds like you want to use these characters:

No, I don’t want to use them, since only about one person in a million 
would see the expression. There are several reasons to that, including 
the absence of those characters in fonts—the only commonly available 
font that contained a reasonable collection of Plane 1 characters was 
code2001, and it does not seem to be distributed by its author any more.

Characters not supported by any of the fonts installed in the user’s 
system don’t degrade well. The user sees a small box or the ”�” 
character (which may appear due to other problems, too).

Comparing this with how well <i>E</i> = <i>m</i><i>c</i>² works, I don’t 
think anyone who understands the implications will give a second though 
to using such Plane 1 characters in HTML documents.

> Alternatively, you can use MathML to mark up the equation.

Or I could use LaTeX and get a presentation of acceptable quality. Or an 
image, as people still widely use. The question was about markup of 
physical quantities in HTML. Using other tools just to present a casual 
equation in running text would be disproportionate.

> Whether you want something in italics or not is more a matter for CSS than
> a matter for HTML.

In many contexts, by long traditions and conventions, the use of italics 
is a matter of content, not casual presentation. When people know they 
cannot use italics, they are forced to simulating it (e.g., writing /a/ 
to denote italic “a”) or to avoiding the issue with clumsy methods like 
long prose explanations. Wouldn’t it be odd to pretend that in HTML, you 
are forced to something like that? After all, <i> has been with us since 
the dawn of HTML, and all browsers support it when they can use italics 
at all (and may use some special representation when not).

>> Should we consider the var element as covering physical quantities too?
>> After all, they can be regarded as variables in a broad sense, as
>> symbols that denote different values in different situations. However,
>> <var>c</var>  would be odd, wouldn't it, since the symbol denotes a
>> universal constant of nature.
> You can look at it as being a variable whose value is a constant of
> nature. I've clarified the spec to indicate that this is fine.

I don’t think you have clarified whether <var> is suitable for physical 
quantities, but I guess you meant to imply it—even though there is not a 
single example about markup for physical quantities.

On the other hand, it seems that it doesn’t really matter. The <var> 
element has now been defined to have such a wide and vague meaning that 
it is pointless to use it. There is little reason to expect that any 
software will ever pay attention to <var> markup on any semantic basis.

So authors will use <i> if they think italics is semantically essential, 
and <var> won’t be used much.

>> A programming
>> language variable is something that is _not_ conventionally rendered in
>> italics. Rather, they are usually (though for no really good reason)
>> rendered in a monospace font, like any other expressions in computer
>> languages.
> Indeed. And vectors are usually bold.

So why should authors be told to use markup that by default (and always 
when CSS is off) results in programming language constructs to be 
italicized? Flagging “placeholders” with italics (as in “issue the 
command <kbd>rm <i>filename</i></kbd> to delete a file) is a widely used 
and understood style, but programming language variables are a 
completely different issue.

>> Too bad there's no example of<var>  used in programming context. The
>> current wording suggests that it would be normal, when discussing
>> programming, to write, say, "Then we define the variable
>> <var>myFoo</var>  of type<code>fooType</code>  with initial value
>> <code>"Foo"</code>  - -", which really makes no sense, even if we use
>> both<var>  and<code>  for myFoo.
> Why does it make no sense?

Because it implies that in default rendering, identifiers of variables 
appear in italics whereas identifiers of types or classes do not. Why 
would anyone use extra <var> markup when it has no other implications 
than requiring extra CSS code to remove (when possible) italics?

Yucca, http://www.cs.tut.fi/~jkorpela/

More information about the whatwg mailing list