diff --git a/tikz/markov-chain-rain-sun/Makefile b/tikz/markov-chain-rain-sun/Makefile new file mode 100644 index 0000000..f53d5be --- /dev/null +++ b/tikz/markov-chain-rain-sun/Makefile @@ -0,0 +1,35 @@ +SOURCE = markov-chain-rain-sun +DELAY = 80 +DENSITY = 300 +WIDTH = 512 + +make: + pdflatex $(SOURCE).tex -output-format=pdf + make clean + +clean: + rm -rf $(TARGET) *.class *.html *.log *.aux *.data *.gnuplot + +gif: + pdfcrop $(SOURCE).pdf + convert -verbose -delay $(DELAY) -loop 0 -density $(DENSITY) $(SOURCE)-crop.pdf $(SOURCE).gif + make clean + +png: + make + make svg + inkscape $(SOURCE).svg -w $(WIDTH) --export-png=$(SOURCE).png + +transparentGif: + convert $(SOURCE).pdf -transparent white result.gif + make clean + +svg: + make + #inkscape $(SOURCE).pdf --export-plain-svg=$(SOURCE).svg + pdf2svg $(SOURCE).pdf $(SOURCE).svg + # Necessary, as pdf2svg does not always create valid svgs: + inkscape $(SOURCE).svg --export-plain-svg=$(SOURCE).svg + rsvg-convert -a -w $(WIDTH) -f svg $(SOURCE).svg -o $(SOURCE)2.svg + inkscape $(SOURCE)2.svg --export-plain-svg=$(SOURCE).svg + rm $(SOURCE)2.svg diff --git a/tikz/markov-chain-rain-sun/README.md b/tikz/markov-chain-rain-sun/README.md new file mode 100644 index 0000000..7e4371a --- /dev/null +++ b/tikz/markov-chain-rain-sun/README.md @@ -0,0 +1,3 @@ +Compiled example +---------------- +![Example](markov-chain-rain-sun.png) diff --git a/tikz/markov-chain-rain-sun/markov-chain-rain-sun.tex b/tikz/markov-chain-rain-sun/markov-chain-rain-sun.tex new file mode 100644 index 0000000..e9cda52 --- /dev/null +++ b/tikz/markov-chain-rain-sun/markov-chain-rain-sun.tex @@ -0,0 +1,19 @@ +\documentclass[varwidth=true, border=2pt]{standalone} +\usepackage{units} +\usepackage{ifthen} +\usepackage{tikz} +\usetikzlibrary{calc} + +\begin{document} +\tikzstyle{vertex}=[draw,black,fill=blue,circle,minimum size=10pt,inner sep=0pt] +\tikzstyle{edge}=[very thick] +\begin{tikzpicture}[scale=2.5] + \node (a)[vertex,fill=gray!10,align=left] at (0,0) {S}; + \node (b)[vertex,fill=gray!10,align=left] at (1,0) {R}; + + \path[thick,->,bend left] (a) edge node [anchor=center,above,sloped] {$\nicefrac{2}{10}$} (b); + \path[thick,->,bend left] (b) edge node [anchor=center,below,sloped] {$\nicefrac{4}{10}$} (a); + \path[thick,->] (a) edge[loop left, looseness=15] node [anchor=center,above] {$\nicefrac{8}{10}$} (a); + \path[thick,->] (b) edge[loop right, looseness=15] node [anchor=center,above] {$\nicefrac{6}{10}$} (b); +\end{tikzpicture} +\end{document}