2

I need to draw a circle with n legs and one with n+2 legs. Usually I would connect to legs to the circle with the anchors. But north, north east, north west, etc... simple aren't enough. It looks oddish...

What can I do to make it look better?

\documentclass[utf8]{article} 
\usepackage{tikz} %For Drawing with pdflatex
\usetikzlibrary{decorations.markings} % For Arrow heads in the middle
\usetikzlibrary{decorations.text} % For text along path 
\usetikzlibrary{positioning} % For relative positioning
\usetikzlibrary{backgrounds} % For background layer
\usetikzlibrary{fit} % To make background fit
\usetikzlibrary{calc} % To calculate e.g. the distance between nodes
\usetikzlibrary{shapes} % more shapes   
\begin{figure}[h]
\centering
\resizebox{0.8 \linewidth}{!}{
\begin{tikzpicture}
\node[draw,circle, minimum size=1cm] (c1) {1L};
\node [above right=.5cm of c1.north east] (l1c1) {\tiny 1} 
edge [thick] node [] {} (c1.north east) ;
\node [above left=.5cm of c1.north west] (lnc1) {\tiny n} 
edge [thick] node [] {} (c1.north west) ;
\path [postaction={decorate,decoration={text along path, text=.....,text align/left indent={3cm}}}] (c1) circle (.7cm) ;
%
\node [right =.2cm of c1.east] (eq) {=} ;
%
\node[right=.2cm of eq.east,draw,circle, minimum size=1cm] (c2) {0L};
\node [above right=.5cm of c2.north east] (l1c2) {\tiny 1} 
edge [thick] node [] {} (c2.north east) ;
\node [above left=.5cm of c2.north west] (lnc2) {\tiny n} 
edge [thick] node [] {} (c2.north west) ;
\node [above left=.5cm of c2.north] (ll1c2) {\tiny $l_1$} 
edge [thick] node [] {} (c2.north) ;
\node [above right=.5cm of c2.north] (ll2c2) {\tiny $l_2$} 
edge [thick] node [] {} (c2.north) ;
\path [postaction={decorate,decoration={text along path, text=.....,text align/left indent={3cm}}}] (c2) circle (.7cm) ;

\end{tikzpicture}
}
\caption{The Ansatz for $A_n^+$}
\label{fig:nap}
\end{figure}

My attempt:

enter image description here

Werner
  • 603,163
rhedak
  • 23

1 Answers1

2

Instead of using north or north west and so on, you can just type the angle in degree behind the node name. For example (c2.95); in the example of yours. The anchor east is equal to 0 degree. The angles are defined in counter clockwise direction.

% arara: pdflatex

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{positioning,decorations.text}

\begin{document}
\begin{figure}[h]
\centering
\resizebox{0.8 \linewidth}{!}{
\begin{tikzpicture}
\node[draw,circle, minimum size=1cm] (c1) {1L};
\node [above right=.5cm of c1.north east] (l1c1) {\tiny 1} 
edge [thick] node [] {} (c1.north east) ;
\node [above left=.5cm of c1.north west] (lnc1) {\tiny n} 
edge [thick] node [] {} (c1.north west) ;
\path [postaction={decorate,decoration={text along path, text=.....,text align/left indent={3cm}}}] (c1) circle (.7cm) ;
%
\node [right =.2cm of c1.east] (eq) {=} ;
%
\node[right=.2cm of eq.east,draw,circle, minimum size=1cm] (c2) {0L};
\node [above right=.5cm of c2.north east] (l1c2) {\tiny 1} 
edge [thick] node [] {} (c2.north east) ;
\node [above left=.5cm of c2.north west] (lnc2) {\tiny n} 
edge [thick] node [] {} (c2.north west) ;
\node [above left=.5cm of c2.north] (ll1c2) {\tiny $l_1$} 
edge [thick] node [] {} (c2.95); % adapt angle to your needs!
\node [above right=.5cm of c2.north] (ll2c2) {\tiny $l_2$} 
edge [thick] node [] {} (c2.85); % adapt angle to your needs!
\path [postaction={decorate,decoration={text along path, text=.....,text align/left indent={3cm}}}] (c2) circle (.7cm) ;

\end{tikzpicture}
}
\caption{The Ansatz for $A_n^+$}
\label{fig:nap}
\end{figure}
\end{document}

enter image description here

A second possibility is to shift the anchor manually. Not very beautiful but can be handsome in some cases (For a circle node not that much...). This could look like edge [thick] node [] {} ([xshift=-1.4mm, yshift=-3mm]c1.north west);

Third possibility is to define the lines start point and angle and to calculate the end with help of \usetikzlibrary{calc,intersections}. But I guess this is a bit too much here. You can search the side for examples on this.

LaRiFaRi
  • 43,807
  • Thank you very much. It works just fine. Do you also have a tip for how I can make the ..... go right below the circle? – rhedak Jul 11 '14 at 12:44
  • @rhedak sorry, I never used decoartions sou you may have another question for this. No time to try that now. – LaRiFaRi Jul 11 '14 at 14:14