mirror of
https://github.com/MartinThoma/LaTeX-examples.git
synced 2025-04-26 06:48:04 +02:00
added examples to presentation
This commit is contained in:
parent
9c8eceafc9
commit
34d97ac0cf
28 changed files with 772 additions and 8 deletions
40
presentations/Diskrete-Mathematik/LaTeX/graphs/graph-1.tex
Normal file
40
presentations/Diskrete-Mathematik/LaTeX/graphs/graph-1.tex
Normal file
|
@ -0,0 +1,40 @@
|
|||
\documentclass[varwidth=true, border=2pt]{standalone}
|
||||
\usepackage{tikz}
|
||||
\usetikzlibrary{arrows,positioning}
|
||||
\tikzset{
|
||||
%Define standard arrow tip
|
||||
>=stealth',
|
||||
% Define arrow style
|
||||
pil/.style={->,thick}
|
||||
}
|
||||
|
||||
\begin{document}
|
||||
\begin{tikzpicture}
|
||||
\node (a)[vertex] at (1,1) {};
|
||||
\node (b)[vertex] at (2,5) {};
|
||||
\node (c)[vertex] at (3,3) {};
|
||||
\node (d)[vertex] at (5,4) {};
|
||||
\node (e)[vertex] at (3,6) {};
|
||||
\node (f)[vertex] at (5,6) {};
|
||||
\node (g)[vertex] at (7,6) {};
|
||||
\node (h)[vertex] at (7,4) {};
|
||||
\node (i)[vertex] at (6,2) {};
|
||||
\node (j)[vertex] at (8,7) {};
|
||||
\node (k)[vertex] at (9,5) {};
|
||||
\node (l)[vertex] at (13,6) {};
|
||||
\node (m)[vertex] at (11,7) {};
|
||||
\node (n)[vertex] at (15,7) {};
|
||||
\node (o)[vertex] at (16,4) {};
|
||||
\node (p)[vertex] at (10,2) {};
|
||||
\node (q)[vertex] at (13,1) {};
|
||||
\node (r)[vertex] at (16,1) {};
|
||||
\node (s)[vertex] at (17,4) {};
|
||||
\node (t)[vertex] at (19,6) {};
|
||||
\node (u)[vertex] at (18,3) {};
|
||||
\node (v)[vertex] at (20,2) {};
|
||||
\node (w)[vertex] at (15,4) {};
|
||||
|
||||
\foreach \from/\to in {a/c,c/b,c/d,d/f,f/g,g/h,h/d,d/g,h/f,i/k,k/j,k/l,l/m,m/n,n/o,o/t,t/v,v/u,s/r,o/q,q/p,u/t}
|
||||
\draw[line width=2pt] (\from) -- (\to);
|
||||
\end{tikzpicture}
|
||||
\end{document}
|
24
presentations/Diskrete-Mathematik/LaTeX/graphs/graph-2.tex
Normal file
24
presentations/Diskrete-Mathematik/LaTeX/graphs/graph-2.tex
Normal file
|
@ -0,0 +1,24 @@
|
|||
\documentclass[varwidth=true, border=2pt]{standalone}
|
||||
\usepackage{tikz}
|
||||
\usetikzlibrary{arrows,positioning}
|
||||
\tikzset{
|
||||
%Define standard arrow tip
|
||||
>=stealth',
|
||||
% Define arrow style
|
||||
pil/.style={->,thick}
|
||||
}
|
||||
|
||||
\begin{document}
|
||||
\begin{tikzpicture}
|
||||
\node (a)[vertex] at (0,3) {};
|
||||
\node (b)[vertex] at (0,1) {};
|
||||
\node (c)[vertex] at (1,0) {};
|
||||
\node (d)[vertex] at (2,0) {};
|
||||
\node (e)[vertex] at (3,0) {};
|
||||
\node (f)[vertex] at (4,1) {};
|
||||
\node (g)[vertex] at (4,3) {};
|
||||
|
||||
\foreach \from/\to in {b/c,c/d,d/e,e/f}
|
||||
\draw[line width=2pt] (\from) -- (\to);
|
||||
\end{tikzpicture}
|
||||
\end{document}
|
24
presentations/Diskrete-Mathematik/LaTeX/graphs/graph-6.tex
Normal file
24
presentations/Diskrete-Mathematik/LaTeX/graphs/graph-6.tex
Normal file
|
@ -0,0 +1,24 @@
|
|||
% 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) {};
|
||||
}
|
||||
|
||||
\draw (N-1) -- (N-2);
|
||||
\draw (N-2) -- (N-3);
|
||||
\draw (N-3) -- (N-4);
|
||||
\draw (N-4) -- (N-5);
|
||||
\draw (N-5) -- (N-1);
|
||||
\end{tikzpicture}
|
||||
\end{document}
|
45
presentations/Diskrete-Mathematik/LaTeX/graphs/k-16.tex
Normal file
45
presentations/Diskrete-Mathematik/LaTeX/graphs/k-16.tex
Normal file
|
@ -0,0 +1,45 @@
|
|||
% A complete graph
|
||||
% Author: Quintin Jean-Noël
|
||||
% <http://moais.imag.fr/membres/jean-noel.quintin/>
|
||||
\documentclass[varwidth=true, border=2pt]{standalone}
|
||||
|
||||
\usepackage{tikz}
|
||||
\usetikzlibrary[topaths]
|
||||
|
||||
|
||||
\begin{document}
|
||||
|
||||
% A counter, since TikZ is not clever enough (yet) to handle
|
||||
% arbitrary angle systems.
|
||||
\newcount\mycount
|
||||
|
||||
\tikzstyle{vertexs}=[draw,fill=black,circle,minimum size=4pt,inner sep=0pt]
|
||||
|
||||
\begin{tikzpicture}
|
||||
%the multiplication with floats is not possible. Thus I split the loop in two.
|
||||
\foreach \number in {1,...,8}{
|
||||
% Computer angle:
|
||||
\mycount=\number
|
||||
\advance\mycount by -1
|
||||
\multiply\mycount by 45
|
||||
\advance\mycount by 0
|
||||
\node[draw,circle,inner sep=0.25cm] (N-\number) at (\the\mycount:5.4cm) {};
|
||||
}
|
||||
\foreach \number in {9,...,16}{
|
||||
% Computer angle:
|
||||
\mycount=\number
|
||||
\advance\mycount by -1
|
||||
\multiply\mycount by 45
|
||||
\advance\mycount by 22.5
|
||||
\node[draw,circle,inner sep=0.25cm] (N-\number) at (\the\mycount:5.4cm) {};
|
||||
}
|
||||
\foreach \number in {1,...,15}{
|
||||
\mycount=\number
|
||||
\advance\mycount by 1
|
||||
\foreach \numbera in {\the\mycount,...,16}{
|
||||
\path (N-\number) edge[->,bend right=3] (N-\numbera) edge[<-,bend
|
||||
left=3] (N-\numbera);
|
||||
}
|
||||
}
|
||||
\end{tikzpicture}
|
||||
\end{document}
|
20
presentations/Diskrete-Mathematik/LaTeX/graphs/k-3-3.tex
Normal file
20
presentations/Diskrete-Mathematik/LaTeX/graphs/k-3-3.tex
Normal file
|
@ -0,0 +1,20 @@
|
|||
\documentclass[varwidth=true, border=2pt]{standalone}
|
||||
\usepackage{tikz}
|
||||
\usetikzlibrary{arrows,positioning}
|
||||
|
||||
\begin{document}
|
||||
\tikzstyle{vertexs}=[draw,fill=black,circle,minimum size=4pt,inner sep=0pt]
|
||||
|
||||
\begin{tikzpicture}
|
||||
\foreach \x in {0,1,2}
|
||||
\foreach \y in {0,1,2}{
|
||||
\node (a)[vertexs] at (\y,0) {};
|
||||
\node (b)[vertexs] at (\x,1) {};
|
||||
\draw (a) -- (b);
|
||||
}
|
||||
% \foreach \x in {0,1,2}{
|
||||
% \draw (\x,0) circle (2pt);
|
||||
% \draw (\x,1) circle (2pt);
|
||||
% }
|
||||
\end{tikzpicture}
|
||||
\end{document}
|
24
presentations/Diskrete-Mathematik/LaTeX/graphs/k-5.tex
Normal file
24
presentations/Diskrete-Mathematik/LaTeX/graphs/k-5.tex
Normal file
|
@ -0,0 +1,24 @@
|
|||
% 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}
|
|
@ -0,0 +1,24 @@
|
|||
% 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}
|
||||
\node[vertex] (N-0) at (0:0) {};
|
||||
\foreach \number in {1,...,\n}{
|
||||
\node[vertex] (N-\number) at ({\number*(360/\n)}:5.4cm) {};
|
||||
}
|
||||
|
||||
\draw (N-0) -- (N-1);
|
||||
\draw (N-0) -- (N-2);
|
||||
\draw (N-0) -- (N-3);
|
||||
\draw (N-0) -- (N-4);
|
||||
\draw (N-0) -- (N-5);
|
||||
\end{tikzpicture}
|
||||
\end{document}
|
36
presentations/Diskrete-Mathematik/LaTeX/graphs/tree.tex
Normal file
36
presentations/Diskrete-Mathematik/LaTeX/graphs/tree.tex
Normal file
|
@ -0,0 +1,36 @@
|
|||
% 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}
|
||||
\node[vertex] (a) at (3,6) {};
|
||||
\node[vertex] (b) at (2,4) {};
|
||||
\node[vertex] (c) at (4,4) {};
|
||||
\node[vertex] (d) at (1,2) {};
|
||||
\node[vertex] (e) at (2,2) {};
|
||||
\node[vertex] (f) at (3,2) {};
|
||||
\node[vertex] (g) at (4,2) {};
|
||||
\node[vertex] (h) at (0,0) {};
|
||||
\node[vertex] (i) at (2,0) {};
|
||||
\node[vertex] (j) at (3,0) {};
|
||||
\node[vertex] (k) at (5,0) {};
|
||||
|
||||
\draw (a) -- (b);
|
||||
\draw (a) -- (c);
|
||||
\draw (b) -- (d);
|
||||
\draw (b) -- (e);
|
||||
\draw (b) -- (f);
|
||||
\draw (d) -- (h);
|
||||
\draw (d) -- (i);
|
||||
\draw (c) -- (g);
|
||||
\draw (g) -- (j);
|
||||
\draw (g) -- (k);
|
||||
\end{tikzpicture}
|
||||
\end{document}
|
Loading…
Add table
Add a link
Reference in a new issue