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 ```
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
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
|
@ -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
|
||||
import random
|
||||
import math
|
||||
|
||||
n = 5
|
||||
xMin, yMin = 0, 0
|
||||
|
@ -16,25 +18,26 @@ for i in range(n):
|
|||
y = uniform(yMin, yMax)
|
||||
xSum += x
|
||||
ySum += y
|
||||
coordinates.append((x,y))
|
||||
coordinates.append((x, y))
|
||||
|
||||
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("}")
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
SOURCE = cubic-function-intermediate-value-theorem
|
||||
|
||||
DELAY = 80
|
||||
DENSITY = 300
|
||||
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
|
||||
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
|
||||
|
|
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
|
||||
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
|
||||
|
|
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
|
||||
|
||||
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/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 |