2
0
Fork 0
mirror of https://github.com/MartinThoma/LaTeX-examples.git synced 2025-04-19 11:38:05 +02:00

Add README.md and rendered image to 6 tikz examples

The examples were found by

```bash
$ find . -type d '!' -exec test -e "{}/README.md" ';' -print
```
This commit is contained in:
Martin Thoma 2015-11-20 08:11:29 +01:00
parent 7732da4f39
commit 6364e13a6a
21 changed files with 67 additions and 47 deletions

View file

@ -21,21 +21,19 @@ animatedGif:
convert -verbose -delay $(DELAY) -loop 0 -density $(DENSITY) $(SOURCE)-crop.pdf $(SOURCE).gif
make clean
transparentGif:
convert $(SOURCE).pdf -transparent white result.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
inkscape $(SOURCE).svg --export-width=$(WIDTH) --export-plain-svg=$(SOURCE)1.svg
rsvg-convert -a -w 720 -f svg $(SOURCE)1.svg -o $(SOURCE).svg
rm $(SOURCE)1.svg

View file

@ -1 +0,0 @@
TODO: Not ready, make ready!

View file

@ -0,0 +1,6 @@
TODO: Not ready, make ready!
Compiled example
----------------
![Example](bellman-ford-algorithm.gif)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 63 KiB

After

Width:  |  Height:  |  Size: 63 KiB

Before After
Before After

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

View file

@ -25,11 +25,9 @@ transparentGif:
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
inkscape $(SOURCE).svg --export-width=$(WIDTH) --export-plain-svg=$(SOURCE)1.svg
rsvg-convert -a -w 720 -f svg $(SOURCE)1.svg -o $(SOURCE).svg
rm $(SOURCE)1.svg

3
tikz/center/README.md Normal file
View file

@ -0,0 +1,3 @@
Compiled example
----------------
![Example](center.png)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Before After
Before After

View file

@ -1,6 +1,8 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from random import uniform
import random
import math
n = 5
xMin, yMin = 0, 0
@ -21,20 +23,21 @@ for i in range(n):
center = (float(xSum) / n, float(ySum) / n)
cx, cy = center
pointCoords = ""
point_coords = ""
for p in coordinates:
px, py = p
newP = "(%.2f,%.2f)," % (px, py)
pointCoords = newP + pointCoords
deltaY = cy-py
deltaX = cx-px
length = (deltaY**2+deltaX**2)**0.5
sinAlpha = deltaY/length
cosAlpha = deltaX/length
print("\draw[->] (%.2f,%.2f) -- (%.2f,%.2f);" % (px, py, px+cosAlpha*length*0.80, py+sinAlpha*length*0.80))
new_p = "(%.2f,%.2f)," % (px, py)
point_coords = new_p + point_coords
delta_y = cy-py
delta_x = cx-px
length = (delta_y**2+delta_x**2)**0.5
sin_alpha = delta_y/length
cos_alpha = delta_x/length
print("\draw[->] (%.2f,%.2f) -- (%.2f,%.2f);" %
(px, py, px + cos_alpha*length*0.80, py + sin_alpha*length*0.80))
print("\\node[circle,inner sep=1pt,fill] at (%.2f,%.2f) {};" % (cx, cy))
print("\\foreach \point in {" + pointCoords + "}{")
print("\\foreach \point in {" + point_coords + "}{")
print("\\node[dot] at \point {};")
print("}")

View file

@ -1,4 +1,5 @@
SOURCE = cubic-function-intermediate-value-theorem
DELAY = 80
DENSITY = 300
WIDTH = 500

View file

@ -0,0 +1,3 @@
Compiled example
----------------
![Example](cubic-function-intermediate-value-theorem.png)

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

View file

@ -1,10 +1,9 @@
SOURCE = dirichlet-function
DELAY = 80
DENSITY = 300
WIDTH = 500
WIDTH = 512
make:
pdflatex $(SOURCE).tex -output-format=pdf
pdflatex $(SOURCE).tex -output-format=pdf
make clean
@ -29,4 +28,6 @@ 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
inkscape $(SOURCE).svg --export-width=$(WIDTH) --export-plain-svg=$(SOURCE)1.svg
rsvg-convert -a -w 720 -f svg $(SOURCE)1.svg -o $(SOURCE).svg
rm $(SOURCE)1.svg

View file

@ -0,0 +1,3 @@
Compiled example
----------------
![Example](dirichlet-function.png)

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

View file

@ -1,15 +1,14 @@
SOURCE = jordan-normal-form
DELAY = 80
DENSITY = 300
WIDTH = 500
WIDTH = 512
make:
pdflatex $(SOURCE).tex -output-format=pdf
pdflatex $(SOURCE).tex -output-format=pdf
make clean
clean:
rm -rf $(TARGET) *.class *.html *.log *.aux
rm -rf $(TARGET) *.class *.html *.log *.aux *.data *.gnuplot
gif:
pdfcrop $(SOURCE).pdf
@ -29,4 +28,6 @@ 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
inkscape $(SOURCE).svg --export-width=$(WIDTH) --export-plain-svg=$(SOURCE)1.svg
rsvg-convert -a -w 720 -f svg $(SOURCE)1.svg -o $(SOURCE).svg
rm $(SOURCE)1.svg

View file

@ -0,0 +1,3 @@
Compiled example
----------------
![Example](jordan-normal-form.png)

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

View file

@ -25,11 +25,9 @@ transparentGif:
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
inkscape $(SOURCE).svg --export-width=$(WIDTH) --export-plain-svg=$(SOURCE)1.svg
rsvg-convert -a -w 720 -f svg $(SOURCE)1.svg -o $(SOURCE).svg
rm $(SOURCE)1.svg

View file

@ -0,0 +1,3 @@
Compiled example
----------------
![Example](resource-allocation-graph.png)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Before After
Before After