Skip to content

Commit 2de9065

Browse files
committed
Add README.md and rendered png to all folders except for /documents
The examples were found by ```bash $ find . -not -path '*/\.*' -type d '!' -exec test -e "{}/README.md" ';' -print ``` To do so, a cleanup-script .meta/add_readme.py was created.
1 parent de1ad26 commit 2de9065

File tree

154 files changed

+483
-171
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

154 files changed

+483
-171
lines changed

.gitattributes

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
*.gif diff=image
2+
*.jpg diff=image
3+
*.png diff=image

.meta/add_readme.py

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#!/usr/bin/env python
2+
3+
import os
4+
from os import listdir
5+
from os.path import isfile, join
6+
7+
import logging
8+
import sys
9+
10+
logging.basicConfig(format='%(asctime)s %(levelname)s %(message)s',
11+
level=logging.DEBUG,
12+
stream=sys.stdout)
13+
14+
15+
def create_readme(directory):
16+
project_name = os.path.basename(directory)
17+
onlyfiles = [f.lower()
18+
for f in listdir(directory)
19+
if isfile(join(directory, f))]
20+
if ('%s.tex' % project_name) not in onlyfiles:
21+
logging.warning("Dir '%s' has no standard .tex filename.", directory)
22+
return
23+
text = "Compiled example\n"
24+
text += "----------------\n"
25+
text += "![Example](%s.png)\n" % project_name
26+
with open(os.path.join(directory, "README.md"), 'w') as f:
27+
f.write(text)
28+
os.system("make png -C %s" % directory)
29+
30+
subdirs = [x[0] for x in os.walk('.')]
31+
subdirs = [f for f in subdirs
32+
if not any([True for e in f.split('/')
33+
if e.startswith('.') and len(e) > 1])]
34+
for subdir in subdirs:
35+
onlyfiles = [f.lower() for f in listdir(subdir) if isfile(join(subdir, f))]
36+
if 'readme.md' not in onlyfiles:
37+
create_readme(subdir)
+3

documents/eaz/Makefile

+27-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,33 @@
11
SOURCE = eaz
2+
DELAY = 80
3+
DENSITY = 300
4+
WIDTH = 512
5+
26
make:
37
pdflatex $(SOURCE).tex -output-format=pdf
48
make clean
59

610
clean:
7-
rm -rf $(TARGET) *.class *.html *.log *.aux *.out
11+
rm -rf $(TARGET) *.class *.html *.log *.aux *.data *.gnuplot
12+
13+
gif:
14+
pdfcrop $(SOURCE).pdf
15+
convert -verbose -delay $(DELAY) -loop 0 -density $(DENSITY) $(SOURCE)-crop.pdf $(SOURCE).gif
16+
make clean
17+
18+
png:
19+
make
20+
make svg
21+
inkscape $(SOURCE).svg -w $(WIDTH) --export-png=$(SOURCE).png
22+
23+
transparentGif:
24+
convert $(SOURCE).pdf -transparent white result.gif
25+
make clean
26+
27+
svg:
28+
#inkscape $(SOURCE).pdf --export-plain-svg=$(SOURCE).svg
29+
pdf2svg $(SOURCE).pdf $(SOURCE).svg
30+
# Necessary, as pdf2svg does not always create valid svgs:
31+
inkscape $(SOURCE).svg --export-width=$(WIDTH) --export-plain-svg=$(SOURCE)1.svg
32+
rsvg-convert -a -w 720 -f svg $(SOURCE)1.svg -o $(SOURCE).svg
33+
rm $(SOURCE)1.svg

documents/eaz/README.md

+3

documents/eaz/eaz.pdf

-77 Bytes
Binary file not shown.

documents/eaz/eaz.png

48.7 KB

documents/size/Makefile

+27-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,33 @@
11
SOURCE = size
2+
DELAY = 80
3+
DENSITY = 300
4+
WIDTH = 512
25

36
make:
4-
pdflatex $(SOURCE).tex -output-format=pdf # first run for the aux file
5-
makeindex $(SOURCE) # now the index is generated
6-
pdflatex $(SOURCE).tex -output-format=pdf # pdf with index :-)
7+
pdflatex $(SOURCE).tex -output-format=pdf
78
make clean
89

910
clean:
10-
rm -rf $(TARGET) *.class *.html *.log *.aux *.out *.ind *.idx *.ilg *.toc *.bbl *.blg *.pyg
11+
rm -rf $(TARGET) *.class *.html *.log *.aux *.data *.gnuplot
12+
13+
gif:
14+
pdfcrop $(SOURCE).pdf
15+
convert -verbose -delay $(DELAY) -loop 0 -density $(DENSITY) $(SOURCE)-crop.pdf $(SOURCE).gif
16+
make clean
17+
18+
png:
19+
make
20+
make svg
21+
inkscape $(SOURCE).svg -w $(WIDTH) --export-png=$(SOURCE).png
22+
23+
transparentGif:
24+
convert $(SOURCE).pdf -transparent white result.gif
25+
make clean
26+
27+
svg:
28+
#inkscape $(SOURCE).pdf --export-plain-svg=$(SOURCE).svg
29+
pdf2svg $(SOURCE).pdf $(SOURCE).svg
30+
# Necessary, as pdf2svg does not always create valid svgs:
31+
inkscape $(SOURCE).svg --export-width=$(WIDTH) --export-plain-svg=$(SOURCE)1.svg
32+
rsvg-convert -a -w 720 -f svg $(SOURCE)1.svg -o $(SOURCE).svg
33+
rm $(SOURCE)1.svg

documents/size/README.md

+3

documents/size/size.pdf

-65 Bytes
Binary file not shown.

documents/size/size.png

15.6 KB
+1

images/basic/Makefile

+27-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,34 @@
11
SOURCE = basic
2+
DELAY = 80
3+
DENSITY = 300
4+
WIDTH = 512
25

36
make:
7+
pdflatex $(SOURCE).tex -output-format=pdf
48
pdflatex $(SOURCE).tex -output-format=pdf
59
make clean
610

711
clean:
8-
rm -rf $(TARGET) *.class *.html *.log *.aux *.out *.ind *.idx *.ilg *.toc *.bbl *.blg *.pyg
12+
rm -rf $(TARGET) *.class *.html *.log *.aux *.data *.gnuplot
13+
14+
gif:
15+
pdfcrop $(SOURCE).pdf
16+
convert -verbose -delay $(DELAY) -loop 0 -density $(DENSITY) $(SOURCE)-crop.pdf $(SOURCE).gif
17+
make clean
18+
19+
png:
20+
make
21+
make svg
22+
inkscape $(SOURCE).svg -w $(WIDTH) --export-png=$(SOURCE).png
23+
24+
transparentGif:
25+
convert $(SOURCE).pdf -transparent white result.gif
26+
make clean
27+
28+
svg:
29+
#inkscape $(SOURCE).pdf --export-plain-svg=$(SOURCE).svg
30+
pdf2svg $(SOURCE).pdf $(SOURCE).svg
31+
# Necessary, as pdf2svg does not always create valid svgs:
32+
inkscape $(SOURCE).svg --export-width=$(WIDTH) --export-plain-svg=$(SOURCE)1.svg
33+
rsvg-convert -a -w 720 -f svg $(SOURCE)1.svg -o $(SOURCE).svg
34+
rm $(SOURCE)1.svg

images/basic/README.md

+1

images/float/Makefile

+26-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,33 @@
11
SOURCE = float
2+
DELAY = 80
3+
DENSITY = 300
4+
WIDTH = 512
25

36
make:
47
pdflatex $(SOURCE).tex -output-format=pdf
58
make clean
69

710
clean:
8-
rm -rf $(TARGET) *.class *.html *.log *.aux *.out *.ind *.idx *.ilg *.toc *.bbl *.blg *.pyg
11+
rm -rf $(TARGET) *.class *.html *.log *.aux *.data *.gnuplot
12+
13+
gif:
14+
pdfcrop $(SOURCE).pdf
15+
convert -verbose -delay $(DELAY) -loop 0 -density $(DENSITY) $(SOURCE)-crop.pdf $(SOURCE).gif
16+
make clean
17+
18+
png:
19+
make
20+
make svg
21+
inkscape $(SOURCE).svg -w $(WIDTH) --export-png=$(SOURCE).png
22+
23+
transparentGif:
24+
convert $(SOURCE).pdf -transparent white result.gif
25+
make clean
26+
27+
svg:
28+
#inkscape $(SOURCE).pdf --export-plain-svg=$(SOURCE).svg
29+
pdf2svg $(SOURCE).pdf $(SOURCE).svg
30+
# Necessary, as pdf2svg does not always create valid svgs:
31+
inkscape $(SOURCE).svg --export-width=$(WIDTH) --export-plain-svg=$(SOURCE)1.svg
32+
rsvg-convert -a -w 720 -f svg $(SOURCE)1.svg -o $(SOURCE).svg
33+
rm $(SOURCE)1.svg

images/float/README.md

+3

images/float/float.png

60.9 KB

images/scaling/Makefile

+26-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,33 @@
11
SOURCE = scaling
2+
DELAY = 80
3+
DENSITY = 300
4+
WIDTH = 512
25

36
make:
47
pdflatex $(SOURCE).tex -output-format=pdf
58
make clean
69

710
clean:
8-
rm -rf $(TARGET) *.class *.html *.log *.aux *.out *.ind *.idx *.ilg *.toc *.bbl *.blg *.pyg
11+
rm -rf $(TARGET) *.class *.html *.log *.aux *.data *.gnuplot
12+
13+
gif:
14+
pdfcrop $(SOURCE).pdf
15+
convert -verbose -delay $(DELAY) -loop 0 -density $(DENSITY) $(SOURCE)-crop.pdf $(SOURCE).gif
16+
make clean
17+
18+
png:
19+
make
20+
make svg
21+
inkscape $(SOURCE).svg -w $(WIDTH) --export-png=$(SOURCE).png
22+
23+
transparentGif:
24+
convert $(SOURCE).pdf -transparent white result.gif
25+
make clean
26+
27+
svg:
28+
#inkscape $(SOURCE).pdf --export-plain-svg=$(SOURCE).svg
29+
pdf2svg $(SOURCE).pdf $(SOURCE).svg
30+
# Necessary, as pdf2svg does not always create valid svgs:
31+
inkscape $(SOURCE).svg --export-width=$(WIDTH) --export-plain-svg=$(SOURCE)1.svg
32+
rsvg-convert -a -w 720 -f svg $(SOURCE)1.svg -o $(SOURCE).svg
33+
rm $(SOURCE)1.svg

images/scaling/README.md

+3

images/scaling/scaling.png

228 KB

images/side-by-side-subfig/Makefile

+26-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,34 @@
11
SOURCE = side-by-side-subfig
2+
DELAY = 80
3+
DENSITY = 300
4+
WIDTH = 512
25

36
make:
47
pdflatex $(SOURCE).tex -output-format=pdf
58
pdflatex $(SOURCE).tex -output-format=pdf
69
make clean
710

811
clean:
9-
rm -rf $(TARGET) *.class *.html *.log *.aux *.out *.ind *.idx *.ilg *.toc *.bbl *.blg *.pyg
12+
rm -rf $(TARGET) *.class *.html *.log *.aux *.data *.gnuplot
13+
14+
gif:
15+
pdfcrop $(SOURCE).pdf
16+
convert -verbose -delay $(DELAY) -loop 0 -density $(DENSITY) $(SOURCE)-crop.pdf $(SOURCE).gif
17+
make clean
18+
19+
png:
20+
make
21+
make svg
22+
inkscape $(SOURCE).svg -w $(WIDTH) --export-png=$(SOURCE).png
23+
24+
transparentGif:
25+
convert $(SOURCE).pdf -transparent white result.gif
26+
make clean
27+
28+
svg:
29+
#inkscape $(SOURCE).pdf --export-plain-svg=$(SOURCE).svg
30+
pdf2svg $(SOURCE).pdf $(SOURCE).svg
31+
# Necessary, as pdf2svg does not always create valid svgs:
32+
inkscape $(SOURCE).svg --export-width=$(WIDTH) --export-plain-svg=$(SOURCE)1.svg
33+
rsvg-convert -a -w 720 -f svg $(SOURCE)1.svg -o $(SOURCE).svg
34+
rm $(SOURCE)1.svg

images/side-by-side/Makefile

+26-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,34 @@
11
SOURCE = side-by-side
2+
DELAY = 80
3+
DENSITY = 300
4+
WIDTH = 512
25

36
make:
47
pdflatex $(SOURCE).tex -output-format=pdf
58
pdflatex $(SOURCE).tex -output-format=pdf
69
make clean
710

811
clean:
9-
rm -rf $(TARGET) *.class *.html *.log *.aux *.out *.ind *.idx *.ilg *.toc *.bbl *.blg *.pyg
12+
rm -rf $(TARGET) *.class *.html *.log *.aux *.data *.gnuplot
13+
14+
gif:
15+
pdfcrop $(SOURCE).pdf
16+
convert -verbose -delay $(DELAY) -loop 0 -density $(DENSITY) $(SOURCE)-crop.pdf $(SOURCE).gif
17+
make clean
18+
19+
png:
20+
make
21+
make svg
22+
inkscape $(SOURCE).svg -w $(WIDTH) --export-png=$(SOURCE).png
23+
24+
transparentGif:
25+
convert $(SOURCE).pdf -transparent white result.gif
26+
make clean
27+
28+
svg:
29+
#inkscape $(SOURCE).pdf --export-plain-svg=$(SOURCE).svg
30+
pdf2svg $(SOURCE).pdf $(SOURCE).svg
31+
# Necessary, as pdf2svg does not always create valid svgs:
32+
inkscape $(SOURCE).svg --export-width=$(WIDTH) --export-plain-svg=$(SOURCE)1.svg
33+
rsvg-convert -a -w 720 -f svg $(SOURCE)1.svg -o $(SOURCE).svg
34+
rm $(SOURCE)1.svg

images/side-by-side/README.md

+3

images/side-by-side/side-by-side.pdf

-11 Bytes
Binary file not shown.

images/side-by-side/side-by-side.png

174 KB

math/commutative-diagramm/README.md

+3
+3
-1.09 KB

tikz/b-tree-2-small-2/README.md

+3
7.87 KB

tikz/b-tree-2-small-3/README.md

+3
10.4 KB

tikz/b-tree-2-small-4/README.md

+3
10.2 KB

tikz/b-tree-2-small/Makefile

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
SOURCE = b-tree-2-small
22
DELAY = 80
33
DENSITY = 300
4-
WIDTH = 500
4+
WIDTH = 512
55

66
make:
77
pdflatex $(SOURCE).tex -output-format=pdf
88
make clean
99

1010
clean:
11-
rm -rf $(TARGET) *.class *.html *.log *.aux
11+
rm -rf $(TARGET) *.class *.html *.log *.aux *.data *.gnuplot
1212

1313
gif:
1414
pdfcrop $(SOURCE).pdf
@@ -28,4 +28,6 @@ svg:
2828
#inkscape $(SOURCE).pdf --export-plain-svg=$(SOURCE).svg
2929
pdf2svg $(SOURCE).pdf $(SOURCE).svg
3030
# Necessary, as pdf2svg does not always create valid svgs:
31-
inkscape $(SOURCE).svg --export-plain-svg=$(SOURCE).svg
31+
inkscape $(SOURCE).svg --export-width=$(WIDTH) --export-plain-svg=$(SOURCE)1.svg
32+
rsvg-convert -a -w 720 -f svg $(SOURCE)1.svg -o $(SOURCE).svg
33+
rm $(SOURCE)1.svg

tikz/b-tree-2-small/README.md

+3
8.72 KB

0 commit comments

Comments
 (0)