Examples
<tex> \documentclass[tikz]{standalone} \usepackage{tikz} \begin{document}
\begin{tikzpicture} \draw (0,0) circle (10pt); \draw (0,0) .. controls (1,1) and (2,1) .. (2,0); \draw (0,0) ellipse (20pt and 10pt); \draw (0,0) rectangle (0.5,0.5); \filldraw[fill=green!20!white, draw=green!50!black](0,0) -- (3mm,0mm) arc (0:30:3mm) -- cycle; \end{tikzpicture}
\end{document} </tex>
<tex> \documentclass[tikz]{standalone} \usepackage{tikz} \begin{document}
\begin{tikzpicture} [every node/.style={fill=blue!30,draw=blue!70,rounded corners}, edge from parent/.style={blue,thick,draw}] \node {root} child {node {a1}} child {node {a2} child {node {b1}} child {node {b2}}} child {node {a3}}; \end{tikzpicture}
\end{document} </tex>
<tex> \documentclass[tikz]{standalone} \usepackage{tikz} \begin{document}
\begin{tikzpicture}[domain=0:4] \draw[very thin,color=gray] (-0.1,-1.1) grid (3.9,3.9); \draw[->] (-0.2,0) -- (4.2,0) node[right] {$x$}; \draw[->] (0,-1.2) -- (0,4.2) node[above] {$f(x)$}; \draw[color=red] plot (\x,\x) node[right] {$f(x) =x$}; \draw[color=blue] plot (\x,{sin(\x r)}) node[right] {$f(x) = \sin x$}; \draw[color=orange] plot (\x,{0.05*exp(\x)}) node[right] {$f(x) = \frac{1}{20} \mathrm e^x$};
\end{tikzpicture} \end{document} </tex>
<tex> \documentclass[tikz]{standalone} \usepackage{tikz} \begin{document}
\begin{tikzpicture}[domain=0:4] \draw[very thin,color=gray] (-0.1,-1.1) grid (3.9,3.9); \draw[->] (-0.2,0) -- (4.2,0) node[right] {$x$}; \draw[->] (0,-1.2) -- (0,4.2) node[above] {$f(x)$};
\draw (2,0)..controls (2,3)..(0,2); \draw (2,0)..controls (4,2)..(0,2); \draw[dotted] (2,0)..controls (4,2) and (2,3)..(0,2); \end{tikzpicture} \end{document} </tex>
<tex> % Poincaré Diagram: Classification of Phase Portraits in the (det A,Tr A)-plane % Author: Gernot Salzer, 22 Jan 2017 \documentclass[tikz,border=10pt]{standalone} \usetikzlibrary{decorations.markings}
\tikzset
{every pin/.style = {pin edge = {<-}}, % pins are arrows from label to point > = stealth, % arrow tips look like stealth bombers flow/.style = % everything marked as "flow" will be decorated with an arrow {decoration = {markings, mark=at position #1 with {\arrow{>}}}, postaction = {decorate} }, flow/.default = 0.5, % default position of the arrow is in the middle main/.style = {line width=1pt} % thick lines for main graph }
% \newtemplate[Scaling, default 0.18]{\NameOfTemplate}{Caption}{Code} % % Typesets Code and stores it in the box \NameOfTemplate. % This way we avoid nested tikzpictures when inserting the templates into the % main picture, since nesting is not guaranteed to work. \newcommand\newtemplate[4][0.18]%
{\newsavebox#2% \savebox#2% {\begin{tabular}{@{}c@{}} \begin{tikzpicture}[scale=#1] #4 \end{tikzpicture}\\[-1ex] \templatecaption{#3}\\[-1ex] \end{tabular}% }% }
\newcommand\template[1]{\usebox{#1}} % use the Code stored in box #1 \newcommand\templatecaption[1]Template:\sffamily\scriptsize % typeset caption \newcommand\Tr{\mathop{\mathrm{Tr}}}
\newtemplate\sink{sink}%
{\foreach \sx in {+,-} % for right/left half do: {\draw[flow] (\sx4,0) -- (0,0); % draw half of horizontal axis \draw[flow] (0,\sx4) -- (0,0); % draw half of vertical axis \foreach \sy in {+,-} % for upper/lower quadrant do: \foreach \a/\b in {2/1,3/0.44} % draw two half-parabolas \draw[flow,domain=\sx\a:0] plot (\x, {\sy\b*\x*\x}); } }
\newtemplate\source{source}%
{\foreach \sx in {+,-} % for right/left half do: {\draw[flow] (0,0) -- (\sx4,0); % draw half of horizontal axis \draw[flow] (0,0) -- (0,\sx4); % draw half of vertical axis \foreach \sy in {+,-} % for upper/lower quadrant do: \foreach \a/\b in {2/1,3/0.44} % draw two half-parabolas \draw[flow,domain=0:\sx\a] plot (\x, {\sy\b*\x*\x}); } }
\newtemplate\stablefp{line of stable fixed points}%
{\draw (-4,0) -- (4,0); % draw horizontal axis \foreach \sy in {+,-} % for upper/lower half do: {\draw[flow] (0,\sy4) -- (0,0); % draw half of vertical axis \foreach \x in {-3,-2,-1,1,2,3} % draw six vertical half-lines \draw[flow] (\x,\sy3) -- (\x,0); } }
\newtemplate\unstablefp{line of unstable fixed points}%
{\draw (-4,0) -- (4,0); % draw horizontal axis \foreach \sy in {+,-} % for upper/lower half do: {\draw[flow] (0,0) -- (0,\sy4); % draw half of vertical axis \foreach \x in {-3,-2,-1,1,2,3} % draw six vertical half-lines \draw[flow] (\x,0) -- (\x,\sy3); } }
\newtemplate\spiralsink{spiral sink}%
{\draw (-4,0) -- (4,0); % draw horizontal axis \draw (0,-4) -- (0,4); % draw vertical axis \draw [samples=100,smooth,domain=27:7] % draw spiral plot ({\x r}:{0.005*\x*\x}); % Using "flow" here gives "Dimension \def\x{26} % too large", so we draw a tiny \draw[->] ({\x r}:{0.005*\x*\x}) -- +(0.01,-0.01);% tangent for the arrow. }
\newtemplate\spiralsource{spiral source}%
{\draw (-4,0) -- (4,0); % draw horizontal axis \draw (0,-4) -- (0,4); % draw vertical axis \draw [samples=100,smooth,domain=10:28] % draw spiral plot ({-\x r}:{0.005*\x*\x}); % Using "flow" here gives "Dimension \def\x{27.5} % too large", so we draw a tiny \draw[<-] ({-\x r}:{0.005*\x*\x}) -- +(0.01,-0.008);% tangent for the arrow. }
\newtemplate[0.15]\centre{center}% British spelling since \center is in use
{\draw (-4,0) -- (4,0); % draw horizontal axis \draw (0,-4) -- (0,4); % draw vertical axis \foreach \r in {1,2,3} % draw three circles \draw[flow=0.63] (\r,0) arc (0:-360:\r cm); }
\newtemplate\saddle{saddle}%
{\foreach \sx in {+,-} % for right/left half do: {\draw[flow] (\sx4,0) -- (0,0); % draw half of horizontal axis \draw[flow] (0,0) -- (0,\sx4); % draw half of vertical axis \foreach \sy in {+,-} % for upper/lower quadrant do: \foreach \a/\b/\c/\d in {2.8/0.3/0.7/0.6, 3.9/0.4/1.3/1.1} \draw[flow] (\sx\a,\sy\b) % draw two bent lines .. controls (\sx\c,\sy\d) and (\sx\d,\sy\c) .. (\sx\b,\sy\a); } }
\newtemplate\degensink{degenerate sink}%
{\draw (0,-4) -- (0,4); % draw vertical axis \foreach \s in {+,-} % for upper/lower half do: {\draw[flow] (\s4,0) -- (0,0); % draw half of horizontal axis \foreach \a/\b/\c/\d in {3.5/4/1.5/1, 2.5/2/1/0.8} \draw[flow] (\s-3.5,\s\a) % draw two bent lines .. controls (\s\b,\s\c) and (\s\b,\s\d) .. (0,0); } }
\newtemplate\degensource{degenerate source}%
{\draw (0,-4) -- (0,4); % draw vertical axis \foreach \s in {+,-} % for upper/lower half do: {\draw[flow] (0,0) -- (\s4,0); % draw half of horizontal axis \foreach \a/\b/\c/\d in {3.5/4/1.5/1, 2.5/2/1/0.8} \draw[flow] (0,0) % draw two bent lines .. controls (\s\b,\s\d) and (\s\b,\s\c) .. (\s-3.5,\s\a); } }
\begin{document} \begin{tikzpicture}[line cap=round,line join=round]
% MAIN DIAGRAM \draw [main,->] (0,-0.3) -- (0,4.7) % vertical axis node [label={[above]$\scriptstyle\det A$}] {} node [label={[above,yshift=0.8cm]% {\sffamily\large Poincar\'e Diagram: Classification of Phase Portraits in the $(\det A,\Tr A)$-plane}}] {}; \draw [main,->] (-5,0) -- (5,0) % horizontal axis node [label={[right,yshift=-0.5ex]$\scriptstyle\Tr A$}] {}; \draw [main, domain=-4:4] plot (\x, {0.25*\x*\x}); % main graph \node at (-4,4) [pin={[above]$\scriptstyle\Delta=0$}] {}; \node at ( 4,4) [pin={[above,align=left]% {$\scriptstyle\Delta=0:\;\det A=\frac{1}{4}(\Tr A)^2$}}] {}; % TEMPLATES describing areas \node at ( 0 ,-1.4) {\template\saddle}; \node at (-4 , 1 ) {\template\sink}; \node at ( 4 , 1 ) {\template\source}; \node at (-1.8, 3.7) {\template\spiralsink}; \node at ( 1.8, 3.7) {\template\spiralsource}; % TEMPLATES labeling lines and points \node at ( 0 , 1.2) [pin={[draw,right,xshift=0.3cm]% \template\centre}] {}; \node at (-3 , 0 ) [pin={[draw,below,yshift=-1cm]% \template\stablefp}] {}; \node at ( 3 , 0 ) [pin={[draw,below,yshift=-1cm]% \template\unstablefp}] {}; \node at (-3.5,{0.25*3.5*3.5}) [pin={[draw,left,xshift=-1.15cm,yshift=-0.3cm]% \template\degensink}] {}; \node at ( 3.5,{0.25*3.5*3.5}) [pin={[draw,right,xshift=0.9cm,yshift=-0.3cm]% \template\degensource}] {}; \node at ( 0 , 0 ) [pin={[draw,above left,align=center,xshift=-0.3cm]% \templatecaption{uniform}\\[-1ex]\templatecaption{motion}}] {};
\end{tikzpicture} \end{document} </tex>
<tex>
\documentclass[tikz]{standalone}
\usetikzlibrary{arrows,chains,matrix,positioning,scopes,decorations.markings}
\usepackage{tikz}
\tikzstyle{vecArrow} = [thick, decoration={markings,mark=at position
1 with {\arrow[semithick]{open triangle 60}}}, double distance=1pt, shorten >= 4.5pt, preaction = {decorate}, postaction = {draw,line width=1pt, white,shorten >= 4.5pt}]
\tikzstyle{innerWhite} = [semithick, white,line width=1pt, shorten >= 4.5pt] \begin{document} \tikzstyle{block} = [draw,fill=blue!20,minimum size=2em] \def\radius{.7mm}
\begin{tikzpicture}[>=latex']
\draw (1,0) rectangle (5,-2); \node at (0,-1) (input1) {$A$}; \node[block] at (2,-1) (block1) {$X_1$}; \node[block] at (4,-1) (block2) {$X_2$}; \node at (2,1) (input0){$v_0$}; \draw[vecArrow] (input0) to (block1); \draw[->] (input1) to (block1); \draw[->] (block1) to (block2); \draw[->] (block2) -- +(1.5,0); \path[->] (block1) edge node[midway,above]{$B$} (block2);
\end{tikzpicture} \end{document} </tex>
<tex> \documentclass{standalone} \usepackage{tikz} \usetikzlibrary{circuits.logic.US} % TiKZ Library for US Logic Circuits. \begin{document} \begin{tikzpicture}[circuit logic US, every circuit symbol/.style={thick}]
\node[and gate,inputs={nnnnnnnnnnnnnnnnn}, point right] (A) at (2,-1) {} ; \node[and gate,inputs={nnnn}, point right] (B) at (1,-0.5) {$f$}; \draw (B.input 1 -| -0.5,0) -- (B.input 1); \node[and gate,inputs={normal,inverted,normal,normal},point right] (C) at (3,-1.5) {$g$}; \draw [red, very thick](C.input 4 -| -0.5,0) -- (C.input 4);
\path[draw] [green, very thick] (B.output) .. controls(2,-0.5) and (1.5,-1) ..(C.input 2); % \draw (C.output -| 5,0) -- (C.output); \path[draw] [green, very thick] (C.output) .. controls(4,-1.5) and (4,-1) ..(A.output);
\node[not gate, point down] (D) at (10,0) {}; \node[or gate,inputs={nnnn}, point down] (E) at (12,-2) {}; \node[buffer gate, point down,inputs={i}] (F) at (13,1.5){};
\draw [black,very thick] (D.input) -- ++(up:5mm) node [above]{$E_a$}; \draw [black,very thick] (F.input) -- ++(up:5mm) node [above]{$E_b$};
\draw [red, very thick] (D.output) -- ++(down:5.4mm) -| (E.input 4); \draw [blue, very thick] (F.output) -- ++(down:5.4mm) -| (E.input 1);
\draw (E.output) -- ++(down:5mm) node [below]{$Y_1$}; \end{tikzpicture} \end{document} </tex>
<tex> \documentclass{standalone} \usepackage{tikz} \usetikzlibrary{positioning} \tikzset{ %Define style for boxes
punkt/.style={ rectangle, rounded corners, draw=black, very thick, text width=2em, minimum height=2em, inner sep=2pt, text centered},
} \begin{document} \begin{tikzpicture}[node distance=1cm, auto,]
\draw[punkt] (-1,1) rectangle (4,-1); \node[punkt] (market) {f}; \node[punkt, right=2cm of market] (formidler) {g}; \draw (market) -- +(-1.5,0); \draw (market) to (formidler); \draw (formidler) -- +(1.5,0);
\end{tikzpicture}
\begin{tikzpicture}[node distance=1cm, auto,]
\draw[punkt] (-1,-2) rectangle (4,0); \node[punkt] (market2) at(0,-0.8) {f}; \node[punkt, right=2cm of market](formidler2) at(0.5,-1.4) {g}; \draw (market2) -- +(-1.5,0); \draw (formidler2) -- +(-4.5,0); \path[draw] [green, very thick] (market2) .. controls(0.5,-1)and (0.5,-0.8)..(formidler2); \draw (formidler2) -- +(1.5,0); \draw (market2) -- +(4.5,0);
\end{tikzpicture}
\end{document} </tex>