2
0
Fork 0
mirror of https://github.com/MartinThoma/LaTeX-examples.git synced 2025-04-19 11:38:05 +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,8 @@
SOURCE = citation-cleveref-abbreviations
make:
pdflatex $(SOURCE).tex -output-format=pdf
pdflatex $(SOURCE).tex -output-format=pdf
make clean
clean:
rm -rf $(TARGET) *.class *.html *.log *.aux *.out

View file

@ -0,0 +1,44 @@
\documentclass[a4paper]{scrartcl}
\usepackage{amssymb, amsmath} % needed for math
\usepackage[utf8]{inputenc} % this is needed for umlauts
\usepackage[ngerman]{babel} % this is needed for umlauts
\usepackage[T1]{fontenc} % this is needed for correct output of umlauts in pdf
\usepackage[margin=2.5cm]{geometry} %layout
\usepackage{hyperref} % links within text
\usepackage{ntheorem}
\usepackage[german]{cleveref}
\newtheorem{theorem}{Satz}
\newtheorem{definition}{Defintion}
\begin{document}
\section{Minimal distance constant function}\label{sec:minimal-distance}
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla
quam elit, vestibulum nec facilisis at, condimentum id enim. Sed
iaculis lacinia quam, vel accumsan eros tempor in. Integer ipsum
\begin{theorem}[Tata]\label{thm:bla-blup}
\begin{enumerate}
\item Bla bla bla.
\item Bla bla bla.
\item Bla bla bla.
\end{enumerate}
\end{theorem}
metus, accumsan sit amet commodo a, egestas vitae sem. Mauris ut
orci ut dolor viverra convallis nec a erat. Aenean consequat elit
vel eros fermentum vestibulum id at ipsum. In vitae orci mauris, et
rhoncus odio. Pellentesque habitant morbi tristique senectus et netus
et malesuada fames ac turpis egestas.
\begin{definition}\label{def:aha}
ti ta to
\end{definition}
\section{bla bla}
asdf adsfaa asdfasd fasdf sdfsdrurtzhfg tdfutu fsdfsdfger thz ergte
fasd fsad fasdf asdfa sdfasdf asdssdfwer wewe asdf asdf asdfa asasdf
dasdfs.
As was shown in \cref{sec:minimal-distance} you can ...
Bla in \cref{thm:bla-blup} and in \cref{def:aha}
\end{document}

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}