# Using the \newarrow command from Taylor's commutative diagrams package

I want to define new arrows to use in a commutative diagram, but I just can't make it work. The documentation is not particularly helpful; it doesn't even tell you where to put the

\newarrow{Name}{tail}{filler}{middle}{filler}{head}


bit for example. Even when TeX stops complaining about how I've defined the arrow, it won't use it; the undefined control sequence error comes up whenever I try and use the arrow. The error message suggests using the PostScript Option, but that also doesn't work. Any ideas?

(For now, I'll try and use a different diagrams tool, but I'd really like to know how to get this to work.) Any help would be much appreciated.

Edit: After doing what Stefan's answer suggested, I'm now trying

\documentclass[a4paper,10pt]{report}
(other packages)
\usepackage[small,nohug]{diagrams}
\diagramstyle[labelstyle=\scriptstyle]
\newarrowtail{-}
\newarrow{Dots}{-}...{-}
(other pramle etc)
\begin{document}
(blah)
\begin{diagram}
A & \rDots & B
\end{diagram}
(blah)
\end{document}


which works (in so much as TeX now produces the desired diagrams), but now it says:

LaTeX Error: missing \begin{document} ... \newarrow{Dots}{-} ...{-}

So presumably is has a problem with the arrowhead being a -? How to fix that?

(I'm trying to get an arrow looking something like - \cdots - to intidacate an infinite line (currently it just looks like \cdots, but that's fine I suppose).

-
Welcome to {TeX}! A tip: If you indent lines by 4 spaces, then they are marked as a code sample. You can also highlight the code and click the "code" button (with "101010" on it). –  Stefan Kottwitz Mar 14 '11 at 18:17
Here's a link to the package: ctan.org/tex-archive/macros/generic/diagrams/taylor –  Hendrik Vogt Mar 14 '11 at 18:17
The command works fine for me - you can put it everywhere as long as you declare the arrow before you use it in a diagram. I suspect it's a very specific problem - which programs do you use in order to compile your input file (latex,pdflatex,dvips,...)? –  diabonas Mar 14 '11 at 19:04
The problem is caused by \newarrowhead and \newarrowtail. It seems that they take hidden arguments, such as \newarrowhead{triangle}\rhtriangle\lhtriangle\dhtriangle\uhtriangle. I would not use a package with unusual syntax and incomplete documentation. –  Stefan Kottwitz Mar 14 '11 at 20:46
Right, I'll just use \newarrow{Dots}{.}{.}{.}{.}{.} –  David K Mar 14 '11 at 21:27

Here's a minimal example. It defines an arrow called SuperArrow. It uses the arrow to the right by putting \r right before the arrow name.

Global definitions should be done in the preamble, after the required package.

\documentclass{article}
\usepackage{diagrams}
\newarrow{SuperArrow}{>>}...{>>}
\usepackage{amsmath}
\begin{document}
$A \rTo^{\text{ very long arrow }} B$

$A \rSuperArrow^{\text{ very long arrow }} B$
\end{document}


Note: you should correctly install the package. It's published as diagrams.tex, download it, save it into your texmf tree or besides your document and load it by \input{diagrams}, or rename it to diagrams.sty and load it by \usepackage{diagrams}.

-
Thanks very much. Your example certainly works, but when I put my arrow definition after \usepackage{diagrams}, TeX complains that \begin{document} is missing (even though it still produces the arrow as I'd like it to). @diabonas: I'm using pdflatex. –  David K Mar 14 '11 at 19:28
@user4190: your comment is incomplete, perhaps you pressed the enter key too early. You could edit it or post a new comment. –  Stefan Kottwitz Mar 14 '11 at 19:29
(yes, I just wanted to start a new line - shift + enter?) –  David K Mar 14 '11 at 19:32
@David K: you could edit your question to add a minimal example, like I did in my answer, that illustrates your problem. –  Stefan Kottwitz Mar 14 '11 at 19:40
Kottwitz: I have edited my original question as requested. –  David K Mar 14 '11 at 20:32