Vereniging voor Technische Physica workshop 2016
A workshop on the academic norm Typesetting with A workshop on the academic norm Wouter Hordijk | MSc physics student w.hordijk@student.tudelft.nl WeCie Altijd up, altijd geil
Contents Introduction to LaTeX What is it? Why use it? Usage of LaTeX Obtaining LaTeX Code structure Example code Practical assignment
... 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 -- What is ... and why would you want to use it?
A language rather than a program Document markup language Strong parallels with the principles of HTML and CSS Actively being developed since 1978 Widely used in academics, especially in sciences Steep learning curve
LaTeX is not a word processor Markup code controls the output What you see is what you get
* Free ≠ easy to pirate: we actually mean legally free of charge here Why use LaTeX? Professional looking document Excellent handling of maths Uniformity in style Focus on content Scalable Portable Free* Exceptional layout Where there's a will... * Free ≠ easy to pirate: we actually mean legally free of charge here
Images provided by Eyolf Østrem and Dario Taraborelli Example: ligatures Images provided by Eyolf Østrem and Dario Taraborelli
Example: mathematics
Example: advanced mathematics
Example: inline mathematics
Scalable and portable Overview and structure for large documents titlepage.tex chapter1.tex chapter2.tex chapter3.tex chapter4.tex references.bib \input thesis.pdf thesis.tex
How to get ... and how to use it
Obtaining LaTeX Installation on MS Windows LaTeX distribution (includes compilers, converters and packages) http://miktex.org/ LaTeX editor (example) http://www.texstudio.org/
Working with LaTeX
Code structure of a LaTeX document Preamble Choosing a document class Defining the general markup Defining language Packages for fancy stuff 2. Content Chapter / section structure 3. BibTeX References
Preamble
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}
Content
Content \chapter{Chapter} ... \section{Section} \subsection{Subsection} \section{Another section}
Available structure types Command Level Comment \part{part} -1 Not in letters \chapter{chapter} Only books and reports \section{section} 1 \subsection{subsection} 2 \subsubsection{subsubsection} 3 \paragraph{paragraph} 4 \subparagraph{subparagraph} 5
Bibliography
References and citing References go in a separate .bib file, indicated with @ signs: @article{Doe1932, author = {John Doe}, title = {Title of the Article}, year = {1932}, journal = {Nature}, volume = {14}, number = {3}, pages = {342--351} }
References and citing Use internet shortcuts to get the BibTeX format.
References and citing Handles are used to cite sources in the content itself: ... as proven by Author \cite{label}. Numbering is taken care of automagically Only cited references will appear in the bibliography
Environments
Environments for specific typesetting General environment: \begin[options]{environment} content \label{env:handle} \end{environment} > Mathematics and images are put in their respective environments
Mathematics environments Inline environment delimited by $ signs: ... so $\lambda_1 = \sqrt{\frac{5}{2}}$ ... Isolated mathematics: then it is found that: \begin{equation} \hat{H}\ket{\psi} = E\ket{\psi} \end{equation}
Environments within environments 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} The code used to typeset mathematics is (partially) included on the handout
Non-mathematics 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}
Practical assignment learning by doing
In doubt? WeCie Ask someone who knows: Your neighbour Google Wikibooks Stack Exchange The WeCie! WeCie Altijd up, altijd geil
Assignment: learning by doing Goal: typeset the provided document Get started: Download this presentation at http://ecie.vvtp.tudelft.nl/latexcursus/ 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