-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathpresentation.tex
312 lines (290 loc) · 13 KB
/
presentation.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
\documentclass[xetex,colorlinks]{beamer} % Use XeTeX for direct UTF-8
\usepackage{fontspec} % Set fonts to UTF-8
\usepackage{listings} % Source code highlighting
\usepackage{adjustbox} % Resizing source code
\usepackage{hologo} % Nice logos, also for engines
\usepackage{qrcode} % QR code generator!
\usepackage{tikz} % Image generation
\usepackage{pstricks}
%\usepackage[scaled=13]{CountriesOfEurope}
\usetheme{Singapore}
\usecolortheme{dove}
\hypersetup{allcolors=blue}
\title{Introduction to \hologo{LaTeXTeX}}
\subtitle{Workshop}
\author{Dr Dainius Masiliūnas} % This requires XeTeX + fontspec; alternatively you can use \={u}
\institute{Laboratory of Geo-Information Science and Remote Sensing\\ Wageningen University \& Research}
\begin{document}
\begin{frame}
\titlepage
\end{frame}
\begin{frame}
\frametitle{Table of contents}
\tableofcontents
\end{frame}
\section{Theory}
\subsection{Background}
\subsubsection{Background}
\begin{frame}
\frametitle{Background}
\begin{columns}
\column{0.7\textwidth}
\begin{itemize}
\item Writing reports, papers, theses, articles, ...
\item Office text processors: Microsoft Office Word, LibreOffice Writer, WPS Office Words, Calligra Words etc.
\item Seemingly good software?
\item But has irritations...
\item Professionals use \TeX{}, a markup language for making documents
\item Why?
\end{itemize}
\column{0.3\textwidth}
\include{images/folder}
\end{columns}
\end{frame}
\subsubsection{Issues with Office}
\begin{frame}
\frametitle{Issues with Office}
\begin{columns}
\column{0.85\textwidth}
\begin{itemize}
\item Images: they never stay in place, go above text, outside of caption boxes, etc.
\item Copy-pasting text (or worse, tables) leads to formatting problems
\item Different office programs render the same files differently
\item Bibliography management is a hassle, citation styles are too rigid
\item Math formulas handled by another program altogether
\item Reformatting (for publishing etc.) is tricky
\item Large documents/images become very slow
\item \TeX{} solves that, and more: it's fun!
\end{itemize}
\column{0.15\textwidth}
\include{images/Microsoft_Clippy}
\end{columns}
\end{frame}
\subsubsection{\TeX{} history and example}
\begin{frame}
\frametitle{\TeX{}}
\begin{columns}
\column{0.94\textwidth}
\begin{itemize}
\item A typesetting system by Donald Knuth in 1978 (MS Word: 1990)
\begin{itemize}
\item \LaTeX{} (Leslie Lamport 1984): additions to base \TeX{} for ease of use
\item \hologo{ConTeXt} (1996, Dutch): additions to \TeX{} for more control
\end{itemize}
\item Document files are plain text (\texttt{.tex}, source code, markup)
\item An engine (compiler) is used to turn it into a standard read-only document (PDF, PS)
\begin{itemize}
\item \hologo{pdfLaTeX}
\item \hologo{XeTeX}
\end{itemize}
\item Highly extensible, heavily package-oriented: ``there's a package for that''
\item Available as a distribution: engines + packages
\item Free and open-source software, cross-platform
\end{itemize}
\column{0.06\textwidth}
\include{images/ConTeXt}
\include{images/Flag_of_the_Netherlands}
% For some reason below no longer works with TeXLive 2018 (or I'm missing some package), XeLaTeX just crashes
%\CountriesOfEuropeFamily{}
%\Netherlands{}
\end{columns}
\end{frame}
\begin{frame}
\frametitle{Example}
\begin{columns}[c]
\column{.4\textwidth}
\begin{adjustbox}{width=\textwidth,height=\textheight,keepaspectratio}
\lstinputlisting[language={[LaTeX]TeX}]{example.tex}
\end{adjustbox}
\column{.6\textwidth}
% Comment out the next line to be able to compile this in Overleaf
\includegraphics[height=\textheight]{example}
\end{columns}
\end{frame}
\subsection{Using \TeX{}}
\subsubsection{Graphical user interfaces}
\begin{frame}
\frametitle{Graphical user interfaces}
\begin{columns}
\column{0.77\textwidth}
\begin{itemize}
\item Quick access to formatting, math, table creation macros, spell checking, word wrap, search, compiling, viewing the result
\item Cross-platform GUIs, such as:
\begin{itemize}
\item \href{http://www.xm1math.net/texmaker/}{Texmaker} and \href{http://www.texstudio.org/}{TeXstudio}
\item \href{http://kile.sourceforge.net/}{Kile}
\item \href{https://www.lyx.org/}{\hologo{LyX}}
\end{itemize}
\item All depend on an already installed \TeX{} distribution (i.e. \TeX{} Live) to work!
\begin{itemize}
\item Linux distributions provide \TeX{} Live (and GUIs) out of the box via package managers
\item \TeX{} Live installer for Windows \href{https://www.tug.org/texlive/acquire-netinstall.html}{available}
\item macOS can use Mac\TeX{}
\end{itemize}
\end{itemize}
\column{0.23\textwidth}
\include{images/gui}
\end{columns}
\end{frame}
\subsubsection{Collaborative editing}
\begin{frame}
\frametitle{Collaborative editing}
\begin{columns}
\column{0.77\textwidth}
\begin{itemize}
\item Web-based editors (a la Google Docs)
\begin{itemize}
\item Overleaf Pro:
\begin{itemize}
\item Free for everyone with a WUR email! And all collaborators per-project
\item Track changes, double-click to find etc.
\end{itemize}
\item Others: Papeeria, Authorea, etc. but much more limited than Overleaf right now
\end{itemize}
\item Git (thanks to plain text)
\begin{itemize}
\item GitHub, GitLab, own server, ...
\item Beware of merge conflicts: split chapters into separate files, one line per sentence
\item Useful even when writing alone: no more problems with backups and multiple versions
\end{itemize}
\item Both combined! Natively on Overleaf!
\end{itemize}
\column{0.23\textwidth}
\include{images/collab}
\end{columns}
\end{frame}
\subsubsection{Drawbacks}
\begin{frame}
\frametitle{Drawbacks}
\begin{itemize}
\item Learning curve: pays off in the long run
\item Confusing errors (if any!)
\begin{itemize}
\item Auxiliary files in working directory may help: \texttt{.log} for engines, \texttt{.blg} for \hologo{BibTeX}
\item Overfull \texttt{\textbackslash{}hbox}es: text interpreted as a character/box; if it cannot be broken up nicely, warns you
\item \texttt{File '<package>.sty' not found.} means you don't have the package installed
\end{itemize}
\item Quirkiness:
\begin{itemize}
\item \hologo{pdfLaTeX} doesn’t support UTF-8 symbols
\item Need packages for handling image formats etc.
\end{itemize}
\item People who are unwilling to learn to use collaborative \LaTeX{} editors or PDF editors
\end{itemize}
\centering
\include{images/oscilloscope}
\end{frame}
\subsubsection{More information}
\begin{frame}
\frametitle{Want to learn more?}
\begin{columns}
\column{0.8\textwidth}
\begin{itemize}
\item WikiBooks: \href{https://en.wikibooks.org/wiki/LaTeX}{https://en.wikibooks.org/wiki/LaTeX}
\item CTAN: \href{http://ctan.org}{http://ctan.org}
\item Stack Exchange: \href{http://tex.stackexchange.com/}{http://tex.stackexchange.com/}
\item This presentation and examples: \href{https://github.com/GreatEmerald/tex-workshop}{https://github.com/GreatEmerald/tex-workshop}
\item \href{https://github.com/GreatEmerald/AEO-validation-paper/tree/master/paper}{Paper for Advanced Earth Observation course}
\item \href{https://github.com/GreatEmerald/master-classification/tree/master/thesis}{Master thesis and first PhD paper}
\item PhD thesis template: \href{https://github.com/GreatEmerald/Wageningen\_PhD\_thesis}{https://github.com/GreatEmerald/Wageningen\_PhD\_thesis}
\end{itemize}
\column{0.2\textwidth}
\include{images/books}
\end{columns}
\end{frame}
\subsection{Questions}
\begin{frame}
\frametitle{Questions?}
\tableofcontents[sectionstyle=shaded/show,subsectionstyle=shaded/shaded/show,subsubsectionstyle=shaded/shaded/shaded/show]
\end{frame}
\section{Practical}
\begin{frame}
\frametitle{Practical}
\begin{columns}
\column{0.66\textwidth}
You can look at, compile and edit the examples given in the following slides on Overleaf.
\begin{enumerate}
\item Register and log into Overleaf: \href{https://www.overleaf.com/edu/wur}{https://www.overleaf.com/edu/wur}
\item Follow the invitation link: {\scriptsize \href{https://www.overleaf.com/read/jgtdkgwvrfky\#8ae4e1}{https://www.overleaf.com/read/jgtdkgwvrfky\#8ae4e1}}
\item Read-only; to make your own copy, click \textbf{``Menu''} at the top left, then \textbf{``Copy project''} (you must be \textbf{logged in}!)
\end{enumerate}
\column{0.34\textwidth}
\qrcode[nolinks,height=\textwidth]{https://www.overleaf.com/read/jgtdkgwvrfky\#8ae4e1}
\end{columns}
\end{frame}
\subsection{Features}
\subsubsection{Text and math}
\begin{frame}
\frametitle{Text and math \\ (\texttt{example.tex}, \texttt{utf8.tex})}
\begin{itemize}
\item \TeX{} is plain text: no formatting is preserved when pasting
\item Whitespace is ignored, unless two new lines
\item Inline maths capability with math-specific styles, syntax is fairly intuitive
\item UTF-8 support is better in \hologo{XeLaTeX}, e.g. text in Chinese
\end{itemize}
\end{frame}
\subsubsection{Formatting}
\begin{frame}
\frametitle{Formatting \\ (\texttt{ISPRSguidelines\_authors.tex})}
\begin{itemize}
\item Formatting can be global or local
\begin{itemize}
\item Global formatting is done in the file header: page margins, line spacing, font size, etc.; \texttt{geometry} package
\item Local formatting is done inline with special commands like \texttt{\textbackslash{}texttt}, \textbf{\textbackslash{}textbf}, \textit{\textbackslash{}textit}
\item Experts enjoy semantic styles by defining new commands: \texttt{\textbackslash{}newcommand\{\textbackslash{}code\}[1]\{\textbackslash{}texttt\{\#1\}\}}
\end{itemize}
\item Journals often provide \texttt{.cls} style templates or template \texttt{.tex} files
\begin{itemize}
\item \texttt{<filename>.cls}: use \texttt{\textbackslash{}documenttype\{<filename>\}}
\item \texttt{<filename>.tex}: possibly use \texttt{\textbackslash{}input\{<filename>\}}, edit or use as a reference
\item \href{http://www.isprs.org/documents/orangebook/app5.aspx}{Example: ISPRS provides .cls files and an example .tex}
\end{itemize}
\end{itemize}
\end{frame}
\subsubsection{Figures}
\begin{frame}
\frametitle{Figures \\ (\texttt{figures.tex})}
\begin{itemize}
\item \LaTeX{} has a figure environment that makes it easy to include figures and refer to them
\item The position of figures is determined automagically – no problem to add more text
\item \TeX{} is optimised for vector graphics (PDF, EPS, SVG), avoid rasters
\item \texttt{hyperref} package allows following references within the PDF
\end{itemize}
\end{frame}
\subsubsection{\hologo{BibTeX}}
\begin{frame}
\frametitle{\hologo{BibTeX} \\ (\texttt{bibliography.tex})}
\begin{itemize}
\item A system that handles all things bibliography
\item Database of bibliography is stored in plain text, \texttt{.bib} files, one may copy-paste entries from Google Scholar
\item Reference managers (Zotero, Mendeley, EndNote etc.) can export to BibTeX format
\item Cite entries by referring to their aliases
\item The default citing package is rigid, use \texttt{natbib} or \texttt{biblatex} for customisability
\item Integrates with \texttt{hyperref}
\item Two-step process; might need two compilation rounds
\end{itemize}
\end{frame}
\subsubsection{CTAN}
\begin{frame}
\frametitle{More packages! \\ (\texttt{acronyms.tex}, \texttt{changes.tex}, \texttt{gantt.tex})}
\begin{itemize}
\item CTAN: Comprehensive \TeX{} Archive Network (\href{http://ctan.org}{http://ctan.org})
\item 6694 packages at the moment of writing! (was 5199 in 2017)
\begin{itemize}
\item \texttt{changes}: adding edit suggestions and comments!
\item \texttt{glossaries}: Acronym management!
\item \texttt{pgfgantt}: Gantt charts! Useful for writing proposals.
\item \texttt{tikz}: flowcharts and other vector graphics!
\item \texttt{textcomp}: symbols °, ©, ... for \hologo{pdfLaTeX}
\item \texttt{qrcode}: QR code generation!
\item \href{https://github.com/yihui/knitr-examples/blob/master/005-latex.Rtex}{\texttt{knitr}}: embed R code into \TeX{}!
\begin{itemize}
\item Allows putting the output of \textit{R} commands into plain text, no more copy-pasting results
\item Exact same tool as for \texttt{.Rmd}, handles \texttt{.Rtex} too
\item Actually an \textit{R} package implementing a \TeX{} engine
\end{itemize}
\item \texttt{beamer}: Presentations! Like this one!
\end{itemize}
\end{itemize}
\end{frame}
\end{document}