Vereniging voor Technische Physica workshop 2016
WeCie Altijd up, altijd geil Typesetting with A workshop on the academic norm Wouter Hordijk | MSc physics student
Contents Introduction to LaTeX ●What is it? ●Why use it? Usage of LaTeX ●Obtaining LaTeX ●Code structure ●Example code Practical assignment
What is... and why would you want to use it? LaTeX looks good to people who don't know what it is, and it looks impressive to people who do know what it is. -- Isaac Newton --
●Document markup language o Strong parallels with the principles of HTML and CSS ●Actively being developed since 1978 ●Widely used in academics, especially in sciences ●Steep learning curve A language rather than a program
What you see is what you get Markup code controls the output LaTeX is not a word processor
●Professional looking document o Excellent handling of maths o Uniformity in style ●Focus on content ●Scalable ●Portable ●Free* ●Exceptional layout oWhere there's a will... Why use LaTeX? * Free ≠ easy to pirate: we actually mean legally free of charge here
Images provided by Eyolf Østrem and Dario Taraborelli Example: ligatures
Example: mathematics
Example: advanced mathematics
Example: inline mathematics
Overview and structure for large documents titlepage.tex chapter1.tex chapter2.texchapter3.texchapter4.texreferences.bib thesis.tex thesis.pdf \input Scalable and portable
How to get... and how to use it
Installation on MS Windows ●LaTeX distribution (includes compilers, converters and packages) ●LaTeX editor (example) Obtaining LaTeX
Working with LaTeX
1.Preamble ●Choosing a document class ●Defining the general markup ●Defining language ●Packages for fancy stuff 2. Content ●Chapter / section structure 3. BibTeX ●References Code structure of a LaTeX document
Preamble
●Choosing a document class defining the general markup style ●Packages for fancy stuff Example for an A4 sized report: \documentclass[a4paper]{report} \usepackage{amsmath,graphicx} \usepackage[dutch]{babel} \begin{document} Preamble
Content
\chapter{Chapter}... \section{Section}... \subsection{Subsection}... \section{Another section}... \subsection{Subsection}... Content
CommandLevelComment \part{part} Not in letters \chapter{chapter} 0Only books and reports \section{section} 1Not in letters \subsection{subsection} 2Not in letters \subsubsection{subsubsection} 3Not in letters \paragraph{paragraph} 4Not in letters \subparagraph{subparagraph} 5Not in letters Available structure types
Bibliography
References go in a separate.bib file, indicated author = {John Doe}, title = {Title of the Article}, year = {1932}, journal = {Nature}, volume = {14}, number = {3}, pages = { } } References and citing
Use internet shortcuts to get the BibTeX format. References and citing
●Numbering is taken care of automagically ●Only cited references will appear in the bibliography Handles are used to cite sources in the content itself:... as proven by Author \cite{label}. References and citing
Environments
> Mathematics and images are put in their respective environments General environment: \begin[options]{environment} content \label{env:handle} \end{environment} Environments for specific typesetting
Isolated mathematics: Inline environment delimited by $ signs:... so $\lambda_1 = \sqrt{\frac{5}{2}}$... then it is found that: \begin{equation} \hat{H}\ket{\psi} = E\ket{\psi} \end{equation} Mathematics environments
The code used to typeset mathematics is (partially) included on the handout Typesetting matrices requires a matrix environment to be put inside a mathematics environment: \begin{equation} A = \begin{pmatrix} a & b \\ c & d \end{pmatrix} \end{equation} Environments within environments
Environment for tables: \begin{table} \caption{Awesome table} \label{tab:awesome_table} \begin{center} \begin{tabular}{c|cc} 1 & 2 & 3 \\ \hline a & b & c \end{tabular} \end{center} \end{table} Non-mathematics environments
Environment for images: \begin{figure} \begin{center} \includegraphics[width=\textwidth]{1.png} \end{center} \caption{Awesome image} \label{fig:awesome_image} \end{figure} Non-mathematics environments
Practical assignment learning by doing
Ask someone who knows: ●Your neighbourYour neighbour ●GoogleGoogle ●WikibooksWikibooks ●Stack ExchangeStack Exchange ●The WeCie!WeCie In doubt? WeCie Altijd up, altijd geil
Goal: typeset the provided document Get started: ●Download this presentation at ●Install MikTeX and TeXstudio ●Download the assignment ●Extract the zip file to a new folder ●Open assignment.tex in TeXstudio ●Follow the instructions Good luck and have fun Assignment: learning by doing