k-5-schlinge.tex 960 B

1234567891011121314151617181920212223242526272829
  1. % A complete graph
  2. % Author: Quintin Jean-Noël
  3. % <http://moais.imag.fr/membres/jean-noel.quintin/>
  4. \documentclass[varwidth=true, border=2pt]{standalone}
  5. \usepackage[nomessages]{fp}% http://ctan.org/pkg/fp
  6. \usepackage{tikz}
  7. \usetikzlibrary[topaths]
  8. \tikzstyle{vertex}=[draw,fill=black,circle,minimum size=10pt,inner sep=0pt]
  9. \begin{document}
  10. \newcommand\n{5}
  11. \begin{tikzpicture}
  12. %the multiplication with floats is not possible. Thus I split the loop in two.
  13. \foreach \number in {1,...,\n}{
  14. \node[vertex] (N-\number) at ({\number*(360/\n)}:5.4cm) {};
  15. }
  16. \foreach \number in {1,...,\n}{
  17. \foreach \y in {1,...,\n}{
  18. \draw (N-\number) -- (N-\y);
  19. }
  20. \path (N-\number) edge[ out=140, in=50
  21. , looseness=0.8, loop
  22. , distance=2cm]
  23. node[above=3pt] {} (N-\number);
  24. }
  25. \end{tikzpicture}
  26. \end{document}