5

I'm trying to modify the graphiso.sty package to show morphisms between directed graphs. This meant it should allow to show edges with arrows, I could do that. The thing is I now want to include loops, and make those loops move smoothly. So far I added the following to graphiso.sty:

\define@cmdkey [GR] {MLe} {dist}{}
\define@cmdkey [GR] {MLe} {dir}{}
\define@cmdkey [GR] {MLe} {shows}{}
\define@cmdkey [GR] {MLe} {starts}{}
\define@cmdkey [GR] {MLe} {stops}{}
\define@cmdkey [GR] {MLe} {arrow}{}
\presetkeys    [GR] {MLe} {dist      = 3cm,
                       dir       = WE,
                       shows     = 1,
                       starts    = 1,
                       stops     = 10,
                       arrow     = -}{} 
\newcommand{\LoopM}[2][]{%
 \begingroup
  \setkeys[GR]{MLe}{#1}%
  \pgfmathsetmacro{\last@still}{\cmdGR@MLe@starts-1}
  \foreach\x in {\cmdGR@MLe@shows,...,\last@still}{%
    \only<\x>{\Loop[dist {\cmdGR@MLe@dist},dir {\cmdGR@MLe@dir},style={thick,\cmdGR@MLe@arrow}](#2)}
  }
  \foreach\x in {\cmdGR@MLe@starts,...,\cmdGR@MLe@stops}{%
    \only<\x>{\Loop[dist {\cmdGR@MLe@dist},dir {\cmdGR@MLe@dir},style={thick,\cmdGR@MLe@arrow}](#2)}
  }
  \endgroup
}

I have two problems with my approache:

  1. I'm not able to modify the orientation of the loops even after writing something like \LoopM[dir=EA,arrow=->,shows=1,starts=4,stops=10]{I}.
  2. It doesn't allow the loops to change smoothly from one orientation to other one. Any clues as to how could I get that effect?

Edit: This is an example of what I got so far: enter image description here

which is generated by the following code:

 \documentclass{beamer}  
 \usepackage{tikz}  
 \usepackage{graphiso}
 \begin{document}  
 \begin{frame}{Homomorfismo de grafos}  
    \begin{figure}[h]  
        \begin{tikzpicture}[stop jumping]  
        \VertexM[xa=0,ya=0,xb=0,yb=3,shows=1,starts=4,stops=10]{I}  
        \VertexM[xa=0,ya=3,xb=3,yb=3,shows=1,starts=4,stops=10]{J}  
        \EdgeM[arrow=->,shows=1,starts=4,stops=10]{I}{J}  
        \LoopM[dir=EA,arrow=->,shows=1,starts=4,stops=10]{I}  
        \EdgeM[arrow=->,shows=1,starts=4,stops=10]{J}{I}  
    \end{tikzpicture}  
    \end{figure}  
 \end{frame}
 \end{document}

Your Answer

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

Browse other questions tagged or ask your own question.