summaryrefslogtreecommitdiff
path: root/systems/tex-extensions/clasen/math/math.tex
blob: 1ce32accbc414fe66528ed95748f26d72d7e1172 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
\documentclass[preprint]{ltugboat}
\usepackage{shortvrb}
\usepackage{url}
\usepackage{booktabs}

\providecommand{\meta}[1]{\ensuremath{\langle\textit{#1}\rangle}}
\makeatletter
\providecommand{\eTeX}{$\m@th\varepsilon$-\TeX}
\makeatother
\hyphenation{pa-ra-me-ter}

\emergencystretch=4mm
\overfullrule=0pt
\title{Extending \TeX's mathematical typography}
\author{Matthias Clasen}
%\address{}
\netaddress{maclas@gmx.de}
\setcounter{page}{1}

\begin{document}
\maketitle
\MakeShortVerb{\|}

\section{Introduction}

One of the reasons why \TeX\ is still in use is that its abilities
in setting mathematical formulas are still unsurmounted. But there
are some nits to pick.

I propose a small set of extensions to \TeX\ to remove some deficiencies
in its handling of formulas.

\section{Implementation}

The implementation is split into a series of change files:

|accent.ch| implements three new primitives for nestable accents and
  under accents. To some extent these can be implemented in \TeX\ itself (see
  \AmSLaTeX), but macro solutions are complicated, slow and error-prone.
  \begin{description}
    \item[]|\mathaccent|\meta{15-bit number}\meta{math field} can now
      grok an extensible recipe at the end of a charlist. The extensible
      recipe is used to construct longer variants of an accent (in analogy
      to growing delimiters).
  \item[]|\nestingmathaccent|\meta{15-bit number}\meta{math field} is
    like |\math|\-|accent|, but it follows a chain of
    |\nesting|\-|math|\-|accent| or |\nesting|\-|math|\-|under|\-|accent|
    primitives to determine its accentee and the appropriate skew.
  \item[]|\mathunderaccent|\meta{15-bit number}\meta{math field}\\
    places an accent \emph{under} the \meta{math field}. It uses the
    \meta{accent}--\meta{accent} kerning to determine the vertical space
    between the \meta{math field} and the \meta{accent} and the
    \meta{skewchar}--\meta{accentee} kerning to determine the appropriate
    skew to the left.
    \item[]|\nestingmathunderaccent|\meta{15-bit number}%
      $\langle$\textit{math}\\\null\hfill\textit{field}$\rangle$\\
      is a variant of |\math|\-|under|\-|accent| which
      respects the nesting of accents.
  \end{description}

|cramp.ch| complements the |\display|\-|style|, \dots,
|\script|\-|script|\-|style| style-changing primitives by
|\cramped|\-|display|\-|style|, \dots, |\cramped|\-|script|\-|script|\-|style|
which change to the cramped styles.

|fraction.ch| continues to improve the math style-handling. It
      adds the following:
      \begin{description}
      \item[]|\mathstyle| is a special readonly integer parameter
        corresponding to the current math style according to the
        following table:

        \begin{tabular}{cc}
          \toprule
          math style&|\mathstyle|\\
          \midrule
          none& \llap{${}<{}$}0\\
          D&0\\
          D'&1\\
          T&2\\
          T'&3\\
          S&4\\
          S'&5\\
          SS&6\\
          SS'&7\\
          \bottomrule
        \end{tabular}

      \item[]|\fraction|\{\meta{math field}\} can be used to surround
        fractions. Its sole purpose is that |\mathstyle| reports the correct
        values in a subformula like |\fraction{...\over...}| while it fails to
        do so in |{...\over...}|.
      \end{description}

|radical.ch| implements the following new primitive:
      \begin{description}
      \item[]|\genradical|\meta{27-bit number}\meta{27-bit number}%
      $\langle$\textit{math}\\\null\hfill\textit{field}$\rangle$\\
      creates a radical with delimiters on both sides. By
        specifiying a nonexisting left delimiter, you can also create a
        right radical.
      \end{description}

\section{Installation}

 The change files are written for \TeX~3.1459. But it should need only
 cosmetic changes to get them to work with other versions of \TeX3.

 To make the change files for \TeX{} work, you have to apply the change file
 |pre.ch| first. I have only tried these files with |web2c|, and
 for that you need to surround the |web2c| change file with |pre-web2c.ch| and
 |post-web2c.ch|.

 All this boils down to the command line

\begin{verbatim}
mv tex.ch tex.ch.orig
tie -c tex.ch tex.web pre.ch accent.ch \
       cramp.ch fraction.ch radical.ch \
       pre-web2c.ch tex.ch.orig \
       post-web2c.ch
\end{verbatim}

 \makesignature

 \bibliographystyle{plain}
 \bibliography{etex}

\end{document}