2
0
Fork 0
mirror of https://github.com/MartinThoma/LaTeX-examples.git synced 2025-04-26 06:48:04 +02:00
LaTeX-examples/presentations/Diskrete-Mathematik/LaTeX/graphs/k-5.tex

25 lines
708 B
TeX
Raw Normal View History

2013-04-18 08:57:48 +02:00
% A complete graph
% Author: Quintin Jean-Noël
% <http://moais.imag.fr/membres/jean-noel.quintin/>
\documentclass[varwidth=true, border=2pt]{standalone}
\usepackage[nomessages]{fp}% http://ctan.org/pkg/fp
\usepackage{tikz}
\usetikzlibrary[topaths]
\begin{document}
\newcommand\n{5}
\begin{tikzpicture}
%the multiplication with floats is not possible. Thus I split the loop in two.
\foreach \number in {1,...,\n}{
\node[vertex] (N-\number) at ({\number*(360/\n)}:5.4cm) {};
}
\foreach \number in {1,...,\n}{
\foreach \y in {1,...,\n}{
\draw (N-\number) -- (N-\y);
}
}
\end{tikzpicture}
\end{document}