From b7cec5fb0bec941f3798d651f0bf8d6a64dd6785 Mon Sep 17 00:00:00 2001 From: Martin Thoma Date: Thu, 9 Aug 2012 11:48:39 +0200 Subject: [PATCH] added more examples; added links to README --- README.md | 6 ++- tikz/earth-skizze-2/Makefile | 31 +++++++++++++++ tikz/earth-skizze-2/earth-skizze-2.tex | 55 ++++++++++++++++++++++++++ tikz/earth-skizze/Makefile | 31 +++++++++++++++ tikz/earth-skizze/earth-skizze.tex | 40 +++++++++++++++++++ 5 files changed, 162 insertions(+), 1 deletion(-) create mode 100644 tikz/earth-skizze-2/Makefile create mode 100644 tikz/earth-skizze-2/earth-skizze-2.tex create mode 100644 tikz/earth-skizze/Makefile create mode 100644 tikz/earth-skizze/earth-skizze.tex diff --git a/README.md b/README.md index 3aa2b6e..0e59aff 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,8 @@ LaTeX-examples ============== -Examples for the usage of LaTeX \ No newline at end of file +Examples for the usage of LaTeX + +Most examples can be found on [my Wikpedia Commons user page](http://commons.wikimedia.org/wiki/User:MartinThoma#Galerie) + +You might also be interested in [my Blog](http://martin-thoma.com/tag/tikz/) diff --git a/tikz/earth-skizze-2/Makefile b/tikz/earth-skizze-2/Makefile new file mode 100644 index 0000000..3d6e3f4 --- /dev/null +++ b/tikz/earth-skizze-2/Makefile @@ -0,0 +1,31 @@ +SOURCE = earth-skizze-2 +DELAY = 80 +DENSITY = 300 +WIDTH = 500 + +make: + pdflatex $(SOURCE).tex -output-format=pdf + make clean + +clean: + rm -rf $(TARGET) *.class *.html *.log *.aux + +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: + #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 diff --git a/tikz/earth-skizze-2/earth-skizze-2.tex b/tikz/earth-skizze-2/earth-skizze-2.tex new file mode 100644 index 0000000..0639e5f --- /dev/null +++ b/tikz/earth-skizze-2/earth-skizze-2.tex @@ -0,0 +1,55 @@ +\documentclass{article} + +\usepackage{xcolor} +\definecolor{sky}{HTML}{AAEEEE} +\definecolor{lgreen}{HTML}{77DD11} + +\usepackage[pdftex,active,tightpage]{preview} +\setlength\PreviewBorder{2mm} +\usepackage{tikz} +\usetikzlibrary{calc, decorations.pathmorphing, decorations.text} + +\begin{document} +\begin{preview} +\begin{tikzpicture}[scale=3.5,dot/.style={circle,fill=black,minimum size=4pt,inner sep=0pt, + outer sep=-1pt}] + \draw[fill=sky!20] (180:1.2cm) arc (180:0:1.2cm); + \draw[fill=brown!20] (180:1cm) arc (180:0:1cm); + \draw (-1.2cm,0) -- node {} (1.2cm, 0); + \draw (0,0) -- node {} (0, 1cm); + \node at (0,1.1cm) {N} ; + + \coordinate (DEnd) at (0.867cm,0.5cm) ; + \draw[dashed] (-0.86cm,0.5cm) -- node[above] {} (DEnd); + + \node[above] at (-0.4cm, 0.45cm) {25. Breitengrad}; + \node[above, text width=1cm] at (0.15cm, 0.5cm) {\scriptsize Burdsch\\Chalifa}; + \node[above, text width=1cm] at (0.7cm, 0.5cm) {\scriptsize Mileiha}; + + \path [decorate, + decoration={ + text along path, + text={6370 km}, + text align={align=center} + } + ] (0,0) -- (DEnd); + \draw (0,0) -- node {} (DEnd); + \draw[arrows={stealth-stealth}] (-1cm,-0.05cm) -- node[below] {6370 km} (0,-0.05cm); + + \node[dot, lgreen] at (0.2cm,0.5cm) (S) {}; + \node[dot, lgreen] at (0.5cm,0.5cm) (E) {}; + + + + \draw[lgreen, thick] (S) -- node {} (E); + + \begin{scope}[shift={(DEnd)}] + \draw[fill=gray!20] (0,0) -- (180:0.3cm) arc (180:210:0.3cm); + \draw (195:0.2cm) node {$\scriptstyle 25^\circ$}; + \end{scope} + + + +\end{tikzpicture} +\end{preview} +\end{document} diff --git a/tikz/earth-skizze/Makefile b/tikz/earth-skizze/Makefile new file mode 100644 index 0000000..547bc3f --- /dev/null +++ b/tikz/earth-skizze/Makefile @@ -0,0 +1,31 @@ +SOURCE = earth-skizze +DELAY = 80 +DENSITY = 300 +WIDTH = 500 + +make: + pdflatex $(SOURCE).tex -output-format=pdf + make clean + +clean: + rm -rf $(TARGET) *.class *.html *.log *.aux + +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: + #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 diff --git a/tikz/earth-skizze/earth-skizze.tex b/tikz/earth-skizze/earth-skizze.tex new file mode 100644 index 0000000..7575b87 --- /dev/null +++ b/tikz/earth-skizze/earth-skizze.tex @@ -0,0 +1,40 @@ +\documentclass{article} + +\usepackage{xcolor} +\definecolor{sky}{HTML}{AAEEEE} + +\usepackage[pdftex,active,tightpage]{preview} +\setlength\PreviewBorder{2mm} +\usepackage{tikz} +\usetikzlibrary{calc} + +\begin{document} +\begin{preview} +\begin{tikzpicture}[scale=1.2] + \draw[fill=sky] (0, 0) circle (1.5cm); + \draw[fill=brown] (0, 0) circle (1cm); + + %tangente + \begin{scope}[shift={(-1.35cm,0)}, rotate=48] + \draw (0,0) -- node {} (2.5cm, 0); + \end{scope} + + \draw (0,0) -- node {} (0, 1.5cm); + \draw (0,0) -- node[anchor=east] {$r$} (138:1cm); + + % angle + \draw[fill=gray!30] (0,0) -- (138:0.75cm) arc (138:90:0.75cm); + \draw (110:0.5cm) node {$\varphi$}; + + % winkelbogen + \draw[lime] (138:1cm) arc (138:90:1cm); + \node[lime] at (-0.2,0.85) {$x$} ; + + % height + \draw[blue] (0,1cm) -- node[anchor=west] {$h$} (0, 1.5cm); + + \node at (0,-0.2) {Erde} ; + +\end{tikzpicture} +\end{preview} +\end{document}