2
0
Fork 0
mirror of https://github.com/MartinThoma/LaTeX-examples.git synced 2025-04-26 06:48:04 +02:00
This commit is contained in:
Martin Thoma 2014-01-12 16:14:23 +01:00
parent 4ed24dc8a6
commit 36425299c5
5 changed files with 132 additions and 0 deletions

View file

@ -0,0 +1,41 @@
SOURCE = splitted-code
DELAY = 80
DENSITY = 300
WIDTH = 512
make:
pdflatex $(SOURCE).tex -output-format=pdf
make clean
clean:
rm -rf $(TARGET) *.class *.html *.log *.aux *.toc *.snm *.out *.nav
gif:
pdfcrop $(SOURCE).pdf
convert -verbose -delay $(DELAY) -loop 0 -density $(DENSITY) $(SOURCE)-crop.pdf $(SOURCE).gif
make clean
animatedGif:
make
pdfcrop $(SOURCE).pdf
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
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

View file

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

View file

@ -0,0 +1,36 @@
\documentclass[a5paper]{article}
\usepackage{algorithm,algpseudocode}
\usepackage{caption}
\begin{document}
\begin{algorithm}
\caption{My algorithm}
\begin{algorithmic}[1]
\Procedure{Euclid}{$a,b$}\Comment{The g.c.d. of a and b}
\State $r\gets a\bmod b$
\While{$r\not=0$}\Comment{We have the answer if r is 0}
\State $a\gets b$
\State $b\gets r$
\algstore{myalg}
\end{algorithmic}
\end{algorithm}
\clearpage
\begin{algorithm}
\ContinuedFloat
\caption{My algorithm (continued)}
\begin{algorithmic}
\algrestore{myalg}
\State $r\gets a\bmod b$
\EndWhile\label{euclidendwhile}
\State \textbf{return} $b$\Comment{The gcd is b}
\EndProcedure
\end{algorithmic}
\end{algorithm}
\end{document}