diff --git a/tikz/exponential-functions-gif/Makefile b/tikz/exponential-functions-gif/Makefile new file mode 100644 index 0000000..3a98e99 --- /dev/null +++ b/tikz/exponential-functions-gif/Makefile @@ -0,0 +1,37 @@ +SOURCE = exponential-functions-gif +DELAY = 40 +DENSITY = 300 +WIDTH = 1000 + +make: + pdflatex $(SOURCE).tex -output-format=pdf + make clean + +clean: + rm -rf $(TARGET) *.class *.html *.log *.aux *.data *.gnuplot *.toc *.snm *.nav *.out + +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 + +animatedGif: + make + pdfcrop $(SOURCE).pdf + convert -verbose -delay $(DELAY) -loop 0 -density $(DENSITY) $(SOURCE)-crop.pdf $(SOURCE).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/exponential-functions-gif/README.md b/tikz/exponential-functions-gif/README.md new file mode 100644 index 0000000..f7578c2 --- /dev/null +++ b/tikz/exponential-functions-gif/README.md @@ -0,0 +1,3 @@ +Compiled example +---------------- +![Example](exponential-functions-gif.png) diff --git a/tikz/exponential-functions-gif/exponential-functions-gif.tex b/tikz/exponential-functions-gif/exponential-functions-gif.tex new file mode 100644 index 0000000..5d4670d --- /dev/null +++ b/tikz/exponential-functions-gif/exponential-functions-gif.tex @@ -0,0 +1,41 @@ +\documentclass[varwidth=false, border=2pt]{beamer} + +\usepackage{tikz,pgfplots,multido} +\pgfplotsset{compat=1.17} +\usepackage{nicefrac} +\pgfplotsset{every axis legend/.append style={ +at={(0,0)}, +anchor=north east}} + +\usepackage[active,tightpage]{preview} +\PreviewEnvironment{tikzpicture} +\begin{document} +\multido{\i=0+1}{10}{% +\begin{tikzpicture} + \begin{axis}[ + axis x line=middle, + axis y line=middle, + grid = major, + width=16cm, + height=8cm, + grid style={dashed, gray!30}, + xmin=-2.1, % start the diagram at this x-coordinate + xmax= 4.1, % end the diagram at this x-coordinate + ymin= 0, % start the diagram at this y-coordinate + ymax= 17, % end the diagram at this y-coordinate + xlabel=$x$, + ylabel=$y$, + ytick={0,2,3,4,8,9,12,16}, + yticklabels={0,2,3,4,8,9,12,16}, + legend cell align=left, + legend pos=south east, + legend style={draw=none}, + tick align=outside, + enlargelimits=false] + % plot the function + \addplot[domain=-2:{4*\i/10}, red, ultra thick,samples=500] {2^x}; + \end{axis} +\end{tikzpicture} +} + +\end{document} diff --git a/tikz/linear-functions/Makefile b/tikz/linear-functions/Makefile new file mode 100644 index 0000000..7765c32 --- /dev/null +++ b/tikz/linear-functions/Makefile @@ -0,0 +1,31 @@ +SOURCE = linear-functions +DELAY = 80 +DENSITY = 300 +WIDTH = 500 + +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: + #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/linear-functions/README.md b/tikz/linear-functions/README.md new file mode 100644 index 0000000..399261e --- /dev/null +++ b/tikz/linear-functions/README.md @@ -0,0 +1,3 @@ +Compiled example +---------------- +![Example](linear-functions.png) diff --git a/tikz/linear-functions/linear-functions.png b/tikz/linear-functions/linear-functions.png new file mode 100644 index 0000000..1e11b81 Binary files /dev/null and b/tikz/linear-functions/linear-functions.png differ diff --git a/tikz/linear-functions/linear-functions.tex b/tikz/linear-functions/linear-functions.tex new file mode 100644 index 0000000..ea2b0a2 --- /dev/null +++ b/tikz/linear-functions/linear-functions.tex @@ -0,0 +1,37 @@ +\documentclass[varwidth=false, border=2pt]{standalone} + +\usepackage{pgfplots} +\usepackage{tikz} +\usepackage{nicefrac} +\pgfplotsset{every axis legend/.append style={ +at={(0,0)}, +anchor=north east}} + +\begin{document} +\begin{tikzpicture} + \begin{axis}[ + axis x line=middle, + axis y line=middle, + grid = major, + width=8cm, + height=8cm, + grid style={dashed, gray!30}, + xmin=-5, % start the diagram at this x-coordinate + xmax= 5, % end the diagram at this x-coordinate + ymin=-5, % start the diagram at this y-coordinate + ymax= 5, % end the diagram at this y-coordinate + xlabel=x, + ylabel=y, + legend cell align=left, + legend pos=south east, + legend style={draw=none}, + tick align=outside, + enlargelimits=false] + % plot the function + \addplot[domain=-5:5, red, ultra thick,samples=500] {0.5*x}; + \addplot[domain=-5:5, green!50!black, ultra thick,dashed,samples=500] {x}; + \addplot[domain=-5:5, blue, ultra thick,dotted,samples=500] {2*x}; + \legend{$\nicefrac{1}{2} \cdot x$,$x$,$2 \cdot x$} + \end{axis} +\end{tikzpicture} +\end{document}