Re: [dk-tug] Tikz problem - pile ikke på linie

Martin Heller <[email protected]>
Newsgroups gmane.comp.tex.danish
Message-ID <[email protected]>
Lars Madsen wrote, on 26-01-2012 12:55:
>
> Nogen der har ideer til hvordan amn overtaler tikz til at sørge for at
> pilene i nedenstående regning holder samme retning.

Du kan fortælle TikZ at dine nodes skal have samme størrelse:

\documentclass[a4paper]{memoir}
\usepackage{tikz,amsmath,bm}
\usetikzlibrary{matrix,arrows}
\newcommand\nonedot{\bm\cdot}
\newcommand\order[1]{_{\scriptscriptstyle #1}}
\begin{document}

\begin{tikzpicture}
   \matrix (M) [%
   every node/.style={%
	minimum height=2em,
	minimum width=2em
   },
   matrix of math nodes,
   column sep=1.3em,
   row sep=1.3em
   ]
   {
     \nonedot          & \nonedot          & \nonedot         & \nonedot 
         & \nonedot          & \nonedot \\
     \frac51\order{10} & \nonedot          & \nonedot         & \nonedot 
         & \nonedot          & \nonedot \\
     \frac41\order{9}  & \frac42\order{11} & \nonedot         & \nonedot 
         & \nonedot          & \nonedot \\
     \frac31\order{4}  & \frac32\order{8}  & \frac33          & \nonedot 
         & \nonedot          & \nonedot \\
     \frac21\order{3}  & \frac22           & \frac23\order{7} & \frac24 
          & \nonedot          & \nonedot \\
     \frac11\order{1}  & \frac12\order{2}  & \frac13\order{5} & 
\frac14\order{6} & \frac15\order{12} & \nonedot \\
   };
   % oenskede 'retninger'
   \draw[dashed,thin,pink] (M-1-1) -- (M-6-6);
   \draw[dashed,thin,pink] (M-2-1) -- (M-6-5);
   \draw[dashed,thin,pink] (M-3-1) -- (M-6-4);
   \draw[dashed,thin,pink] (M-4-1) -- (M-6-3);
   \draw[dashed,thin,pink] (M-5-1) -- (M-6-2);

   \draw[->] (M-6-1) -- (M-6-2);
   \draw[->] (M-6-2) -- (M-5-1);
   \draw[->] (M-5-1) -- (M-4-1);
   \draw[->] (M-4-1) -- (M-5-2);
   \draw[->] (M-5-2) -- (M-6-3);
   \draw[->] (M-6-3) -- (M-6-4);
   \draw[->] (M-6-4) -- (M-5-3);
   \draw[->] (M-5-3) -- (M-4-2);
   \draw[->] (M-4-2) -- (M-3-1);
   \draw[->] (M-3-1) -- (M-2-1);
   \draw[->] (M-2-1) -- (M-3-2);
   \draw[->] (M-3-2) -- (M-4-3);
   \draw[->] (M-4-3) -- (M-5-4);
   \draw[->] (M-5-4) -- (M-6-5);
   \draw[->] (M-6-5) -- (M-6-6);
   \draw[->] (M-6-6) -- (M-5-5);
   \draw[->] (M-5-5) -- (M-4-4);
   \draw[->] (M-4-4) -- (M-3-3);
   \draw[->] (M-3-3) -- (M-2-2);
   \draw[->] (M-2-2) -- (M-1-1);
\end{tikzpicture}

\end{document}
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.