Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Xypic offers many placement and formatting options for labels, including rotation.

However, I can't get this last feature to work correctly.

I have two problems with this:

  • with some inclinations the label won't be correctly shifted sideway (see the downleft arrow below)
  • with some inclinations the label won't be correctly placed in the length of the arrow (see the left arrow below)

Problem

The normal aspect of the arrow being :

How the arrow should look like

MWE:

\documentclass[a4paper,12pt]{article}
\usepackage[all]{xy}

\newcommand{\bijar}[1][]{%
    \ar[#1]
    \ar@<0.7ex>@{}[#1]|-*[@]{\sim}} 
          % Arrow for a
          % bijective mapping

\begin{document}

\[\xymatrix{
&&&& \\ 
&&&& \\
&& {\bullet}
  \bijar[rr]
  \bijar[uurr]
  \bijar[uu]
  \bijar[uull]
  \bijar[ll]
  \bijar[ddll]
  \bijar[dd]
  \bijar[ddrr]
&& \\
&&&& \\
&&&&
}\]

\end{document}

Some comments about the code: I draw this arrow in 2 arrows, one being only the arrow and the second one being an empty arrow, shifted by the desired dimension, and actually supporting the label. The reason I use that instead of regular labels is that it allows me to specify the distance between the label and the arrow. Also, I don't think it can be the problem. After all, sideway-shifted arrows are exactly in front of their normal position, they aren't shifted backward or forward.

I'm using xy-pic 3.8.6 with pdflatex.

Edit : After reading this question, I came up with the following definition of the macro:

\newcommand{\bijar}[1][]{%
  \ar[#1]
  \ar@<0.7ex>@{}[#1]|-*@{~}} 
     % Arrow for a
     % bijective mapping

It indeed solves both of the above problems, but as you can see on the picture below, there is another problem appearing on "standard" directions :

Problem2

The other problem is that it works for this because \sim can be imitated by sloped arrow body, but for other arrows like open or closed immersions, this hack wouldn't work.

share|improve this question
    
The curious thing is that I get the correct result with Xy-pic v. 3.8.5; I'll try later with the more recent version. –  egreg Dec 20 '11 at 17:30
2  
I can confirm that it's a bug introduced in v. 3.8.6 –  egreg Dec 20 '11 at 18:00
    
The version history mentions only a bug fix for color support in xypdf at 3.8.6... I guess I could downgrade without breaking any of my diagrams, but honestly, that's much of a hassle. Maybe it is an intentional change that has been made and that requires the user to change the syntax? –  T. Verron Dec 20 '11 at 21:33

1 Answer 1

up vote 2 down vote accepted

After playing a while with the misc. parameters, I found out that the following code works :

\newcommand{\bijar}[1][]{%
 \ar[#1]
 \ar@<0.7ex>@{}[#1]|-*=0[@]{\sim}} 
      % Arrow for a
      % bijective mapping

It seems the placement is a problem with the rotating functions, which are acting on the whole object (including its frame). Resizing it to zero fixes the issue.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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