Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
V
vorlage
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
general
stups
vorlage
Commits
43b37c1a
Commit
43b37c1a
authored
5 years ago
by
Jannik Dunkelau
Browse files
Options
Downloads
Patches
Plain Diff
Extend LaTeX examples and improve support of listings/algorithms
parent
f113f981
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
contents.tex
+139
-0
139 additions, 0 deletions
contents.tex
hhuthesis.cls
+29
-1
29 additions, 1 deletion
hhuthesis.cls
thesis.tex
+31
-3
31 additions, 3 deletions
thesis.tex
with
199 additions
and
4 deletions
contents.tex
+
139
−
0
View file @
43b37c1a
...
...
@@ -110,6 +110,145 @@ ganz leicht Graphen erstellen:
\label
{
fig:the-plot
}
\end{figure}
\section
{
Formeln und Algorithmen
}
\subsection
{
Formeln
}
\Cref
{
eq:example1
}
gibt eine referenzierbare Formel an,
während
\cref
{
eq:example2
}
eine Formel darstellt, die länger ist als die
Zeile zulässt.
\begin{equation}
\label
{
eq:example1
}
2 = 1 + 1
\end{equation}
\begin{multline}
\label
{
eq:example2
}
30 = 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1
\\
+ 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1
\end{multline}
\subsubsection
{
Mehrzeilige Formeln
}
In der zweizeiligen Gleichung
\begin{equation}
\label
{
eq:mlp-stacking
}
\begin{split}
\hat
{
y
}
&
= f
_
2(f
_
1(x; W); V)
\\
&
= f(x; W, V)
\end{split}
\end{equation}
wurden die Gleichheitszeichen in beiden Zeilen direkt untereinander ausgerichtet
(mittels
\texttt
{
\&
}
im Quelltext und der
\texttt
{
split
}
-Umgebung).
Teilen wir
\cref
{
eq:mlp-stacking
}
, welche den Forward Pass eines Neuronalen
Netzes darstellt,
in mehrere Schritte auf, so erhalten wir
\begin{align}
a
&
= W
^
\mathsf
{
T
}
x
\label
{
eq:fp-act
}
\\
h
&
= g
_
1(a)
\label
{
eq:fp-hidden
}
\\
o
&
= V
^
\mathsf
{
T
}
h
\label
{
eq:fp-out
}
\\
\hat
{
y
}
&
= g
_
2(o)
\label
{
eq:fp-pred
}
\,\text
{
,
}
\end{align}
wobei
\cref
{
eq:fp-act,eq:fp-hidden,eq:fp-out,eq:fp-pred
}
jeweils eine eigene
Referenznummer erhalten.
\subsection
{
Algorithmen
}
Für Algorithmen kann das bereits inkludierte Paket
\texttt
{
algoritihmicx
}
genutzt werden.
In
\cref
{
alg:minimax
}
wird exemplarisch eine Implementierung des
Minimax-Algorithmus aufgeführt.
\begin{algorithm}
\caption
{
Determining the next action by Minimax
}
%
\label
{
alg:minimax
}
\begin{algorithmic}
[1]
\Function
{
Minimax
}{
Game State Tree:
$
G
^
n
$}
\State
bestValue
\(
\gets
-
\infty
\)
\State
\(
bestAction
\gets
\)
NIL
\ForAll
{\(
G
^
n
_
a
\in
S
(
G
^
n
)
\)}
\State
\(
value
=
\)
\Call
{
MinimaxValue
}{\(
G
^
n
_
a
\)
, true
}
\If
{\(
value > bestValue
\)}
\Comment
{
Aktualisiere besten Wert
}
\State
\(
bestValue
\gets
value
\)
\State
\(
bestAction
\gets
a
\)
\EndIf
\EndFor
\State
\Return
\(
bestAction
\)
\EndFunction
\Statex
\Function
{
MinimaxValue
}{
Game State Tree:
$
G
^
n
$
Boolean:
$
ourTurn
$}
\If
{\(
D
(
G
^
n
)=
0
\)}
\State
\Return
\Call
{
Heuristic
}{
root(
\(
G
^
n
\)
)
}
\ElsIf
{\(
ourTurn
\)}
\State
\(
maxValue
\gets
-
\infty
\)
\ForAll
{\(
S
\in
S
(
G
^
n
)
\)}
\State
\(
newValue
\gets
\)
\Call
{
MinimaxValue
}{\(
S
\)
, false
}
\State
\(
maxValue
\gets
max
(
newValue, maxValue
)
\)
\EndFor
\State
\Return
\(
maxValue
\)
\Else
\State
\(
minValue
\gets
+
\infty
\)
\ForAll
{\(
S
\in
S
(
G
^
n
)
\)}
\State
\(
newValue
\gets
\)
\Call
{
MinimaxValue
}{\(
S
\)
, true
}
\State
\(
minValue
\gets
\min
(
newValue, minValue
)
\)
\EndFor
\State
\Return
\(
minValue
\)
\EndIf
\EndFunction
\end{algorithmic}
\end{algorithm}
\subsection
{
Source Code Listings
}
\Cref
{
lst:hello-c,lst:hello-python
}
zeigen ein `Hello World'-Programm,
je in C und Python.
\Cref
{
lst:hello-prolog
}
zeigt ein Prolog-Prädikat, welches eine Liste in zwei
teile teilen kann.
\begin{lstlisting}
[
float, caption=
{
Hello World in C.
}
, label=
{
lst:hello-c
}
, language=C
]
#include <stdio.h>
int main(int argc, char[] *args)
{
printf("Hello World!
\n
");
// And done!
}
\end{lstlisting}
\begin{lstlisting}
[
float, caption=
{
Totally minimal Hello World in Python.
}
,
label=
{
lst:hello-python
}
, language=Python
]
def hello
_
world():
print("Hello World"!)
if
__
name
__
== "
__
main
__
":
hello
_
world()
\end{lstlisting}
\begin{lstlisting}
[
float, caption=
{
Prolog implementation of
\texttt
{
split/4
}}
,
label=
{
lst:hello-prolog
}
, language=Prolog
]
% Split list into two parts (length of first list given).
%
% ?- split([a,b,c,d,e,f,g,h,i,k], 3, L1, L2).
% L1 = [a,b,c]
% L2 = [d,e,f,g,h,i,k]
%
split(L, N, L1, L2) :-
length(L1, N),
append(L1, L2, L).
\end{lstlisting}
\section
{
Conclusion
}
Am Ende der Arbeit werden noch einmal die erreichten Ergebnisse
...
...
This diff is collapsed.
Click to expand it.
hhuthesis.cls
+
29
−
1
View file @
43b37c1a
\NeedsTeXFormat
{
LaTeX2e
}
\ProvidesClass
{
hhuthesis
}
[2020/02/11 HHU Thesis LaTeX document class v1.1
0
]
\ProvidesClass
{
hhuthesis
}
[2020/02/11 HHU Thesis LaTeX document class v1.1
1
]
\DeclareOption*
{
\PassOptionsToClass
{
\CurrentOption
}{
article
}}
% Options fallback.
\ProcessOptions\relax
...
...
@@ -96,6 +96,7 @@
%% Corporate Design says to use Arial, but TeXLive only provides helvet
\RequirePackage
{
helvet
}
\renewcommand
{
\familydefault
}{
\sfdefault
}
\RequirePackage
[scaled=0.85]
{
beramono
}
\pagestyle
{
headings
}
...
...
@@ -175,6 +176,27 @@
}
}
%% Adapt lstlisting display
\newcommand
{
\lstkeyword
}
[1]
{
%
\ifprintblackwhite\color
{
black
}
\else\color
{
hhublue
}
\fi\bfseries
#1
}
\newcommand
{
\lststring
}
[1]
{
%
\ifprintblackwhite\color
{
black
}
\else\color
{
hhudarkblue
}
\fi
#1
}
\newcommand
{
\setlstlistingstyle
}{
\lstset
{
basicstyle=
\small\ttfamily
,
numbers=left, numberstyle=
\footnotesize
,
keywordstyle=
\lstkeyword
,
commentstyle=
\color
{
gray
}
\itshape
,
stringstyle=
\lststring
,
showstringspaces=false,
frame=tb,
}
\renewcommand*\thelstnumber
{{
\the\value
{
lstnumber
}}
:
}
}
%% Adapt algorithmicx font
\newcommand
{
\algsmallfont
}{
\algrenewcommand\ALG
@beginalgorithmic
{
\small
}}
%%% Setup of title page
\RequirePackage
{
graphicx
}
...
...
@@ -446,4 +468,10 @@
\input
{
abstract.tex
}
\end{abstract}
\cleardoublepage
% Ensure cleverref knows how to talk about listings.
\iflanguage
{
ngerman
}{
\crefname
{
listing
}{
Quellcode
}{
Quellcodes
}
\Crefname
{
listing
}{
Quellcode
}{
Quellcodes
}
}{}
}
This diff is collapsed.
Click to expand it.
thesis.tex
+
31
−
3
View file @
43b37c1a
...
...
@@ -73,8 +73,6 @@
\usepackage
{
amsmath
}
\usepackage
{
amssymb
}
\usepackage
{
listings
}
% Einbindung von Code
\usepackage
{
algorithmicx
}
% Angabe von Algorithmen in Pseudocode
\usepackage
{
siunitx
}
% \num Befehl zum einfacheren Formatieren von Zahlen.
\usepackage
{
enumitem
}
% Leichter konfigurierbare enumerate-Umgebungen.
\usepackage
{
subcaption
}
% Unterteilung von Figures in Subfigures.
...
...
@@ -91,6 +89,20 @@
\usepackage
{
multicol
}
\usepackage
{
longtable
}
% Große Tabellen gehen über mehrere Seiten.
%% Quellcode
\usepackage
{
listings
}
% Einbindung von Code.
\setlstlistingstyle
{}
% Kosmetische Einstellungen
% Sprachabhängige Bezeichnung.
\iflanguage
{
ngerman
}{
\renewcommand
{
\lstlistingname
}{
Quellcode
}}{}
%% Algorithmen in Pseudocode
\usepackage
{
algorithm
}
% Float-Umgebung für angegebene Algorithmen.
\usepackage
{
algorithmicx
}
% Angabe von Algorithmen in Pseudocode.
\usepackage
{
algpseudocode
}
% Standart Pseudocode-Elemente für Algorithmen.
\algsmallfont
{}
% Sprachabhängige Bezeichnung.
\iflanguage
{
ngerman
}{
\floatname
{
algorithm
}{
Algorithmus
}}{}
%% Intelligenteres Referenzieren mittels \cref.
%% \languagename um dynamisch zwischen ngerman oder english zu wechseln.
\usepackage
[\languagename,capitalize,noabbrev]
{
cleveref
}
...
...
@@ -147,9 +159,25 @@
\backmatter
%% Listings of figures, tables, etc. Delete what is not needed.
\listoffigures
\listoftables
% Algorithms
\iflanguage
{
ngerman
}
%
{
\renewcommand
{
\listalgorithmname
}{
Algorithmenverzeichnis
}}{}
\addcontentsline
{
toc
}{
section
}{
\listalgorithmname
}
\listofalgorithms
% Code Listings
\iflanguage
{
ngerman
}
%
{
\renewcommand
{
\lstlistlistingname
}{
Quellcodeverzeichnis
}}
%
{
\renewcommand
{
\lstlistlistingname
}{
List of Listings
}}
\addcontentsline
{
toc
}{
section
}{
\lstlistlistingname
}
\lstlistoflistings
\clearpage
\bibliography
{
references
}
%% Depending on Language, use german alphadin or original alpha
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment