MAJOR=4
MINOR=48
DEVNAME=tty48
  8   3ˆl–ß=¿JJeJ qA3q§.•1hß�þZif€6C+/ˆ�ÏÒ…¬¶Ð?Ñ¿Ï ?÷     3% DIAGRAM MACROS (version 3.1)

\catcode`\@=11

%%%%% FIXING SOME PARAMETERS

%%% Fixing the printerresolution
%%% unit = 1 dpi
\newcount\printerresolution
\global\printerresolution=300

%%% Fixing the length of a segment in an arrowhead
%%% unit = 0.01pt
\newcount\headsize
\global\headsize=450

%%% Fixing the thickness of an arrowhead
%%% value = 1/5 of the font size
\font\dotfont = lcircle10 at 3pt

%%% Fixing the distance between the two heads of an epimorphism
%%% unit = 0.01pt
\newcount\epihead
\global\epihead=200

%%% Fixing the default scaling factor for diagrams
\newcount\defaultscale
\def\setdefaultscale#1{\global\defaultscale=#1}
\setdefaultscale{100}

\newcount\actualtextarrowspace
\newcount\actualtextarrowlength

% \computetextparameters computes the parameters
% required to design a text arrow
\newcommand{\computetextparameters}%
{\global\actualtextarrowspace=\textarrowlength%
\global\advance\actualtextarrowspace by 3%
\global\actualtextarrowlength=\textarrowlength%
\global\multiply\actualtextarrowlength by 100}

%%% Fixing the default length of text arrows
\newcount\textarrowlength
\def\settextarrowlength#1{\global\textarrowlength=#1%
\computetextparameters}
\settextarrowlength{20}

\newcount\actualdisplayarrowspace
\newcount\actualdisplayarrowlength

% \computedisplayparameters computes the parameters
% required to design a displayed arrow
\newcommand{\computedisplayparameters}%
{\global\actualdisplayarrowspace=\displayarrowlength%
\global\advance\actualdisplayarrowspace by 3%
\global\actualdisplayarrowlength=\displayarrowlength%
\global\multiply\actualdisplayarrowlength by 100}

%%% Fixing the default length of displayed arrows
\newcount\displayarrowlength
\def\setdisplayarrowlength#1{\global\displayarrowlength=#1%
\computedisplayparameters}
\setdisplayarrowlength{30}


% ERROR MESSAGES

% Checking the next token without gobbling blanks
\def\@ifnexttok#1#2#3{\let\@tempe #1\def\@tempa{#2}\def\@tempb{#3}%
\futurelet\@tempc\@ifntok}
\def\@ifntok{\ifx \@tempc \@tempe\let\@tempd\@tempa\else\let\@tempd\@tempb\fi%
\@tempd}

%  \@diagramerror{MSG}{HLP}: Types a Diagram error message MSG and gives an error
%                            halt with error help message HLP.
\def\@diagramerror#1#2{%
\edef\@@tempc{#2}\expandafter\errhelp\expandafter{\@@tempc}%
\typeout{Diagram error. \space See User's guide for explanation.^^J
 \space\@spaces\@spaces\@spaces Type \space H <return> \space for 
 immediate help.}\errmessage{#1}}

\newif\ifdiagram

% error test and message for text arrows 
\def\testtextmode{%
\ifdiagram\@diagramerror{Text arrows are not allowed in diagrams}{Here you
should use east or west diagram arrows, not forward or backward text arrows.
Try proceeding now, typeset could succeed but with unpredictable output.}
\else\ifmmode\relax\else%
\@diagramerror{Missing \string$}{Text arrows should be introduced in math mode.
Try proceeding now, typeset could succeed but output could not be what you expected.}\fi\fi}

% error test and message for diagram arrows
\def\testdiagrammode{\ifdiagram\relax\else
\@diagramerror{Diagram arrows are not allowed in formulas}{Here you
should use forward or backward text arrows, not diagram arrows. Proceeding
could work with unpredictable output, but overflow arithmetic
could also occur.}\fi}

% error test and message for diagrams in math mode
\def\checkmode{\ifmmode\@diagramerror{Wrong mode: no diagrams 
allowed in math mode.}{You should leave math mode before
introducing your diagram. All items in the diagram will automatically be
processed in math mode.}\else\relax\fi\global\diagramtrue}

\global\diagramfalse

%%%%% DESIGING THE ARROW HEADS

%%% Customizing the unitlength for the sake of precision
\setlength{\unitlength}{0.01pt}

%%% Printing one dot at the required scale
\def\DOT{{\dotfont q}}

%%% Computing the distance between two dots in an arrowhead
\newcount\basicstep
\basicstep=7227
\global\divide\basicstep by \printerresolution

%%% Computing the number of dots in an a