<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">\title{On specialist typesetting packages}
\author[David Murphy]{David Murphy\\University of Birmingham}

\begin{article}
\makeatletter
\input diag.sty
\makeatother
\special{header=pspic.pro}
\setlength{\diagramcellsize}{8em}

\noindent  Over the last two years I have been involved in the development
of a commuting diagrams package for \LaTeX. This article is based on my
experience of that work. It is meant neither to be read as distilled
wisdom, nor as a provocation, but rather as a basis for discussion of
the kinds of packages users `should' be provided with.

\section*{Introduction}

Some of my work uses category theory: this is a branch of mathematics
which makes extensive use of commuting diagrams, Figure~\ref{symmoncoh}
being a typical example.
\begin{figure*}
\centering
  \begin{diagram*}(1.6,1.75)(-1.2,-0.05) %(-0.8,-0.05)
   \object(0,0){(A \otimes B) \otimes (C \otimes D)}
   \object(0.809017,0.587785){((A \otimes B) \otimes C) \otimes D}
   \rightobject(0.5,1.538841){(A \otimes (B \otimes C)) \otimes D}
   \leftobject(-0.5,1.538841){A \otimes ((B \otimes C) \otimes D)}
   \object(-0.809017,0.587785){A \otimes (B \otimes (C \otimes D))}
   \Farrow(-0.4,     1.538779)( 0.4,     1.538779)
   \Farrow( 0.080902,0.058778)( 0.728116,0.529006)
   \Farrow(-0.728116,0.529006)(-0.080901,0.058778)
   \Farrow( 0.530901,1.443736)( 0.778116,0.682891)
   \Farrow(-0.530901,1.443736)(-0.778116,0.682891)
  \end{diagram*}
  \caption{Coherence for monoidal categories}
  \label{symmoncoh}
 \end{figure*}

There are various commuting diagrams packages available to \TeX~and
\LaTeX\ users; both Michael Barr (McGill Unversity) and Paul Taylor
(Imperial College) distribute popular ones.
 However, all popular current packages use \TeX 's \verb"line" founts,
so it is impossible to achieve a diagram with pentagonal symmetry such
as Figure~\ref{symmoncoh}. 
 Furthermore, both Barr's and Taylor's packages share what is, I find,
a common problem amongst \TeX~shareware, namely that easy things are
easy to achieve, but difficult things, such as Figure~\ref{twocat},
require an intimate knowledge of the package's workings.
 Indeed, I was spurred to work on my own diagram macros by my inability
to understand Taylor's code or to obtain the diagram I wanted from his
package.

I was very lucky in finding a solid base to build upon: Sean Bechhofer
(Manchester University) had already implemented a rudimentary commuting
diagrams package based on a \verb"picture"-like environment which
compiled arrows directly as PostScript~\verb"\special"s.
 I had merely to extend his work, rewrite the \verb"\special"s to work
with \verb"dvips",  ensure that his environment interacted reasonably
sensibly with the rest of \LaTeX, and generally tidy up the code.
 The result is a package capable of producing diagrams such as
Figure~\ref{twocat} of reasonable quality and complexity.
 \setlength{\diagramcellsize}{6em}
 \begin{figure*}
  \begin{diagram*}(2,2.4)(0,-0.2)
   \object(0,1){A}
   \object(1,1){B}
   \object(1,2){C}
   \object(1,0){D}
   \object(2,1){{\mathbf{Cat}}}

   \curvearrow(1,1){\east}[i]{\po}
   \curvearrow(1,1){\east}[j]{\st}

   \twocell(1,1){\east}{\clock}[\alpha][\far]

   \twocell(0,1){\eneast}{\clock}[\eta_1][\far]
   \twocell(0,1){\eseast}{\clock}[\eta_2][\far]

   \plarrow(0,1){\neast}[f_1][\po]
   \plarrow(0,1){\east}[f][\st]
   \plarrow(0,1){\seast}[f_2][\st]
   \plarrow(1,2){\south}[\lambda_{f_i}][\po]
   \plarrow(1,1){\south}[\lambda_{f_j}][\po]
  \end{diagram*}
  \caption{A simple two-categorical diagram}
  \label{twocat}
 \end{figure*}
 \begin{figure*}

\begin{footnotesize}
  \begin{verbatim}
\begin{diagram*}(2,2)
\object(0,1){A}
\object(1,1){B}
\object(1,2){C}
\object(1,0){D}
\object(2,1){{\bf Cat}}

\curvearrow(1,1){\east}[i]{\po}
\curvearrow(1,1){\east}[j]{\st}

\twocell(1,1){\east}{\clock}[\alpha][\far]

\twocell(0,1){\eneast}{\clock}[\eta_1][\far]
\twocell(0,1){\eseast}{\clock}[\eta_2][\far]

\plarrow(0,1){\neast}{f_1}[\po]
\plarrow(0,1){\east}{f}[\st]
\plarrow(0,1){\seast}{f_2}[\st]
\plarrow(1,2){\south}[\lambda_{f_i}][\po]
\plarrow(1,1){\south}[\lambda_{f_j}][\po]
\end{diagram*}
\end{verbatim}
\end{footnotesize}
  \caption{The code for the two-categorical diagram shown in Figure
           \protect\ref{twocat}}
  \label{syntax}
 \end{figure*}

\section*{What's Wrong?}

The package I produced, based on Bechhofer's work, has several
manifest disadvantages:
\begin{itemize}
\item It works exclusively with PostScript printers and
\verb"dvips". There are a substantial number of \LaTeX~users without
access to these facilities.
\item The syntax I have adopted, as the code which produces
Figure~\ref{twocat} (shown in Figure~\ref{syntax}) makes clear,
is fairly ad hoc and ill-chosen.
\item There is a considerable jump in complexity between simple
rectangular diagrams and more complex ones. This is wholly due
to the difficulty of doing standard trigonometry in \TeX. If
I could perform fairly simple numerical calculations without
descending to the PostScript level, users would have to think
rather less hard about the relative positions and dimensions
of diagram objects. Some hand-tuning is always going to be
necessary in a complex graphical environment, but more automation
should be possible than I have provided.
\end{itemize}

My real concern in this article is how much do these problems
matter? I do not doubt that the problems I have outlined above make my 
macros entirely unacceptable as a standard package; if something like
\verb"multicol" suffered from similar problems, no one would use it. 
However, there is a big difference between carefully-designed packages 
like \verb"multicol", which must work in a wide range of circumstances
and with a wide range of users, and a specialist package like my own which
is designed for a small community of relatively skilled users. For the moment
I am willing and able to continue to support the package, but this may not 
always be the case. Is it reasonable to ask people to use software for which
no support guarantee can be given? 

My suspicion is that there are rather a lot of packages like mine:
medium-sized, badly-written pieces of code with a small but basically
satisfied user base. Is this a good thing? These users are not numerous 
enough to be able to command high-quality software to meet their
needs: not enough people are interested in commuting diagrams for a 
diagrams package to be a sensible addition to standard \LaTeX. (Opinions
differ on this point: Barr is currently working on a package that may
come as standard with \LaTeX~3.) Must the category theorist, then,
always be content with software such as mine? 
More generally, what is the best way for the specialist typographical 
needs of a small community to be met? I hope that these questions will
find some answers in the current debate over the future of \TeX.

\end{article}

</pre></body></html>