(Yet Another) Introduction to L A TEX 2ε (V3) Matteo Carrara August 30th, 2013 (Yet Another) Introduction to LATEX2ε (V3) 1 / 29
What is L A TEX 2ε? Typesetting system that is very suitable for producing scientific and mathematical documents of high typographical quality Not a WYSIWYG word processor Completely free Natively multiplatform Coded language (super easy though!) Takes care of document formatting (Yet Another) Introduction to LATEX2ε (V3) 2 / 29
Why L A TEX 2ε? (I) Advantages over WYSIWYG word processors Professionally crafted layouts are available Convenient typesetting of mathematical formulae Users only need to learn a few easy-to-understand commands that specify the logical structure of a document Complex structures such as footnotes, references, table of contents, and bibliographies can be generated easily The system runs (for free!!!) on almost any hardware platform available (Win, Mac, Linux) You can also create presentations! (Yet Another) Introduction to LATEX2ε (V3) 3 / 29
Why L A TEX 2ε? (II) Disadvantages over WYSIWYG word processors......... Design of a whole new layout is difficult and takes a lot of time Very hard to write unstructured and disorganized documents (Yet Another) Introduction to LATEX2ε (V3) 4 / 29
What You Are About To Learn L A TEX 2ε syntax How to create professionally looking documents How to deal with the basic (but exhaustive) L A TEX 2ε tools How to handle bibliographies Presentation and workshop material available at http://www.prism.gatech.edu/ mcarrara3/ (Yet Another) Introduction to LATEX2ε (V3) 5 / 29
Outline 1 How To Get Started 2 Basic Structure 3 Math Formulae 4 Handling Bibliography 5 Workshop (Yet Another) Introduction to LATEX2ε (V3) 6 / 29
Outline 1 How To Get Started 2 Basic Structure 3 Math Formulae 4 Handling Bibliography 5 Workshop (Yet Another) Introduction to LATEX2ε (V3) 7 / 29
Resources 1 Book, The Not So Short Introduction to L A TEX 2ε, http://tobi.oetiker.ch/lshort/lshort.pdf (this presentation is build upon it!) 2 Archive, Comprehensive TEX Archive Network, http://www.ctan.org 3 Forum, L A TEX community, http://www.latex-community.org (Yet Another) Introduction to LATEX2ε (V3) 8 / 29
Getting Started How many of you have already used L A TEX 2ε? Windows - MiKTeX (http://www.miktex.org) - TeXnicCenter (http://www.texniccenter.org) - TeXMaker (http://www.xm1math.net/texmaker/) Mac - MacTeX (http://tug.org/mactex/); - TeXShop (http://pages.uoregon.edu/koch/texshop/) - LaTeXit (http://www.chachatelier.fr/latexit/) - TeXMaker (http://www.xm1math.net/texmaker/) Linux - TeXLive via sudo apt-get install texlive-full - TeXMaker via sudo apt-get install texmaker - Plenty of other editors (GVim, Gedit, Emacs,...) (Yet Another) Introduction to LATEX2ε (V3) 9 / 29
L A TEX 2ε Workflow Two steps process Create input file (.tex) Generate PDF file directly from.tex Simple as that! (Yet Another) Introduction to LATEX2ε (V3) 10 / 29
Outline 1 How To Get Started 2 Basic Structure 3 Math Formulae 4 Handling Bibliography 5 Workshop (Yet Another) Introduction to LATEX2ε (V3) 11 / 29
Input File Structure TEX files must follow a certain structure 1 Every input file must start with the command \documentclass{...} 2 Load packages to add new features to the L A TEX 2ε system \usepackage{...} 3 When all the setup work is done, start the body of the text \begin{document} 4 Enter text mixed with some useful L A TEX 2ε commands. At the end of the document you add \end{document} (Yet Another) Introduction to LATEX2ε (V3) 12 / 29
A Minimal L A TEX 2ε File Input (.tex file) Output (.pdf file) L A TEX is beautiful. \documentclass{article} \begin{document} % <-- Comment symbol \LaTeX\, is beautiful! % # of spaces does NOT matter % Newlines do NOT matter \end{document} (Yet Another) Introduction to LATEX2ε (V3) 13 / 29
Dealing With Big Files When working on big documents, you might want to split the input file into several parts Helpful command To insert the contents of another file named filename.tex use \input{filename.tex} (Yet Another) Introduction to LATEX2ε (V3) 14 / 29
Outline 1 How To Get Started 2 Basic Structure 3 Math Formulae 4 Handling Bibliography 5 Workshop (Yet Another) Introduction to LATEX2ε (V3) 15 / 29
AMS-L A TEX 2ε If you want to typeset (advanced) mathematics formulae you should use AMS-L A TEX 2ε It is a collection of packages and classes for mathematical typesetting (and it s awesome!) Load it in the preamble by typing \usepackage{amsmath} Full documentation at http://ctan.math.utah.edu/ctan/tex-archive/ macros/latex/required/amslatex/math/amsldoc.pdf (Yet Another) Introduction to LATEX2ε (V3) 16 / 29
Scratching the Surface Most basic (and most useful) AMS-L A TEX 2ε environments Single equations ($ vs $$ vs equation) Long equations (multline) Multiple equations (align vs eqnarray) Matrices (matrix vs bmatrix vs pmatrix vs... ) (Yet Another) Introduction to LATEX2ε (V3) 17 / 29
Let There Be Matrices! \begin{equation*} \begin{matrix} 1 & 2 \\ 3 & 4 \end{matrix} \qquad \begin{bmatrix} p_{11} & p_{12} & \ldots & p_{1n} \\ p_{21} & p_{22} & \ldots & p_{2n} \\ \vdots & \vdots & \ddots & \vdots \\ p_{m1} & p_{m2} & \ldots & p_{mn} \end{bmatrix} \end{equation*} 1 2 3 4 p 11 p 12... p 1n p 21 p 22... p 2n........ p m1 p m2... p mn (Yet Another) Introduction to LATEX2ε (V3) 18 / 29
Math Symbols A handy list of math symbols can be found here http://en.wikibooks.org/wiki/latex/mathematics Some examples \int_{0}ˆ{\infty}\alpha(x)d\gamma \sum_{i=0}ˆn\frac{\bar{x}_i}{y}=0 \bm{a}\in\mathcal{r}ˆ{nxn} A R NxN 0 n i=0 α(x)dγ x i y = 0 Note: bm command requires \usepackage{bm} in the preamble! (Yet Another) Introduction to LATEX2ε (V3) 19 / 29
Outline 1 How To Get Started 2 Basic Structure 3 Math Formulae 4 Handling Bibliography 5 Workshop (Yet Another) Introduction to LATEX2ε (V3) 20 / 29
Bibliography Resources Writing bibliography is remarkably tedious... But not with L A TEX! The ultimate tool is BIBTEX (http://www.bibtex.org) To manage the bibliography you should use Endnote, Win & Mac (http://software.oit.gatech.edu) Bibdesk, Mac only (http://bibdesk.sourceforge.net) Jabref, Cross-platform (http://jabref.sourceforge.net)... Let Scholar do the work for us! (Yet Another) Introduction to LATEX2ε (V3) 21 / 29
Quick Peek on the Hard Way @ARTICLE{Einstein, AUTHOR= "Albert Einstein", TITLE= "A Famous Paper", JOURNAL= "Physical Review", VOLUME= 123, PAGES= "456-789" } This is why it s boring... (Yet Another) Introduction to LATEX2ε (V3) 22 / 29
So, How Do We Include Citations? Literally with two lines of code! Just right before \end{document} add \bibliography{mybib} \bibliographystyle{plain} where mybib contains the bibliography entries plain is the style of the bibliography To cite a reference just use \cite{papertag} (Yet Another) Introduction to LATEX2ε (V3) 23 / 29
Wrapping Up (I) What you have seen here is both all and nothing about writing documents with L A TEX! What (I hope) you have learned Powerful document creation tool Quick learning curve Using documentation is vital Internet is a super-powerful resource (e.g. code snippets) (Yet Another) Introduction to LATEX2ε (V3) 24 / 29
Wrapping Up (II) Much more to come L A TEX 2ε/Inkscape integration for high quality graphics Calc2Latex for rapid table generation Advanced table typesetting Figures sizing Subfigures and minipages (Yet Another) Introduction to LATEX2ε (V3) 25 / 29
Reminder You can find this presentation and the workshop material at http://www.prism.gatech.edu/ mcarrara3/ Let s start practicing now! (Yet Another) Introduction to LATEX2ε (V3) 26 / 29
Workshop Hello L A TEX 2ε Basic concepts Two columns documents Special characters Document organization Inserting a Bibliography Inserting figures Font styles Inserting tables Typesetting math formulae Define new commands I promise you that after the workshop you ll be able to proficiently start writing documents with L A TEX 2ε! (Yet Another) Introduction to LATEX2ε (V3) 27 / 29
How Do We Make Presentations?!? Beamer is a particular class of L A TEX 2ε Some commands behave differently than they do in plain L A TEX 2ε New basic commands are to be defined Structuring a presentation is a little bit more complex than structuring a plain document... Maybe next time... (Yet Another) Introduction to LATEX2ε (V3) 28 / 29
Questions? (Yet Another) Introduction to LATEX2ε (V3) 29 / 29