# Semantical writing (was: logical markup)

• To: math-font-discuss@cogs.susx.ac.uk
• Subject: Semantical writing (was: logical markup)
• From: haberg@matematik.su.se (Hans Aberg)
• Date: Mon, 5 May 1997 15:32:26 +0200

At 11:30 97/05/05, Ulrik Vieth wrote:
>Matthias Clasen:
>
>> 4) Some control sequences (denoting different mathematical symbols) use
>>    the same glyph in the plain LaTeX. The examples I came up with are
>>    \backslash and \setminus and \Delta and \Laplace (well, this is not
>>    actually in plain LaTeX, but it is a natural counterpart to \nabla and
>>    in defining it there are currently no alternatives to using \Delta).
>>    It might be a good idea to use separate slots for these symbols (even
>>    if the glyphs are the same by default). Perhaps this issue is already
>>    settled for \setminus throught the inclusion of \smallsetminus in MC.
>
>As mentioned in Frank's reply, this issue is a difficult subject with
>a somewhat vague boundary that can't be decided rigourously.  As for
>\backslash vs. \setminus I wouldn't see the need for different slots,
>whereas for \Delta vs. \Laplace it would indeed seem advantageous to
>have separate slots as the design of \Laplace might vary depending
>on the font designers preferences (greek Delta vs. geometric triangle).
>
>In any case, it would seem very useful for document portability to
>ensure a consistent logical markup based the symbol's functional
>meaning rather than eventual appearence, possibly allowing for some
>configuration at the macro level when several options exists.
>
>For instance, in physics one might always want to write \vec{x}
>regardless of whether the outcome is a letter with an arrow accent or
>a bold or bold italics letter taken from a different math alphabet.
>Similary, one might write \Laplace instead of \Delta or \triangle, or
>something like \variation or \increment instead of \delta or \Delta.

One can classify symbols according to different principles, according
rendering (looks), and according to semantics (meaning). One can combine
the two by ideas of "object oriented programming" (OOP), as follows:

Set the catcode of "/" to letter. Then \Laplace is a mathematical
concept, so we could give it the command (say)
\math/Laplace
and \Delta and \triangle are symbols, so we could give them names
\symb/Delta
\symb/triangle
Then we could have different renderings of the Laplace symbol, say for
mathematicians and physicists, so we could call those
\math/Laplace/math
\math/Laplace/phys
These could have default renderings, defined by say
\let\math/Laplace/math=\symb/triangle
\let\math/Laplace/phys=\symb/Delta
\def\math/Laplace{\math/Laplace/math}

One could then define special "math" and "phys" environments or packages,
which freely chooses among the different possibilities. We could also have
a command
\text/Laplace
which is perhaps the name of the person, or something.

The idea is to sort out the names into different boxes, or modules, so
that they do not conflict. By the scheme, one can classify glyph renderings
and symbol semantics independently, and then link them together as an
independent step.

The stuff above could be taken as pseudocode, but I have done some
programming with such "/" slashes, and it works out well.

Hans Aberg