W3C home > Mailing lists > Public > whatwg@whatwg.org > September 2008

[whatwg] Can <var> possibly work?

From: Ozob the Great <ozob1337@gmail.com>
Date: Fri, 19 Sep 2008 18:41:42 -0400
Message-ID: <debda2f50809191541r56ea6dd2yc4a907cdf3ae8f53@mail.gmail.com>
I am concerned about the existence of HTML5's <var>. This was brought to my
attention during a technical debate on Wikipedia which amounted to: Where is
use of <var> appropriate? The problem is that while <var> can be used to
distinguish variables from non-variables, there are many other mathematical
constructs which cannot properly be called variables. If variables are going
to be distinguished by the markup, then these other constructs ought be
distinguished by the markup. But they can't be put inside <var> because
they're not variables, and furthermore, they can't always said to be
constants, functions, spaces or any short list of allowable objects; the
number of different types of objects occurring in mathematics is tremendous,
and specifying all the allowable objects in HTML markup is undesirable.

Let me give an elementary example. Consider an equation for a line:

 y = mx + b.

In this equation, only x and y are normally considered variables. m and b
are usually considered constants. So one could mark this up as

 <var>y</var> = m<var>x</var> + b,

but then the markup doesn't signal what m and b are though they clearly have
some meaning. One could imagine extending the markup by introducing a
<const> tag:

  <var>y</var> = <const>m</const><var>x</var> + <const>b</const>.

There are two closely related things to note here. One is that this must be
done manually; an automated tool has no way to distinguish which symbols are
variables and which are constants. The second is that this markup may be
incorrect in some cases (thereby proving the previous point). If one wants
to consider the collection of all lines passing through the point (0, b),
then m becomes a variable, and the markup must change:

  <var>y</var> = <var>m</var><var>x</var> + <const>b</const>.

Conceivably one could make this work for a lot of equations, but there's at
least one more obvious type of object one needs, namely functions. So one
might try to solve this problem by introducing a <funct> tag:

  <funct>f</funct>(<var>x</var>) = <const>m</const><var>x</var> +
<const>b</const>.

As long as one stays within the realm of elementary (precalculus)
mathematics, this might suffice. But modern mathematics has many things
which are not variables, constant numbers, or functions. Even if one
interprets "constant" broadly to mean "constant object" instead of "constant
number" (like it often means), there are still many other types of objects.

Content MathML gets around this by defining approximately 120 different
content elements. HTML 5 neither needs nor wants 120 different mathematical
content elements. The only solution I can see to this is to deprecate <var>:
Authors who wish to provide content markup should use MathML, because it is
designed for such things.

Thoughts?

-- 
Ozob
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.whatwg.org/pipermail/whatwg-whatwg.org/attachments/20080919/9ce6d56f/attachment.htm>
Received on Friday, 19 September 2008 15:41:42 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:05 UTC