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 ```
|
@ -2,11 +2,11 @@ SOURCE = bellman-ford-algorithm
|
||||||
DELAY = 80
|
DELAY = 80
|
||||||
DENSITY = 300
|
DENSITY = 300
|
||||||
WIDTH = 512
|
WIDTH = 512
|
||||||
|
|
||||||
make:
|
make:
|
||||||
pdflatex $(SOURCE).tex -output-format=pdf
|
pdflatex $(SOURCE).tex -output-format=pdf
|
||||||
make clean
|
make clean
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -rf $(TARGET) *.class *.html *.log *.aux *.toc *.snm *.out *.nav
|
rm -rf $(TARGET) *.class *.html *.log *.aux *.toc *.snm *.out *.nav
|
||||||
|
|
||||||
|
@ -20,22 +20,20 @@ animatedGif:
|
||||||
pdfcrop $(SOURCE).pdf
|
pdfcrop $(SOURCE).pdf
|
||||||
convert -verbose -delay $(DELAY) -loop 0 -density $(DENSITY) $(SOURCE)-crop.pdf $(SOURCE).gif
|
convert -verbose -delay $(DELAY) -loop 0 -density $(DENSITY) $(SOURCE)-crop.pdf $(SOURCE).gif
|
||||||
make clean
|
make clean
|
||||||
|
|
||||||
transparentGif:
|
|
||||||
convert $(SOURCE).pdf -transparent white result.gif
|
|
||||||
make clean
|
|
||||||
|
|
||||||
png:
|
png:
|
||||||
make
|
make
|
||||||
make svg
|
make svg
|
||||||
inkscape $(SOURCE).svg -w $(WIDTH) --export-png=$(SOURCE).png
|
inkscape $(SOURCE).svg -w $(WIDTH) --export-png=$(SOURCE).png
|
||||||
|
|
||||||
|
transparentGif:
|
||||||
|
convert $(SOURCE).pdf -transparent white result.gif
|
||||||
|
make clean
|
||||||
|
|
||||||
svg:
|
svg:
|
||||||
make
|
|
||||||
#inkscape $(SOURCE).pdf --export-plain-svg=$(SOURCE).svg
|
#inkscape $(SOURCE).pdf --export-plain-svg=$(SOURCE).svg
|
||||||
pdf2svg $(SOURCE).pdf $(SOURCE).svg
|
pdf2svg $(SOURCE).pdf $(SOURCE).svg
|
||||||
# Necessary, as pdf2svg does not always create valid svgs:
|
# 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 $(WIDTH) -f svg $(SOURCE).svg -o $(SOURCE)2.svg
|
rsvg-convert -a -w 720 -f svg $(SOURCE)1.svg -o $(SOURCE).svg
|
||||||
inkscape $(SOURCE)2.svg --export-plain-svg=$(SOURCE).svg
|
rm $(SOURCE)1.svg
|
||||||
rm $(SOURCE)2.svg
|
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
TODO: Not ready, make ready!
|
|
6
tikz/bellman-ford-algorithm/README.md
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
TODO: Not ready, make ready!
|
||||||
|
|
||||||
|
|
||||||
|
Compiled example
|
||||||
|
----------------
|
||||||
|

|
Before Width: | Height: | Size: 63 KiB After Width: | Height: | Size: 63 KiB |
BIN
tikz/bellman-ford-algorithm/bellman-ford-algorithm.png
Normal file
After Width: | Height: | Size: 16 KiB |
|
@ -25,11 +25,9 @@ transparentGif:
|
||||||
make clean
|
make clean
|
||||||
|
|
||||||
svg:
|
svg:
|
||||||
make
|
|
||||||
#inkscape $(SOURCE).pdf --export-plain-svg=$(SOURCE).svg
|
#inkscape $(SOURCE).pdf --export-plain-svg=$(SOURCE).svg
|
||||||
pdf2svg $(SOURCE).pdf $(SOURCE).svg
|
pdf2svg $(SOURCE).pdf $(SOURCE).svg
|
||||||
# Necessary, as pdf2svg does not always create valid svgs:
|
# 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 $(WIDTH) -f svg $(SOURCE).svg -o $(SOURCE)2.svg
|
rsvg-convert -a -w 720 -f svg $(SOURCE)1.svg -o $(SOURCE).svg
|
||||||
inkscape $(SOURCE)2.svg --export-plain-svg=$(SOURCE).svg
|
rm $(SOURCE)1.svg
|
||||||
rm $(SOURCE)2.svg
|
|
||||||
|
|
3
tikz/center/README.md
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
Compiled example
|
||||||
|
----------------
|
||||||
|

|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 12 KiB |
|
@ -1,6 +1,8 @@
|
||||||
|
#!/usr/bin/env python
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
from random import uniform
|
from random import uniform
|
||||||
import random
|
import random
|
||||||
import math
|
|
||||||
|
|
||||||
n = 5
|
n = 5
|
||||||
xMin, yMin = 0, 0
|
xMin, yMin = 0, 0
|
||||||
|
@ -12,29 +14,30 @@ coordinates = []
|
||||||
random.seed(42)
|
random.seed(42)
|
||||||
|
|
||||||
for i in range(n):
|
for i in range(n):
|
||||||
x = uniform(xMin, xMax)
|
x = uniform(xMin, xMax)
|
||||||
y = uniform(yMin, yMax)
|
y = uniform(yMin, yMax)
|
||||||
xSum += x
|
xSum += x
|
||||||
ySum += y
|
ySum += y
|
||||||
coordinates.append((x,y))
|
coordinates.append((x, y))
|
||||||
|
|
||||||
center = (float(xSum) / n, float(ySum) / n)
|
center = (float(xSum) / n, float(ySum) / n)
|
||||||
|
|
||||||
cx, cy = center
|
cx, cy = center
|
||||||
pointCoords = ""
|
point_coords = ""
|
||||||
for p in coordinates:
|
for p in coordinates:
|
||||||
px, py = p
|
px, py = p
|
||||||
newP = "(%.2f,%.2f)," % (px, py)
|
new_p = "(%.2f,%.2f)," % (px, py)
|
||||||
pointCoords = newP + pointCoords
|
point_coords = new_p + point_coords
|
||||||
deltaY = cy-py
|
delta_y = cy-py
|
||||||
deltaX = cx-px
|
delta_x = cx-px
|
||||||
length = (deltaY**2+deltaX**2)**0.5
|
length = (delta_y**2+delta_x**2)**0.5
|
||||||
sinAlpha = deltaY/length
|
sin_alpha = delta_y/length
|
||||||
cosAlpha = deltaX/length
|
cos_alpha = delta_x/length
|
||||||
print("\draw[->] (%.2f,%.2f) -- (%.2f,%.2f);" % (px, py, px+cosAlpha*length*0.80, py+sinAlpha*length*0.80))
|
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("\\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("\\node[dot] at \point {};")
|
||||||
print("}")
|
print("}")
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
SOURCE = cubic-function-intermediate-value-theorem
|
SOURCE = cubic-function-intermediate-value-theorem
|
||||||
|
|
||||||
DELAY = 80
|
DELAY = 80
|
||||||
DENSITY = 300
|
DENSITY = 300
|
||||||
WIDTH = 500
|
WIDTH = 500
|
||||||
|
|
3
tikz/cubic-function-intermediate-value-theorem/README.md
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
Compiled example
|
||||||
|
----------------
|
||||||
|

|
After Width: | Height: | Size: 11 KiB |
|
@ -1,10 +1,9 @@
|
||||||
SOURCE = dirichlet-function
|
SOURCE = dirichlet-function
|
||||||
DELAY = 80
|
DELAY = 80
|
||||||
DENSITY = 300
|
DENSITY = 300
|
||||||
WIDTH = 500
|
WIDTH = 512
|
||||||
|
|
||||||
make:
|
make:
|
||||||
pdflatex $(SOURCE).tex -output-format=pdf
|
|
||||||
pdflatex $(SOURCE).tex -output-format=pdf
|
pdflatex $(SOURCE).tex -output-format=pdf
|
||||||
make clean
|
make clean
|
||||||
|
|
||||||
|
@ -29,4 +28,6 @@ svg:
|
||||||
#inkscape $(SOURCE).pdf --export-plain-svg=$(SOURCE).svg
|
#inkscape $(SOURCE).pdf --export-plain-svg=$(SOURCE).svg
|
||||||
pdf2svg $(SOURCE).pdf $(SOURCE).svg
|
pdf2svg $(SOURCE).pdf $(SOURCE).svg
|
||||||
# Necessary, as pdf2svg does not always create valid svgs:
|
# 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
|
||||||
|
|
3
tikz/dirichlet-function/README.md
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
Compiled example
|
||||||
|
----------------
|
||||||
|

|
BIN
tikz/dirichlet-function/dirichlet-function.png
Normal file
After Width: | Height: | Size: 28 KiB |
|
@ -1,15 +1,14 @@
|
||||||
SOURCE = jordan-normal-form
|
SOURCE = jordan-normal-form
|
||||||
DELAY = 80
|
DELAY = 80
|
||||||
DENSITY = 300
|
DENSITY = 300
|
||||||
WIDTH = 500
|
WIDTH = 512
|
||||||
|
|
||||||
make:
|
make:
|
||||||
pdflatex $(SOURCE).tex -output-format=pdf
|
|
||||||
pdflatex $(SOURCE).tex -output-format=pdf
|
pdflatex $(SOURCE).tex -output-format=pdf
|
||||||
make clean
|
make clean
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -rf $(TARGET) *.class *.html *.log *.aux
|
rm -rf $(TARGET) *.class *.html *.log *.aux *.data *.gnuplot
|
||||||
|
|
||||||
gif:
|
gif:
|
||||||
pdfcrop $(SOURCE).pdf
|
pdfcrop $(SOURCE).pdf
|
||||||
|
@ -29,4 +28,6 @@ svg:
|
||||||
#inkscape $(SOURCE).pdf --export-plain-svg=$(SOURCE).svg
|
#inkscape $(SOURCE).pdf --export-plain-svg=$(SOURCE).svg
|
||||||
pdf2svg $(SOURCE).pdf $(SOURCE).svg
|
pdf2svg $(SOURCE).pdf $(SOURCE).svg
|
||||||
# Necessary, as pdf2svg does not always create valid svgs:
|
# 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
|
||||||
|
|
3
tikz/jordan-normal-form/README.md
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
Compiled example
|
||||||
|
----------------
|
||||||
|

|
BIN
tikz/jordan-normal-form/jordan-normal-form.png
Normal file
After Width: | Height: | Size: 6.8 KiB |
|
@ -25,11 +25,9 @@ transparentGif:
|
||||||
make clean
|
make clean
|
||||||
|
|
||||||
svg:
|
svg:
|
||||||
make
|
|
||||||
#inkscape $(SOURCE).pdf --export-plain-svg=$(SOURCE).svg
|
#inkscape $(SOURCE).pdf --export-plain-svg=$(SOURCE).svg
|
||||||
pdf2svg $(SOURCE).pdf $(SOURCE).svg
|
pdf2svg $(SOURCE).pdf $(SOURCE).svg
|
||||||
# Necessary, as pdf2svg does not always create valid svgs:
|
# 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 $(WIDTH) -f svg $(SOURCE).svg -o $(SOURCE)2.svg
|
rsvg-convert -a -w 720 -f svg $(SOURCE)1.svg -o $(SOURCE).svg
|
||||||
inkscape $(SOURCE)2.svg --export-plain-svg=$(SOURCE).svg
|
rm $(SOURCE)1.svg
|
||||||
rm $(SOURCE)2.svg
|
|
||||||
|
|
3
tikz/resource-allocation-graph/README.md
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
Compiled example
|
||||||
|
----------------
|
||||||
|

|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 13 KiB |