-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathday1latex.tex
193 lines (145 loc) · 7.13 KB
/
day1latex.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
\documentclass[a4paper,10pt]{report} % {article}
%\documentclass[a4paper,10pt]{scrartcl}
\input{./latex/in1header.tex}
\title{Advanced LaTeX Workshop}
\author{Your Name Here}
\date{19 June 2023}
\pdfinfo{%
/Title (Advance LaTeX Workshop)
/Author (Your Name Here)
/Creator (Your Name Here)
/Producer (InScAPE)
/Subject (Intermediate and Advanced LaTeX)
/Keywords (listing, tikz, macros)
}
\begin{document}
% later: #4 generating index
%--------------
%\makeindex
%--------------
% \maketitle
\pagestyle{fancy}
\pagenumbering{roman}
\setcounter{page}{1}
%-------- Workshop overview-------------------------------
We are organising an informal \textbf{workshop} on the \textbf{intermediate and advanced topics} in \LaTeX.
Although there are various \LaTeX tutorials and templates floating around, but they often omit some tools and packages that are useful in meteorology and geophysics. The workshop is primary focused on PhD students who are starting to write their thesis, but it is open to other \LaTeX users as well.
\begin{enumerate}
\item Monday 19. June --- from 12:45 in CIP room
\item Wednesday 21. June --- from 15:00 in CIP room
\end{enumerate}
\noindent
You can work from CIP workstation or bring your own device.~\\
\begin{tabular}{l p{0.7\textwidth}}
target audience: & people with previous experience with \LaTeX \\
aims: & discuss \LaTeX ~topics practise skills \\
duration: & one and half hour from start time or until you start getting tired \\
topics: & see following sections \ref{sec:monday} and \ref{sec:wednesday} \\
registration: & comment in this Slack thread \\
\end{tabular}
%-----------------------------------------------------------------------------
\section{Monday} \label{sec:monday}
\subsection{Combining Document from Pieces}
Combining documents from multiple files speeds up the editing process, makes collaboration easier, and also lowers the risk of accidentally rewriting something. You can see an example how most of the header of this document is in a separate file.
% #1
To try this, write some dummy text in a separate file and insert is here using the \texttt{input} command:\\
% \input{filename}
% #2
The \texttt{input} statement can also work on multiple levels
\begin{enumerate}
\item Make a copy of \texttt{latex/style1headerfooter.tex} and modify it.
\item Open \texttt{in1header.tex} and replace \texttt{latex/style1headerfooter.tex} with the name of your new file.
\item Recompile the main document.
\end{enumerate}
\subsection{Automatically Generated Lists}\label{sec:automatic}
There is an easy way how to create list of figures, tables, as well as index of phrases.\\
We are going to start witth this document. First, change the class of document from article to report. What do you see?\\
\maketitle
%\pagenumbering{roman}
\let\clearpage\relax
\tableofcontents
\label{contents}
\addcontentsline{toc}{section}{Table of Contents} %\let\clearpage\relax
\addcontentsline{toc}{section}{List of Tables}
\listoftables
\addcontentsline{toc}{section}{List of Figures} %\let\clearpage\relax
\listoffigures
\chapter*{List of Symbols}
\addcontentsline{toc}{section}{List of Symbols}
\input{./latex/list_symbols.tex}
\newpage
%\chapter{Monday}
%\pagenumbering{arabic}
\subsection{Modifying Plots and Schematics}\label{sec:figures}
%\newpage
%\thispagestyle{empty}
\begin{figure}[h!]
%\input{./latex/diagram.tex}
\begin{tikzpicture}[node distance=8mm, auto,]
%nodes
\node[point] (market) {users (b)};
\node[point, inner sep=5pt,below=0.5cm of market]
(conference) {Conferences (c)};
% We make a dummy figure to make everything look nice.
\node[above=of market] (dummy) {};
\node[right=of dummy] (t) {Poster template}
edge[pil,bend left=45] (market.east) % edges are used to connect two nodes
edge[pil, bend left=45] (conference.east); % .east since we want
% consistent style
\node[left=of dummy] (g) {Feedback}
edge[pil, <-,bend right=45] (market.west)
edge[pil,->, bend left=45] node[auto] {Poster Idea (a)} (t);
\end{tikzpicture}~\hspace{-2ex}
\includegraphics[width=0.7\textwidth]{./figures/standalone.pdf}
\caption[Diagrams and plots]{Here we combine a \textbf{Tikz} diagrams and images. We can also compile the figure as separate \textbf{standalone} \index{standalone} pdf and then include it as a graphical element. }
\label{fig:standalone}
\end{figure}
%\setcounter{subsection}{7}
\subsection{Counters}\label{sec:counters}
How did we suddenly jump from section \ref{sec:figures} to \ref{sec:counters} ?
\newpage
\subsection{Customizing Links, References, and Citations}
Such as modifying the style of links to other parts of the same document (\nameref{sec:automatic}) and links to \href{https://geomet.uni-koeln.de/en/}{external websites}.
\subsection{Version Control and Comparison}
We also look at the external tools such as \texttt{latexdiff} that compares two \LaTeX files. %, and \texttt{pdfdiff} that compares \( \ldots \) you know what.
If this package is not installed on your computer, install it using \texttt{apt install latexdiff}. For further guidelines, see: \href{https://ctan.org/pkg/latexdiff?lang=en}{latexdiff package}.
\section{Wednesday} \label{sec:wednesday}
\subsection{Code Listing with Highligths}
Such as showing a lines from external script or showing the code of this page.
\lstinputlisting[ language={[latex]tex}, % tex syntax, latex option
firstline=93, firstnumber=93, lastline=99, numbers=left,
breaklines=true, basicstyle=\scriptsize, frame=single,
keywordstyle=\color{magenta}, commentstyle=\color{gray} % comments are gray colour
]{./latex/day2latex_backup.tex}
\subsection{Tables} \label{sec:tables}
Instead of copy \& paste values into tables, we just read them from an external csv file and format them.
\begin{table}[h]
\begin{center}
\csvreader[
tabular = |r|r|r|,
table head = \hline \( \quad z \; \lbrack \mathrm{m} \rbrack \) & \( \; \bar{u} \; \lbrack \mathrm{m\, s}^{-1} \rbrack \)& \( \quad \quad \Big. \bar{ \theta } \; \lbrack \mathrm{K} \rbrack \Big. \) \\\hline ,
table foot = \hline & \multicolumn{2}{ c|}{\( \ldots \) } \\ \hline
]{./data/values.csv}
{z=\zvec, u=\uvec, theta=\thvec}{%
\zvec & \uvec & \thvec
}%
\end{center} ~\vspace{1ex}
\caption{An example of a table that we will further style-up.}
\end{table}
%And the we will further style-up the table.
\subsection{More on Macros}
We can define shortcuts for symbols such as \(\thml\), but we can even write conditional statements.
\subsection{Posters and Slideshows}
If you have been struggling with Powerpoint, there is a way out \( \ldots \)
\section{Dummy section}
\lipsum[2-7] %generates dummy text
% #4 generating index
% \clearpage
% \phantomsection
% \addcontentsline{toc}{section}{Index}
% \label{index}
% Longer documents sometimes include index pages.
% \printindex
\label{LastPage}
\newpage
\end{document}