# No Subject

• To: math-font-discuss@cogs.susx.ac.uk
• From: Justin Ziegler <ziegler@goofy.ZDV.UNI-Mainz.DE>
• Date: Thu, 12 Aug 1993 20:46:25 +0200

\documentstyle[a4]{article}

\input mynfss

\begin{document}

% jz -- changed the title
\title{Replacing \texttt{cmex}?\\ This is not a finished
document} \author{Justin Ziegler \\ \small \texttt
{ziegler@educ.emse.fr} \\ \small \texttt
{ziegler@goofy.zdv.uni-mainz.de}} \date{\small Started: August the
$9\fam0^{th}$ \\ Printed: \today \\ Filename:
\texttt{cmexfont.tex} with \LaTeX\ and NFSS2} \maketitle

\begin{abstract}
% jz -- a little change in the first sentence
While I was working on the new math encoding, I realised that
the fact that \texttt{cmex} is only loaded in one size, and not in
three like the other math fonts, was going to create a few problems.
In this paper my concerns are the following:
\begin{itemize}
\item What is in \texttt{cmex}?
\item Which special mechanisms does \TeX\ use to access glyphs from
\texttt{cmex}?
\item What could be added to \texttt{cmex}?
\item What could be taken out of \texttt{cmex}?
\end{itemize}
The aim of this paper is to help the MFG\footnote{Math Font Group.}
design the MX encoding as a replacement and improvement of the
\texttt{cmex} encoding.  \note{Most of what is written in this paper
is pure theory, and has not been applied or tested.}

Acknowledgements: thanks to Alan Jeffrey and Barbara Beeton for
\end{abstract}

% bb -- suggest adding an introductory section 0 giving a bit of
%       background on knuth and early history; i will make suggestions
%       and vouch for the accuracy of the statements, or offer to be
%       quoted as the source if something is conjecture.

\section{What is in \texttt{cmex}?}
\subsection{Delimiters}
\begin{itemize}
\item Four different sizes of ( ) and extensible versions. Left and right
extensible modules are '102 and '103.
\item Four different sizes of [ ] and extensible versions. The extensible
modules, one for the right bracket, and one for the left
bracket are: '066, '067.
\item Same for \{ and \}\,; the extensible module is: '076.
\note{The extensible module here is very small, because it is
added twice: once above the middle piece, and once below the
middle piece. Its height is half that of the parentheses'
extensible module. Interesting to see that there is only one
extensible module for both the left and the right curly brace.
This is because the left-right extension of a curly
brace is symmetrical, unlike the parentheses for example.}
\item Four different sizes of $\langle$ and $rangle$. No extensible version.
\item Same for $\backslash$ and $/$. No extensible version.
\item Four different sizes of $\lfloor$ and $\rfloor$ and an
extensible version. Extensible modules: '066, and '067.
\item Same for $\lceil$ and $\rceil$. Same extensible modules as the
previous one.
\item Glyphs in positions '014 and '015 are the extensible versions
of the vertical bar and the double vertical bar. They are their
own extensible modules.
\end{itemize}

\subsection{Large operators}
Large operators come in pairs:
\begin{itemize}
\item The sqcup
% bb -- although the sqcap isn't here, might want to note that it
%       isn't but could be added
\item The circled integral
\item The circled dot
\item The circled plus
\item The circled times
\item The sums
\item The prods
\item The normal integrals
\item The bigcups
\item The bigcaps
\item The U plus
\item The wedges
\item The vees
\item The coprods
\end{itemize}

\subsection{Wide accents}
\begin{itemize}
\item 3 sizes for the hat
\item 3 sizes for the tilde
\end{itemize}

\begin{itemize}
\item The vertical bit needed to construct the big radical: '165
\item The top bit of the constructed radical: '166
\end{itemize}

\subsection{Arrows}
\begin{itemize}
\item The three pieces for the construction of the vertical double
arrow: '167 '176 '177
\item The three pieces of the vertical single arrow: '077, '170,
'171
\end{itemize}

\subsection{Horizontal curly braces}
\begin{itemize}
\item The four pieces for the construction of horizontal curly
braces: '172 -- '175
\end{itemize}

\section{\TeX's behavior with \texttt{cmex} glyphs}
\subsection{Large operators}
\begin{itemize}
\item A large operator is vertically centered with respect to the
math axis. This means that, whatever the surrounding glyph size,
things will not look too bad.
\item With the following definition of a large operator:
\cn{mathchardef} \cn{sum} \texttt{= "1xyy}, if \TeX\ is in \textem
{display style}, it looks to see if the character in position
\texttt{"yy} of family \texttt{x} has a successor. If it does then
the successor is taken. When not in \textem {display style}, \TeX\
just takes character \texttt{"yy} from family \texttt{x}. Thus in
text style, in script style and in scriptscript style the same
glyph is used.
\end{itemize}

\subsection{Vertical delimiters, and friends}
Radicals are delimiters, and vertical arrows also, so I shall only
speak about delimiters. Here is a quote from Victor Eijkhout's book:
\begin{quote}
A delimiter has two codes: a small variant, and a large variant.
\TeX\ first tries the small variant, and if that is not
satisfactory (or if the left part of the delimiter code is 000) it
tries the large variant. If trying the large variant does not meet
with success \TeX\ takes the largest delimiter encountered in this
search. If no delimiter at all is found, (which can happen if the
right hand part is also 000), an empty box of width
\texttt{\string\nulldelimiterspace} is taken.

Investigating a variant means in sequence:
\begin{itemize}
\item If the current style is scriptscript style, the scriptscript
font of the family is tried.
\item If the current style is script style or smaller the script
font of the family is tried.
\item Otherwise the text font of the family is tried.
\end{itemize}

Looking for a delimiter at a certain position in a certain font
means:
\begin{itemize}
\item If the character is large enough, accept it.
\item If the character is extendible accept it.
\item Otherwise, if the character has a successor (the same but
bigger), try the successor.
\end{itemize}
\end{quote}
Using the three size mechanism probably did not seem necessary to
Knuth.  Generally large delimiters are used in display style, and not
in script or scriptscript style. However, they can also be used in
the small styles.

\subsection{Wide accents}
For the choice of accents, \TeX\ only considers one font, but looks
to see if the current accent has a successor. Unlike the delimiter
choice mechanism, the accent choice mechanism does not go through all
three sizes. \TeX\ chooses the accent in such a way that the accent
width is as close as possible but smaller than the width of the box
to cover.

\subsection{First conclusion}
For operators, a distinction in size is made between text style and
display style, whereas with the usual automatic size choosing
mechanism, glyphs in text style and in display style are taken from
the text size font, and are therefore the same size.

\subsection{Consequences for operators}
For operators, I shall consider two completely separate policies. In
one case I will consider that \texttt{cmex} is unchanged, and
loaded in three sizes. The other policy is to consider that if
\texttt{cmex} is loaded in three sizes, we no longer need to have
two sizes of operators in \texttt{cmex}, thus \cn{bigcup} would not
have a successor in its font. For better distinction, I shall call
the latter (and nonexistent) version \texttt{cmex}$'$. \textem {All
the following supposes that no new macros have been written. I'm
just trying to see what \TeX's automatic behavior would be.}
\begin{description}
\item[If \texttt{cmex}$'$ is loaded in three sizes.] In
such a situation \TeX\ has a large version of \cn{bigcup} (and
other operators) in text size, a small version in script size, and
yet a smaller version in scriptscript size.

The operators can be centered: no problem.

% jz -- change:
In script and scriptscript style the resulting big operators' would
be smaller than if they were produced with today's standard \TeX, and
todays standard \texttt{cmex}.  What is more, one would be smaller
than the other, which is also not the case with today's standard
\TeX, and todays standard \texttt{cmex}.
% ----

In display style one would get big operators from the text size
font: that's all right.  \textem {But one would also get a big
operator in text style,} and that is not conform with today's
standard \TeX\ behavior.

% jz -- I added encoding:
\item[If the existing \texttt{cmex} encoding is loaded in three sizes.]
The operators can be centered: no problem.

In script style, one would get the smallest version of a large
operator. But coming from a small size font, that will produce
something very small. In scriptscript style, same behavior as in
script style, but the result would be even smaller.
Thus in script, and in scriptscript style, the large big
operators' would never automatically be used. That is why I
thought up the \texttt{cmex}$'$ encoding.
% -- maybe should have said that earlier :-)

In text style, \TeX\ would produce the small version taken from
the text size font. In display style \TeX\ would produce the big
version of operators taken from the text size font.

So in text style and in display style, there would be no change
compared to what today's standard \TeX\ produces.
% jz -- changed the phrasing here:
But script and scriptscript style would produce different
results.
% --

\end{description}

In both cases, things could be improved if macros were written to
override the present behavior of \cn{bigsqcup}. I would think of
things like \cn{mathchoice}, but $\ldots$

\subsection{For vertical delimiters, radicals, vertical arrows}
Let's start by supposing \TeX\ is in scriptscript style, and it has
to typeset a large delimiter. One should consider two cases:
\begin{description}
\item[The delimiter has an extensible variant.]  In this case the
search will start in scriptscript size, and continue until \TeX\
finds the extensible variant of scriptscript size. Then the search
will stop, and the extensible will be used.  This extensible will
come from scriptscript size, and therefore probably not look the
same as it would in today's setup, where all extensibles come from
text size.
\item[The delimiter does not have an extensible variant.]  As
previously, the search starts in scriptscript size. If nothing
big enough is found in scriptscript size, the search continues in
script size. If still nothing is found, the search then continues
in text size. If necessary the biggest delimiter from text size
will be used. If the search stops in text size, there is no
difference with what \TeX\ produces today. But if the search stops
before reaching text size, the chosen delimiter will be different
from the one \TeX\ would use in the present configuration. Its
strokes would be finer, and better adapted for use in script style.
\end{description}

If one supposes that \TeX\ is in script style, the previous two
cases also apply, except that every occurrence of scriptscript' must
be replaced with script'. If one supposes that \TeX\ is in text
would be the same as it is in \TeX's current configuration.

\subsection{For horizontal curly braces}
If they are automatically taken from script size, or from script
script size when necessary, the spacing changes a little,
because the dimensions in the \texttt {.tfm} files would be
different. A consequence of this could be different line and page
breaks.

However, I think that it would be nice if curly braces did come out
of the correctly sized fonts. Then their boldness would match the
surrounding text. But I have been told that on a macro programming
point of view things could be difficult, even if the glyphs are

\subsection{For wide accents}
See first paragraph of previous section.

% jz --
%  I guess that in actual fact, the wide accents were put in
%  \texttt{cmex} because they could not fit any where else.
% jz -- I don't want to start any discussion on that topic so i'm
% taking it out

To my taste if accents were taken from the current size, things
could only look better. The accent's width would be closer to that
of the material under the accent, and the accent's boldness would be

\note {Unlike the delimiter choice mechanism, the accent choice
mechanism is restricted to one font, and one size.  It will thus
not look in text size when it is in script size for instance. So
in script style, accents will always come out of the script size
font, and in scriptscript style, accents will always come out of
the scriptscript size font, etc.$\ldots$}

\subsection{Conclusion}
% jz -- Changed the conclusion
Nearly everything in \texttt{cmex} could have lived in a normal three
sized math font, and that would maybe have been better. The only
problems would have come from the specific big operator'' behavior
that Knuth wanted.

Also one must not forget that Knuth did not want to leave any empty
slots.

The reduced amount of memory that was available on the machines with
which \TeX\ was first used could have been another reason for loading
\texttt{cmex} in one size only.

% jz -- This section has been changed a bit, and extended.

\section{What could be added to \texttt{cmex}?}
I am now considering possible evolutions of \texttt{cmex}, although I
use the terminology adding to \texttt{cmex}'', the font resulting
from these evolutions would have a different name.
\subsection{If the \texttt{cmex} encoded font is loaded in three sizes}
In this case big operators will not produce the usual results, and
the rest will be slightly different, as stated above.
\begin{itemize}

\item One can add wide accents, but one will get slightly
different (better) results. Thus wide accents will match the
script and scriptscript styles. Macros could be made (available
as a style option) to keep the old behavior, if necessary.

\item One can increase the number of different sizes for accents.

\item One can add big delimiters and their extensible versions,
without any problem! Accepting that things will be slightly
better adjusted in script and scriptscript style. Macros could
be made (available as a style option) to keep the old behavior,
if necessary.

\item One can increase the number of different sizes for
delimiters, and one can probably reduce the height of the
extensible module in order to make the growing of delimiters

\item One can add some vertical extensible arrows! Accepting that
things will be slightly better adjusted in script and script
script style.

\item One can add small and large big operators' without any
problem!

etc.$\ldots$) that would come in all three sizes.

\end{itemize}

\subsection{If the \texttt{cmex} encoded font is only loaded in one size}
\begin{itemize}
\item One can add big delimiters and their extensible versions
without any problem!

\item One can increase the number of different sizes for
delimiters, and one could reduce the height of the extensible
module in order to make the growing of delimiters more gradual.

\item One can add some vertical extensible arrows!

\item One can add large operators without any problem!

\item One can add wide accents without any problem, and the present
behavior of wide accents will not change. But if wide accents are
meant to match the script and scriptscript styles, then wide
accents must go in another font that would be loaded in different
sizes.

\item One can increase the number of different sizes for accents.

\item One could add other stuff, but it would only come in one
size.

\end{itemize}

\subsection {If a \texttt{cmex}$'$ encoded font is loaded in three
sizes}
I am considering here the imaginary \texttt{cmex}$'$ encoded font,
that I described previously.

One can add the same things as when \texttt{cmex} is loaded in three
sizes. The only difference is: if no macro programming is done, the
text style and display style will produce the same big operators'.
In script and scriptscript style the big operators' would be in
different sizes from one another and smaller from those in text
style.

\section{Conclusions}
If one loads \texttt{cmex} in three different sizes, many things are
improved, and with a \cn{mathchoice} the initial behavior of large
operators could be kept, or available as a style option.

If \texttt{cmex} is kept in a single size, we must decide whether to
put wide accents in or not.

\section{The beginning of my \texttt{cmex10.pl} file}

\begin{verbatim}
(FAMILY CMEX)
(FACE O 352)
(CODINGSCHEME TEX MATH EXTENSION)
(DESIGNSIZE R 10.0)
(COMMENT DESIGNSIZE IS IN POINTS)
(COMMENT OTHER SIZES ARE MULTIPLES OF DESIGNSIZE)
(CHECKSUM O 37254272422)
(FONTDIMEN
(SLANT R 0.0)
(SPACE R 0.0)
(STRETCH R 0.0)
(SHRINK R 0.0)
(XHEIGHT R 0.430555)
(EXTRASPACE R 0.0)
(DEFAULTRULETHICKNESS R 0.039999)
(BIGOPSPACING1 R 0.111112)
(BIGOPSPACING2 R 0.166667)
(BIGOPSPACING3 R 0.2)
(BIGOPSPACING4 R 0.6)
(BIGOPSPACING5 R 0.1)
)
(CHARACTER O 0 ...
\end{verbatim}

\begin{itemize}
\item The xheight is not null.
\item The space is.

\item With the following:
\begin{verbatim}
(CHARACTER O 100
(CHARWD R 0.875003)
(CHARHT R 0.039999)
(CHARDP R 1.760019)
(VARCHAR
(TOP O 70)
(BOT O 73)
(REP O 76)
)
)
\end{verbatim}
that is in the \texttt{.pl} file, one can produce something that looks
like a growing integral:
$$\left\lmoustache \frac{3.q}{\frac{3\pi.r^2}{3.q.b.c}} \right.$$

\item The pieces used to construct the horizontal curly braces are not

\item The bottom pieces of the extensible parentheses are overloaded
for \cn{rmoustache} and \cn{lmoustache}. One of these could be linked
(charlisted) with the integrals, so that \cn{left}\cn{bigint} could
produce a growing integral like the delimiters.

\item The bottom pieces of the curly braces ('072 and '073) are also

\item The middle pieces of the braces are overloaded for \cn{arrowvert}
and \cn{Arrowvert}.

\item The extensible module of the braces is overloaded for \cn{bracevert}.

\item For the wide accents and the curly braces the depth is null.

\item All the delimiter glyphs in \texttt{cmex} are set with a very
small height and a big depth. This is because the radical
primitive is also used for delimiters. For radicals, the \texttt
{.tfm} height of the glyph is used to determine the size of the
hrule.

\item The extension modules do not have any height at all. Same for

\item The four integrals have italic corrections.

\item Small versions of operators have a null height, whereas
big versions have a small height and a big depth:
\begin{verbatim}
(CHARACTER O 116
(COMMENT This is the small \bigotimes)
(CHARWD R 1.1111145)
(CHARDP R 1.000013)
(NEXTLARGER O 117)
)
(CHARACTER O 117
(COMMENT This is the big \bigotimes)
(CHARWD R 1.511116)
(CHARHT R 0.100001)
(CHARDP R 1.500012)
)
\end{verbatim}
I have no explanation for this!

\item There are no kerns or ligatures in \texttt{cmex}.

\end{itemize}

`