-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample.tex
499 lines (431 loc) · 12.6 KB
/
example.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
\documentclass[a4paper,11pt,oneside,showtrims]{alpenthesis}
%%\aiiistock
\usepackage{lipsum}
\hexfalse
\paperfalse
\usepackage[numbered]{matlab-prettifier}
%% ================================================================= SET TITLE %
\title{My Thesis}
\author{Raphael Frey \\[1ex]\href{https://github.com/alpenwasser/}
{\nolinkurl{https://github.com/alpenwasser/}}}
\chapterstyle{alpenthesis}
%% ============================================================== END PREAMBLE %
\begin{document}
%% ============================================================= BEGIN CONTENT %
%% <<< titlingpage
\begin{titlingpage}
\fullhexpage{q1}{q0}
\tikzset{external/export next=false}%
\begin{tikzpicture}[remember picture,overlay,very thick]
\node[draw,anchor=north east,yshift=-5mm,xshift=-10mm]
at (current page.north east)
{\texttt{LOGO TOP}};
\end{tikzpicture}
\tikzset{external/export next=false}%
\begin{tikzpicture}[remember picture,overlay,very thick]
\node[draw,anchor=south east,yshift=+5mm,xshift=-10mm]
at (current page.south east)
{\texttt{LOGO BOTTOM}};
\end{tikzpicture}
\flushright\sffamily
\vspace{3ex}
\Huge\bfseries{A Mostly Appropriate Title}\\[1ex]
\Large\mdseries{Thesis}\\[3ex]
\normalsize\mdseries
alpenwasser\\
team partner\\[3ex]
Supervisor\\
Expert\\
\vfill
\begin{tikzpicture}[very thick]
\draw (0,0) rectangle (12,8);
\draw (0,0) -- (12,8);
\draw (0,8) -- (12,0);
\node[anchor=center] at (6,1) {\LARGE\texttt{TITLE PICTURE}};
\end{tikzpicture}
\vfill
\today\\
Version 1.0.0
\end{titlingpage}
%% >>>
%% <<< frontmatter
\frontmatter
\tableofcontents*
\clearpage
\listoffigures*
\clearpage
\listoftables*
\clearpage
\listoflistings
%% >>>
\mainmatter
\part{Main Content}
\chapter{Text} % <<< Text
\lipsum[1]
\sffamily\lipsum[2]
\bfseries\lipsum[3]
\mdseries\ttfamily\lipsum[4]
\bfseries\ttfamily\lipsum[5]
\normalfont\scshape\lipsum[6]
\slshape\lipsum[7]
\scshape\lipsum[8]
\scslshape\lipsum[9]
\normalfont
%% >>>
\chapter{Ti\emph{k}Z Pictures, pgfplots} % <<< TikZ Pictures, pgfplots
\begin{figure}
\centering
\begin{tikzpicture}
\coordinate (C) at (0,0);
\coordinate (A) at (0,0);
\coordinate (B) at (4,2);
\draw (C) circle (1);
\draw (A) rectangle (B);
\end{tikzpicture}
\caption{A Ti\emph{k}Z Picture}
\end{figure}
\begin{figure}
\centering
\begin{tikzpicture}
\begin{axis}[width=\textwidth,height=50mm]
\addplot[
dv-7,
domain=-3e-3:3e-3,
samples=201,
]
{exp(-x^2 / (2e-3^2)) / (1e-3 * sqrt(2*pi))};
\end{axis}
\end{tikzpicture}
\caption{A plot of a function}
\label{fig:function}
\end{figure}
\lipsum[3]
\begin{figure}[htb]
\centering
%\tikzexternaldisable
\begin{tikzpicture}[trim axis left]
\newcommand*\imp{IMPORTANT}
% https://tex.stackexchange.com/a/78279/131649
% https://tex.stackexchange.com/a/369884/131649
% https://tex.stackexchange.com/q/36297/131649
\pgfplotsset{
every axis legend/.append style={
at={(1,1.05)},
anchor=south east,
}
}
\begin{axis}[
scale only axis,
xtick = {
-0.0030,
-0.0015,
0,
0.0015,
0.0030
},
minor xtick = {
-0.0035,
-0.0025,
-0.002,
-0.001,
-0.0005,
0,
0.0005,
0.001,
0.002,
0.0025,
0.0035
},
extra x ticks={-0.0006}, % p.331ff in pgfplots manual
extra x tick labels={\textcolor{dv+6}{\imp}},
%xticklabel style={/pgf/number format/.cd,fixed,precision=5},
xticklabel style={/pgf/number format/.cd,sci e}, % pgfplotstable: p.34
extra x tick style={
grid=major,
tick label style={
rotate=90,
anchor=west,
},
tick pos = right,
ticklabel pos = right,
},
title style={
yshift={width("\imp")},
},
scaled ticks=false,
width=\textwidth,
height=80mm,
xlabel=time (\si{\second}),
ylabel=Amplitude (\si{\volt}),
%xtick scale label code/.code={$\cdot \pi$},
title=Plot Title,
typeset ticklabels with strut,
xlabel style={
yshift={width("\imp") - height("0")},
},
legend cell align=left,
%legend pos = outer north east,
every outer x axis line/.append style={black},
every outer y axis line/.append style={black},
axis line shift=0pt,
]
\addplot[
mark = *,
ycomb,
dv-7,
domain=-3e-3:3e-3,
samples=11,
every mark/.style={fill=white},
]
{exp(-x^2 / (2e-3^2)) / (1e-3 * sqrt(2*pi))};
\label{pgfplots:bell}
\addlegendentry{Bell Curve}
\addplot[
mark = *,
ycomb,
q0,
samples=11,
every mark/.style={fill=white},
samples at={-0.0031,-0.0025,...,0.0029},
]
{4.75e4 * x + 200};
\label{pgfplots:linear}
\addlegendentry{Some Linear Function}
\end{axis}
\end{tikzpicture}
%\tikzexternalenable
\caption{A plot similar to matlab's stem}
\label{fig:stem}
\end{figure}
We have two curves in Figure~\ref{fig:stem}:
\begin{itemize}\tightlist
\item[\ref{pgfplots:bell}] a bell curve,
\item[\ref{pgfplots:linear}] and a linear function.
\end{itemize}
\lipsum[2]
%% >>>
\chapter{Tables} % <<< Tables
\begin{table}
\centering
\caption{tabular inside float}
\label{tab:float}
\begin{tabular}{lll}
\toprule
\scshape Header 1 & \scshape Header 2 & \scshape Header 3 \\
\midrule
Content & Content & Content \\
Content & Content & Content \\
Content & Content & Content \\
Content & Content & Content \\
\bottomrule
\end{tabular}
\end{table}
\lipsum[3]
\begin{center}
\tabcaption{Tabular outside of float}
\label{tab:outside}
\begin{tabular}{lll}
\toprule
\scshape Header 1 & \scshape Header 2 & \scshape Header 3 \\
\midrule
Content & Content & Content \\
Content & Content & Content \\
Content & Content & Content \\
Content & Content & Content \\
\bottomrule
\end{tabular}
\end{center}
%% >>>
\chapter{References and Hyperlinks} % <<< References and Hyperlinks
This sentence refers to Table~\ref{tab:outside}.
This is a citation \cite{testitem}.
\href{https://hyperlink.com}{This is a hyperlink hiding behind text.}
\href{https://hyperlink.com}{\nolinkurl{https://hyperlink.com}}
%% >>>
\chapter{Sectional Headings} % <<<
This section illustrates the style of \verb|\section|, \verb|\subsection| and
\verb|\subsubsection|.
\section{A Section}
\lipsum[2]
\subsection{A Subsection}
\lipsum[1]
\subsubsection{A subsubsection}
\lipsum[2]
%% >>>
\chapter{Boxes} % <<<
\tikzexternaldisable
\begin{tcolorbox}[breakable,title=Breakable Box With Title]
\lipsum[1-9]
\end{tcolorbox}
\tikzexternalenable
\vspace{1em}
\tikzexternaldisable
\begin{commandshell}
user:> echo "test"
root:> echo "test"
\end{commandshell}
\tikzexternalenable
\vspace{1em}
\tikzexternaldisable
\begin{tcolorbox}[title=Box with title]
\lipsum[2]
\end{tcolorbox}
\tikzexternalenable
\vspace{1em}
\tikzexternaldisable
\begin{tcolorbox}
\lipsum[2]
\end{tcolorbox}
\tikzexternalenable
\newpage
\tikzexternaldisable
Opening remarks \ldots
\begin{tcolorbox}[skin=octoboxfirst,title=Some Manually Broken Boxes]
\lipsum[1]
\end{tcolorbox}
Intermittent remarks \ldots
\begin{tcolorbox}[skin=octoboxmiddle]
\lipsum[2]
\end{tcolorbox}
More intermittent remarks \ldots
\begin{tcolorbox}[skin=octoboxlast]
\lipsum[3]
\end{tcolorbox}
Closing remarks \ldots
\tikzexternalenable
%% >>>
\chapter{Code Listings} % <<<
\begin{minted}{tex}
\begin{tabularx}{XX}
a & a \\
a & a \\
\end{tabularx}
\end{minted}
\section{Matlab}
%%<<<
\begin{lstlisting}[
style=Matlab-editor,
gobble=4,
title=Matlab Example Title,
caption=Matlab Example Caption,
]
%% Aufgabe 1: Knackgeraeusche entfernen (2/12)
clear all; close all; clc;
load Pruefung2_2.mat
% ... %
rxx = xcorr(x, scratch)/length(scratch);
rxx = rxx((length(rxx)+1)/2:length(rxx));
% c) Bestimmen Sie mittels plot() die Position der Knackgeraeusche. Welchen
% Abstand weisen sie rund auf?
figure; plot(rxx); grid on;
% [px,py] = ginput(2);
% px(2) - px(1)
% ans = 1.4544e+04 = 14544
% d) Legen sie aufgrund von c) einen Vektor p mit den Positionen der
% Knackgeraeusche fest. Der Abstand darf als konstant angenommen werden.
p = 14544:14544:length(x);
figure; plot(x,'r');hold on;
for i = p
% i: scratch position
src1 = x(i-512:i-257);
src2 = x(i+256:i+511);
x(i-256:i-1) = src1;
x(i:i+255) = src2;
end
plot(x,'b');
%% Aufgabe 2: Distanzmessung (2/10)
% ... %
filter_koeffs = x; % filterkoeffizienten sind koeffizienten der stossantwort
y0_upsampled = upsample(y0,10);
y0_filtered = filter(filter_koeffs,1,y0_upsampled);
[peak0, offset] = max(y0_filtered);
figure;plot(y0_filtered);grid on;
% c) Bestimme Sie die Laufzeit und dann die Distanz zur Wand aufgrund von y1.
y1_upsampled = upsample(y1,10);
y1_filtered = filter(filter_koeffs,1,y1_upsampled);
[peak1, peak_index] = max(y1_filtered);
peak_actual = peak_index - offset;
figure;plot(y1_filtered);grid on;
distance = T * peak_actual * c
\end{lstlisting}
%% >>>
%% >>>
\chapter{Mathematics} % <<<
A numbered equation:
\begin{equation}
y(x) = x^2 + 2x + 5
\end{equation}
An unnumbered equation:
\begin{equation*}
x_{01,02} = -1 \pm 2j
\end{equation*}
An \verb|align| with some numbered and unnumbered lines:
\begin{align}
\frac{\Phi}{i}
& =
\int_{0}^{\infty} \frac{dx}{x} \int_{0}^{l+m}
\left[
\frac{y dy}{\sqrt{x^2+y^2}} - \frac{(y-l) dy}{\sqrt{x^2+(y-l)^2}}
\right]
\nonumber
\\
&=
\int_{0}^{\infty}
\left[
\sqrt{x^2 + (l+m)^2)} - \sqrt{x^2+l^2} - \sqrt{x^2+m^2}+x
\right]
\frac{dx}{x}
\nonumber
\\
&=
\Bigg[
\sqrt{x^2 + (l+m)^2} - \sqrt{x^2+l^2} - \sqrt{x^2+m^2}
\nonumber
\\
& ~~~~~~~~~ + x - l \cdot \log{\frac{l+m+\sqrt{x^2+(l+m)^2}}{l+\sqrt{x^2+l^2}}}
\nonumber
\\
& ~~~~~~~~~ - m \cdot \log{\frac{l+m+\sqrt{x^2+(l+m)^2}}{m+\sqrt{x^2+l^2}}} ~
\Bigg]_0^{\infty}
\label{eq:mISL:2}
\\
& \approx
\left[ l \cdot \log{\frac{l+m}{l}} + m \cdot \log{\frac{l+m}{m}} \right]
\label{eq:mISL:3}
\end{align}
\begin{equation}
f(t) =
\begin{cases}
1 \quad t \geq 0\\
0 \quad t < 0\\
\end{cases}
\end{equation}
\begin{equation}
% https://tex.stackexchange.com/q/369970/131649
A \underset{f,g}{\times} B
\end{equation}
%% >>>
\cleardoublepage
%% <<< Appendices, Backmatter, Bibliography
\begin{titlingpage*}
\fullhexpage{da2}{ct4}
\begin{vplace}
\flushright\Huge\bfseries\sffamily\appendixpagename
\end{vplace}
\end{titlingpage*}
\appendix
\chapterstyle{alpenappendix}
\chapter{An Appendix Chapter}
\lipsum[1-3]
\chapter{Another Appendix Chapter with a Title That Requires Two Lines}
\lipsum[4-6]
\backmatter
\chapter{A Backmatter Chapter}
\lipsum[7-9]
\begin{thebibliography}{1}
\bibitem{testitem}
An Author, ``A Title``, 1979.
\end{thebibliography}
%% >>>
%% ============================================================== END CONTENT %
\end{document}