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

Jukka K. Korpela jkorpela at cs.tut.fi
Sat Apr 16 05:57:17 PDT 2011


Aryeh Gregor 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)?
>
> Those three characters are typeset, read, and otherwise presented
> identically to variables, so the correct tag is <var>.  Perhaps the
> spec could be clearer on this point.

So do yo mean that everything that is rendered identically to (some assumed 
rendering of) variables should be marked up as <var>? If you imply that 
variables are rendered in italics, then apparently ship names, scientific 
names of organisms, and gene symbols call for <var>, too, right?

Seriously speaking, if all that we can say about some notations is that they 
are, by convention, rendered in italics if possible, then surely <i> is 
correct, if the notation does not clearly fall into a category for which 
there is semantic markup element defined.

Besides, there is no implied uniform rendering for variables in the current 
broad meaning for <var>. In mathematics, variables are conventionally 
written in italics. But the HTML(5) notion of variable is wider: "The var 
element represents a variable. This could be an actual variable in a 
mathematical expression or programming context, or it could just be a term 
used as a placeholder in prose." 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.

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.

I suppose what the wording really _means_ is something like "This could be a 
variable in a mathematical expression or a placeholder as used especially in 
technical and scientific language." The HTML 4.01 mentions "program 
argument", but this could be misleading too, as it does not really refer to 
actual arguments (as in the program invocation "latex mydoc.tex") but to 
placeholders for them (as in the instruction "then process the document by 
issuing the command <code>latex <var>filename</var></code>). An example of 
using placeholders in humanities might be "The normal word order in this 
language is <var>subject</var> <var>object</var> <var>verb</var>."

Clarified that way, <var> would refer to notations that are normally 
rendered in italics - but it would of course not refer to _any_ notation 
that is normally rendered in italics.

In this perspective, my original question really boils down to the question 
whether symbols of physical quantities should be regarded as placeholders. I 
have no strong feelings in either direction. I'd just like to see the 
question settled one way or another, at least by giving an example of using 
<var> or, as the case may be, <i> for such a quantity.

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




More information about the whatwg mailing list