Skip to content

Commit

Permalink
Add README.md and rendered png to all folders except for /documents
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
MartinThoma committed Nov 22, 2015
1 parent de1ad26 commit 2de9065
Show file tree
Hide file tree
Showing 154 changed files with 483 additions and 171 deletions.
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*.gif diff=image
*.jpg diff=image
*.png diff=image
37 changes: 37 additions & 0 deletions .meta/add_readme.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/usr/bin/env python

import os
from os import listdir
from os.path import isfile, join

import logging
import sys

logging.basicConfig(format='%(asctime)s %(levelname)s %(message)s',
level=logging.DEBUG,
stream=sys.stdout)


def create_readme(directory):
project_name = os.path.basename(directory)
onlyfiles = [f.lower()
for f in listdir(directory)
if isfile(join(directory, f))]
if ('%s.tex' % project_name) not in onlyfiles:
logging.warning("Dir '%s' has no standard .tex filename.", directory)
return
text = "Compiled example\n"
text += "----------------\n"
text += "![Example](%s.png)\n" % project_name
with open(os.path.join(directory, "README.md"), 'w') as f:
f.write(text)
os.system("make png -C %s" % directory)

subdirs = [x[0] for x in os.walk('.')]
subdirs = [f for f in subdirs
if not any([True for e in f.split('/')
if e.startswith('.') and len(e) > 1])]
for subdir in subdirs:
onlyfiles = [f.lower() for f in listdir(subdir) if isfile(join(subdir, f))]
if 'readme.md' not in onlyfiles:
create_readme(subdir)
3 changes: 3 additions & 0 deletions documents/chess-chessboard-4x4/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Compiled example
----------------
![Example](chess-chessboard-4x4.png)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions documents/chess-chessboard-shortest-game/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Compiled example
----------------
![Example](chess-chessboard-shortest-game.png)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions documents/chess-chessboard-simple-example/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Compiled example
----------------
![Example](chess-chessboard-simple-example.png)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions documents/chess-skak-simple-example/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Compiled example
----------------
![Example](chess-skak-simple-example.png)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 27 additions & 1 deletion documents/eaz/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,33 @@
SOURCE = eaz
DELAY = 80
DENSITY = 300
WIDTH = 512

make:
pdflatex $(SOURCE).tex -output-format=pdf
make clean

clean:
rm -rf $(TARGET) *.class *.html *.log *.aux *.out
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-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 changes: 3 additions & 0 deletions documents/eaz/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Compiled example
----------------
![Example](eaz.png)
Binary file modified documents/eaz/eaz.pdf
Binary file not shown.
Binary file added documents/eaz/eaz.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions documents/math-euklidische-normalform/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Compiled example
----------------
![Example](math-euklidische-normalform.png)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions documents/math-sylvester-diagonal-matrix/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Compiled example
----------------
![Example](math-sylvester-diagonal-matrix.png)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 27 additions & 4 deletions documents/size/Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,33 @@
SOURCE = size
DELAY = 80
DENSITY = 300
WIDTH = 512

make:
pdflatex $(SOURCE).tex -output-format=pdf # first run for the aux file
makeindex $(SOURCE) # now the index is generated
pdflatex $(SOURCE).tex -output-format=pdf # pdf with index :-)
pdflatex $(SOURCE).tex -output-format=pdf
make clean

clean:
rm -rf $(TARGET) *.class *.html *.log *.aux *.out *.ind *.idx *.ilg *.toc *.bbl *.blg *.pyg
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-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 changes: 3 additions & 0 deletions documents/size/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Compiled example
----------------
![Example](size.png)
Binary file modified documents/size/size.pdf
Binary file not shown.
Binary file added documents/size/size.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions documents/table-multiple-pages/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Example with a very long table over multiple pages
2 changes: 2 additions & 0 deletions documents/zwischenmiete-vertrag/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Example for a contract - in German - about giving your apartment to somebody
else for a short time.
28 changes: 27 additions & 1 deletion images/basic/Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,34 @@
SOURCE = basic
DELAY = 80
DENSITY = 300
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 *.out *.ind *.idx *.ilg *.toc *.bbl *.blg *.pyg
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-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 change: 1 addition & 0 deletions images/basic/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Just include an image in a document in its original size
27 changes: 26 additions & 1 deletion images/float/Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,33 @@
SOURCE = float
DELAY = 80
DENSITY = 300
WIDTH = 512

make:
pdflatex $(SOURCE).tex -output-format=pdf
make clean

clean:
rm -rf $(TARGET) *.class *.html *.log *.aux *.out *.ind *.idx *.ilg *.toc *.bbl *.blg *.pyg
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-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 changes: 3 additions & 0 deletions images/float/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Compiled example
----------------
![Example](float.png)
Binary file added images/float/float.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 26 additions & 1 deletion images/scaling/Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,33 @@
SOURCE = scaling
DELAY = 80
DENSITY = 300
WIDTH = 512

make:
pdflatex $(SOURCE).tex -output-format=pdf
make clean

clean:
rm -rf $(TARGET) *.class *.html *.log *.aux *.out *.ind *.idx *.ilg *.toc *.bbl *.blg *.pyg
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-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 changes: 3 additions & 0 deletions images/scaling/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Compiled example
----------------
![Example](scaling.png)
Binary file added images/scaling/scaling.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 26 additions & 1 deletion images/side-by-side-subfig/Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,34 @@
SOURCE = side-by-side-subfig
DELAY = 80
DENSITY = 300
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 *.out *.ind *.idx *.ilg *.toc *.bbl *.blg *.pyg
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-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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 26 additions & 1 deletion images/side-by-side/Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,34 @@
SOURCE = side-by-side
DELAY = 80
DENSITY = 300
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 *.out *.ind *.idx *.ilg *.toc *.bbl *.blg *.pyg
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-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 changes: 3 additions & 0 deletions images/side-by-side/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Compiled example
----------------
![Example](side-by-side.png)
Binary file modified images/side-by-side/side-by-side.pdf
Binary file not shown.
Binary file added images/side-by-side/side-by-side.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions math/commutative-diagramm/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Compiled example
----------------
![Example](commutative-diagramm.png)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions presentations/Tutorenschlung/presentation/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Presentation of a softskill course at KIT.
3 changes: 3 additions & 0 deletions source-code/Pseudocode/quotes/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Compiled example
----------------
![Example](quotes.png)
Binary file modified source-code/Pseudocode/quotes/quotes.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions tikz/b-tree-2-small-2/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Compiled example
----------------
![Example](b-tree-2-small-2.png)
Binary file added tikz/b-tree-2-small-2/b-tree-2-small-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions tikz/b-tree-2-small-3/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Compiled example
----------------
![Example](b-tree-2-small-3.png)
Binary file added tikz/b-tree-2-small-3/b-tree-2-small-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions tikz/b-tree-2-small-4/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Compiled example
----------------
![Example](b-tree-2-small-4.png)
Binary file added tikz/b-tree-2-small-4/b-tree-2-small-4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 5 additions & 3 deletions tikz/b-tree-2-small/Makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
SOURCE = b-tree-2-small
DELAY = 80
DENSITY = 300
WIDTH = 500
WIDTH = 512

make:
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
Expand All @@ -28,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 changes: 3 additions & 0 deletions tikz/b-tree-2-small/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Compiled example
----------------
![Example](b-tree-2-small.png)
Binary file added tikz/b-tree-2-small/b-tree-2-small.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 2de9065

Please sign in to comment.