4

I know how can an arrow cross under another arrow in xymatrix (i.e. using |\hole). But how can it cross under an entry (e.g. wide textual entry). One solution would be to fill the box under the entry with white color. However it seems that only black color works in pdflatex, which seems weird. I don't really need colors, just white color so that the arrow doesn't intersect with the text. Minimal example follows.

\def \objectstyle {\hbox}
\xymatrix{
    short & short \ar@/_/[lddd] \\
    short & short \\
    long long long & short \\
    short
}
  • 1
    MWE, please.... – karlkoeller Mar 1 '14 at 11:08
  • @karlkoeller: Added. – user87690 Mar 1 '14 at 13:26
5

The idea of using a white background is good:

\documentclass{article}
\usepackage[all,cmtip]{xy}
\usepackage{color}
\begin{document}
\def \objectstyle {\hbox}
\xymatrix{
    short & short \ar@/_/[lddd] \\
    short & short \\
    \colorbox{white}{long long long} & short \\
    short
}
\end{document}

enter image description here

With “native” methods it would be something like

\documentclass{article}
\usepackage[all,cmtip]{xy}
\usepackage{color}
\begin{document}
\def \objectstyle {\hbox}
\xymatrix{
    short & short \ar@/_/[lddd] \\
    short & short \\
    *++[F*:white]{long long long} & short \\
    short
}
\end{document}

In both cases one has to pay attention to what object is drawn first; if the box is processed before the arrow, the white background will not make any difference.

| improve this answer | |
  • So the trick is in using color package. What a pity that xypic has support for very similar feature, but for this one you have to import color package just to get white. I wonder why one cannot draw white rectangles in default setting since even original TeX can draw black rectangles. – user87690 Mar 1 '14 at 14:18
  • @user87690 Xy-pic has basic support for colors, so maybe a similar solution exists with only Xy-pic methods; the documentation is not very clear about it. – egreg Mar 1 '14 at 14:27
  • Yes, there is syntax *[F*:white]{long long long} in xypic. But it just draws black box if color package is not loaded. – user87690 Mar 1 '14 at 14:38
  • @user87690 Yes, the package seems necessary. But I found the "native" syntax, I'll add to my answer. – egreg Mar 1 '14 at 14:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.