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.

I'm trying to make a nice state diagram with some arrows

I cannot find a way to make the arrows pointing to the same state: in my case, I would like a self-refering arrow to altcache

I'm not fixed about the fancybox, but it would nicely fit in the rest of the thesis.

Thanks a lot for your help

Here is an example of code and the result:

enter image description here

I just need a circle dashed arrow at altcache...


\documentclass{article}
\usepackage{amstext}
\usepackage{fancybox}
\usepackage[all]{xy}

\newcommand{\boxsize}{1.4in}
\newcommand{\state}[1]%
  {\doublebox{\text{\begin{minipage}{\boxsize}\centering #1\end{minipage}}}}
\newcommand{\switch}[1]%
  {\ovalbox{\text{\begin{minipage}{\boxsize}\centering #1\end{minipage}}}}

\begin{document}

\xymatrix{
\switch{lscache} \ar@{.>}[d] \ar@{.>}[rdd] &  &\\
\switch{tccache} \ar@{.>}[rd] & & \\
\switch{altcache} & \ar@{.>}[l] \switch{cache}  & \\
}

\end{document}
share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

You can specify the exit/entrance directions by adding @(out,in) to the arrow command, where in and out are two direction specifiers (ul, dl, ur, dr, etc.). In order to create a circular arrow above the box altcache, add @(ul,ur):

\xymatrix{
  \switch{lscache}  \ar@{.>}[d] \ar@{.>}[rdd] & &\\
  \switch{tccache}  \ar@{.>}[rd]     & & \\
  \switch{altcache} \ar@{.>}@(ul,ur) & \ar@{.>}[l] \switch{cache}  & 
}

enter image description here

share|improve this answer
    
Wonderful: thanks a lot! –  Louis May 29 '12 at 7:12
    
You're welcome. :) –  Martin May 29 '12 at 10:21
add comment

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.