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
|
\documentclass{article}
\usepackage{amsmath}
\usepackage{booktabs}
\usepackage{graphicx}
\usepackage{pgfplotstable}
\usepackage{pgfplots}
\usepackage{siunitx}
\usepackage{tikz} % to generate the plot from csv
\pgfplotsset{compat=newest} % place the legend below the plot
\usepgfplotslibrary{units} % display units nicely
\sisetup{
round-mode = places,
round-precision = 2,
}
\title{My first document}
%\date{}
\author{Mo Khan}
\begin{document}
\pagenumbering{gobble}
\maketitle
\newpage
\tableofcontents
\newpage
\pagenumbering{arabic}
\section{Section}
Hello World!
\subsection{Subsection}
Structuring a document is easy!
\subsubsection{Subsubsection}
More text.
\paragraph{Paragraph}
Some more text.
\subparagraph{Subparagraph}
Even more text.
\newpage
\section{Another section}
\begin{equation*}
f(x) = x^2
\end{equation*}
This is some example text\footnote{\label{myfootnote}Hello footnote}.
\begin{figure}[h!]
\includegraphics[width=\linewidth]{images/screenshot.png}
\caption{A boat.}
\label{fig:boat1}
\end{figure}
Figure \ref{fig:boat1} shows a boat.
\begin{table}[h!]
\centering
\caption{Caption for the table.}
\label{tab:table1}
\begin{tabular}{l|c||r}
1 & 2 & 3\\
\hline
a & b & c\\
\end{tabular}
\end{table}
I'm referring to footnote \ref{myfootnote}.
\begin{table}[h!]
\centering
\caption{Caption for the table.}
\label{tab:table2}
\begin{tabular}{ccc}
\toprule
Some & actual & content\\
\midrule
prettifies & the & content\\
as & well & as\\
using & the & booktabs package\\
\bottomrule
\end{tabular}
\end{table}
\newpage
\begin{table}
\caption{Dummy table}
\end{table}
\newpage
\begin{table}[h!]
\begin{center}
\caption{Autogenerated table from .csv file.}
\label{table4}
\pgfplotstabletypeset[
multicolumn names, % allows to have multicolumn names
col sep=comma, % the seperator in our .csv file
display columns/0/.style={
column name=$Value 1$, % name of first column
column type={S},string type}, % use siunitx for formatting
display columns/1/.style={
column name=$Value 2$,
column type={S},string type},
every head row/.style={
before row={\toprule}, % have a rule at top
after row={
\si{\ampere} & \si{\volt}\\ % the units seperated by &
\midrule} % rule under units
},
every last row/.style={after row=\bottomrule}, % rule at bottom
]{table.csv} % filename/path to file
\end{center}
\end{table}
\newpage
\begin{figure}[h!]
\begin{center}
\begin{tikzpicture}
\begin{axis}[
width=\linewidth,
grid=major,
grid style={dashed,gray!30},
xlabel=X Axis $U$,
ylabel=Y Axis $I$,
x unit=\si{\volt},
y unit=\si{\ampere},
legend style={at={(0.5,-0.2)},anchor=north},
x tick label style={rotate=90,anchor=east}
]
\addplot
% select columns by using actual column names in csv.
table[x=column 1,y=column 2, col sep=comma] {table.csv};
\legend{Plot}
\end{axis}
\end{tikzpicture}
\caption{My first autogenerated plot.}
\end{center}
\end{figure}
\newpage
\begin{appendix}
\listoffigures
\listoftables
\end{appendix}
\end{document}
|