# [Xy-pic] bad positioning of an arrow tail

Abdó Roig abdo.roig at upc.edu
Mon Sep 15 11:01:10 CEST 2008

I have a problem with the positioning of an arrow tail using the
\xymatrix command in latex. The problem appears when I load the xypic
package and define the tail inside a custom package. I attach a couple
of examples.

The following code produces the expected result, an arrow of shape
>---->

File: test1.tex

\documentclass[a4paper,11pt]{article}

\usepackage[all]{xy}
\newdir{ >}{{}*!/-10pt/@{>}}

\begin{document}
$$\xymatrix{A \ar@{ >->}[d]\\ B}$$
\end{document}

But I want to include the \usepackage and \newdir commands inside a
custom package in order to avoid large preambles in my latex files. A
minimal example of this goes as follows:

File: testpkg.sty

\ProvidesPackage{testpkg}
\RequirePackage[all]{xy}
\newdir{ >}{{}*!/-10pt/@{>}}

File test2.tex

\documentclass[a4paper,11pt]{article}

\usepackage{testpkg}

\begin{document}
$$\xymatrix{A \ar@{ >->}[d]\\ B}$$
\end{document}

When I compile test2.tex the arrow tail is drawn shifted to the right
from the expected position.

Anyone has an idea of what is happening and how to solve it ?

Thank you very much.

Abdó.