Introducing Document Preparation A with L TEX Stan Reeves Introduction A L TEX A Introducing Document Preparation with LTEX Editors Automation Prosper Beamer Posters Stan Reeves Department of Electrical and Computer Engineering July 23, 2010 1 / 38 TEX Introducing Document Preparation A with L TEX Stan Reeves Introduction A L TEX Preparation of a document involves Entering text Formatting text Display on a screen Printing Editors Automation Prosper Beamer Posters 2 / 38 TEX Introducing Document Preparation A with L TEX Stan Reeves Introduction A L TEX Preparation of a document involves Entering text Formatting text Display on a screen Printing Editors Automation Prosper Beamer Posters TEX ( ) is a typesetting system. METAFONT ­ Font description language A point on a glyph is found as the intersection of a line ´ segment and a Bezier cubic curve Computer modern typeface. 62 parameters control the widths and heights of elements Author of TEX Donald Knuth (1978), computer science professor at Stanford 2 / 38 A TEX and LTEX Introducing Document Preparation A with L TEX Stan Reeves Introduction A L TEX Math spacing carefully derived based on typesets in: Acta Mathematica Indagationes Mathematicae Addison-Wesley's books Editors Automation Prosper Beamer Posters 3 / 38 A TEX and LTEX Introducing Document Preparation A with L TEX Stan Reeves Introduction A L TEX Math spacing carefully derived based on typesets in: Acta Mathematica Indagationes Mathematicae Addison-Wesley's books Editors Automation Prosper Beamer Posters Line breaks A total-fit line-breaking algorithm Assigns badness. Minimizes SS of badness 3 / 38 A TEX and LTEX Introducing Document Preparation A with L TEX Stan Reeves Introduction A L TEX Math spacing carefully derived based on typesets in: Acta Mathematica Indagationes Mathematicae Addison-Wesley's books Editors Automation Prosper Beamer Posters Line breaks A total-fit line-breaking algorithm Assigns badness. Minimizes SS of badness Hyphenation algorithm Removes prefixes and suffixes Will attempt to put a break between consonants in a pattern of the form vowel-consonant-consonant-vowel. 3 / 38 A TEX and LTEX Introducing Document Preparation A with L TEX Stan Reeves Introduction A L TEX Math spacing carefully derived based on typesets in: Acta Mathematica Indagationes Mathematicae Addison-Wesley's books Editors Automation Prosper Beamer Posters Line breaks A total-fit line-breaking algorithm Assigns badness. Minimizes SS of badness Hyphenation algorithm Removes prefixes and suffixes Will attempt to put a break between consonants in a pattern of the form vowel-consonant-consonant-vowel. A LTEX is a set of macros for TEX A Written by Leslie Lamport (1984), current release LTEX2 3 / 38 A Pronunciation and Typesetting of LTEX Introducing Document Preparation A with L TEX Stan Reeves Introduction A L TEX no single agreed-upon pronunciation TEX derives from the Greek , which means "art, skill, craft" origin of the name suggests that "X" be pronounced like the "ch" in "technical" Options: LAYtek LAHtek LahTEK A A A In LTEX, the symbol is a built-in LTEX command LTEX. In plain text, it should be spelled L-a-T-e-X. Editors Automation Prosper Beamer Posters 4 / 38 A Why LTEX? Introducing Document Preparation A with L TEX Stan Reeves Introduction A L TEX Editors Automation Prosper Beamer Posters It is a natural choice if you want to create beautiful output A structured system of typesetting. Spend time and effort on content not on layout Works across platforms Handles math well Table of contents, list of figures, bibliography etc. Cross-referencing features Stable processing engine Highly extensible Input is plain text Output can be anything Complete document preparation. Articles, presentations, posters, HTML. 5 / 38 A Why LTEX? Introducing Document Preparation A with L TEX Stan Reeves Introduction A L TEX Editors Automation Prosper Beamer Posters 5 / 38 It is a natural choice if you want to create beautiful output A structured system of typesetting. Spend time and effort on content not on layout Works across platforms Handles math well Table of contents, list of figures, bibliography etc. Cross-referencing features Stable processing engine Highly extensible Input is plain text Output can be anything Complete document preparation. Articles, presentations, posters, HTML. FREE & open source A LTEX vs. MS Word Introducing Document Preparation A with L TEX Stan Reeves Introduction A L TEX Editors Automation Prosper Beamer Posters WYSIWYG Platform independent Math Citations & references Automated TOC, LoF Cross-references Style changes Multimedia Free A LTEX × MS Word × × × × × 6 / 38 A Why LTEX? Introducing Document Preparation A with L TEX Stan Reeves Introduction A L TEX Editors Automation Prosper Beamer Posters Imn () = 2 I0 ()Tm () rm +wm rn +wm +pT dx p=- rm rn+pT PSF(x - x )dx 7 / 38 A Why LTEX? Introducing Document Preparation A with L TEX Stan Reeves Introduction A L TEX A LTEX Editors Automation Prosper Beamer Posters Imn () = 2 I0 ()Tm () rm +wm rn +wm +pT dx p=- rm rn+pT PSF(x - x )dx MS Word Equation Editor 7 / 38 A Why LTEX? Introducing Document Preparation A with L TEX Stan Reeves Introduction A L TEX Editors Automation Prosper Beamer Posters 8 / 38 Installation Introducing Document Preparation A with L TEX Stan Reeves Introduction A L TEX Packages Windows Mac Linux Back-end MikTEX , TEXLive CMacTEX, OzTEX teTEX, TEX Live Front-end WinEdt, TEXnicCenter TEXShop iTEXMac Kile Editors Automation Prosper Beamer Posters CoE Windows labs have: MikTEX TEXnicCenter 9 / 38 A LTEX for the PC Introducing Document Preparation A with L TEX Stan Reeves Introduction A L TEX A To install LTEX on your PC you need: The back-end: The base TEX package Windows (MikTEX). Available at the MikTEX homepage TEXLive Ghostscript, Ghostview, and GSview. A The front-end: A LTEX editor (WinEdt, TEXnicCenter) Editors Automation Prosper Beamer Posters WinEdt: evaluation version. TEXnicCenter: free Available at the WinEdt homepage or at Sourceforge.net 10 / 38 The downside Introducing Document Preparation A with L TEX Stan Reeves Introduction A L TEX There are certain "disadvantages" Somewhat steep learning curve Not interactive. Have to use pre-viewer before finalizing document Difficult to create your own document type Editors Automation Prosper Beamer Posters 11 / 38 A LTEX workflow A LTEX workflow Document preparation Introducing A with L TEX Document Preparation Auburn U. A with L TEX Chapter of SIAM and Stan Reeves IEEE Student Chapter Introduction AT X LIntroduction E A L TEX Editors Editors Automation Automation Prosper Prosper Beamer Beamer Posters Posters pdflatex is an alternative workflow that goes straight from the *.tex file to a PDF file. 12 / 38 Getting started Introducing Document Preparation A with L TEX Stan Reeves Introduction A L TEX \documentclass{article} \begin{document} \section{Introduction} The conditional probability of an event $A$ assuming another event $M$, denoted by $P(A\,|M)$, is by definition the ratio \begin{align} P(A\,|M) &= \frac{P(AM)}{P(M)} \end{align} \subsection{Bayes's theorem} Bayes's theorem for probability densities is given by: \begin{align} p(x|y) &= \frac{p(y|x)p(x)}{p(y)} \end{align} \end{document} Editors Automation Prosper Beamer Posters 13 / 38 Getting started Introducing Document Preparation A with L TEX Stan Reeves Introduction A L TEX Editors Automation Prosper Beamer Posters 14 / 38 LaTeX Documents Introducing Document Preparation A with L TEX Stan Reeves Introduction A L TEX A \ is used to start LTEX commands Editors Automation Prosper Beamer Posters % is used to start a comment &, $, #, , ^, { } and ~ are special characters Words are separated by one or more spaces. Paragraphs are separated by one or more blank lines. 15 / 38 Sectioning commands Introducing Document Preparation A with L TEX Stan Reeves Introduction A L TEX The sectional units in an article are produced by the following commands: \chapter{title} \section{title} \subsection{title} \subsubsection{title} \paragraph{title} Editors Automation Prosper Beamer Posters 16 / 38 List Environments Introducing Document Preparation A with L TEX Stan Reeves Introduction A L TEX \begin{itemize} \item enumerate: Numbered lists \item itemize: Bulletted lists \end{itemize} Editors Automation Prosper Beamer Posters enumerate: Numbered lists itemize: Bulleted lists \begin{enumerate} \item enumerate: Numbered lists \item itemize: Bulletted lists \end{enumerate} 1 2 17 / 38 enumerate: Numbered lists itemize: Bulletted lists Math Introducing Document Preparation A with L TEX Stan Reeves Introduction A L TEX Inline math Inline math appears within a line and must appear enclosed in $ signs. $x^2 = 2 \Rightarrow x = \pm \sqrt{2}$. Editors Automation Prosper Beamer Posters Inline math appears within a line and must appear enclosed in $ signs. x2 = 2 x = ± 2. Equations \begin{align} \cal{F}(\omega) = \int _{-\infty}^{\infty} f(t)e^{-j \omega t} dt \end{align} - F () = f (t) e-jt dt (1) 18 / 38 More math Introducing Document Preparation A with L TEX Stan Reeves Introduction A L TEX Editors Automation Prosper Beamer Posters The Fibonacci numbers form a sequence defined recursively by: \begin{align} F(n) &= \begin{cases} 0, & \mbox{if} n=0; \\ 1, & \mbox{if} n=1; \\ F(n-1) + F(n-2) \mbox{otherwise}. \end{cases} \end{align} The Fibonacci numbers form a sequence defined recursively by: 0, if n = 0; F(n) = 1, if n = 1; F(n - 1) + F(n - 2) otherwise. (3) 19 / 38 Customizing Introducing Document Preparation A with L TEX Stan Reeves Introduction A L TEX \documentclass{article} \newcommand{\parD}[2]{\frac{\partial #1}{\partial #2}} \newcommand{\parDD}[2]{\frac{\partial^2 #1}{\partial^2 #2}} \begin{document} \begin{align*} \parD{}{x} \left( \parD{y}{x} \right) = \parDD{y}{x} \end{align*} Editors Automation Prosper Beamer Posters x y x = 2y x2 20 / 38 Figures Figures Introducing Document Document Preparation preparation A A with L TEX X with L TE StanAuburn U. Reeves Chapter of SIAM and Introduction IEEE Student AT X Chapter L E Editors Introduction Automation A L TEX Prosper Figures Editors Beamer Automation Document preparation A with L TEX \documentclass{article} \usepackage{graphicx} \documentclass{article} \usepackage{graphicx} \begin{figure}[!h] \centering \begin{figure}[!h] \includegraphics[width=5cm]{ginn_logo.pdf} \centering Figures \caption{CoE logo} \includegraphics[width=5cm]{ginn_logo.pdf} \end{figure} \caption{CoE logo} Document preparation A with \end{figure} L TEX Auburn U. Chapter of SIAM and IEEE Student Chapter Introduction \documentclass{article} \usepackage{graphicx} \begin{figure}[!h] \centering \includegraphics[width=5cm]{ginn_logo.pdf} \caption{CoE logo} \end{figure} Posters Prosper Beamer Posters Auburn U. Chapter of SIAM and IEEE Student Chapter \documentclass{article} \usepackage{graphicx} A L TEX Introduction A L TEX \begin{figure}[!h] \centering \includegraphics[width=5cm]{ginn_logo.pdf} \caption{CoE logo} \end{figure} Editors Automation Prosper Beamer Posters Editors Automation Prosper Beamer Posters 21 / 38 Video Introducing Document Preparation A with L TEX Stan Reeves Introduction A L TEX Editors Automation Prosper Beamer Posters Flow behind a cylinder - vorticity contours 22 / 38 TEXnicCenter Introducing Document Preparation A with L TEX Stan Reeves Introduction A L TEX Editors Automation Prosper Beamer Posters 23 / 38 Cross-referencing Introducing Document Preparation A with L TEX Stan Reeves Introduction A L TEX Can cross-reference figures, tables, equations, sections using: \label{name}, %\label{eq:wav}, \label{sec:wav}, \label{fig:wav} \ref{name} For example \begin{align}\label{eq:partial} \parD{}{x} \left( \parD{y}{x} \right) = \parDD{y}{x} \end{align} Eq. \ref{eq:partial} describes \ldots Editors Automation Prosper Beamer Posters x 24 / 38 y x = 2y x2 (4) Eq. 4 describes . . . References and citations Introducing Document Preparation A with L TEX Stan Reeves Introduction A L TEX The BibTEX package Create a bibliography database with a .bib extension: e.g., bibdatabase.bib Include following two lines where you want the bibliography to appear \bibliographystyle{style} %% (plain, alpha, abbrv, unsrt) \bibliography{bibdatabase} Editors Automation Prosper Beamer Posters 25 / 38 BibTEX entry Introducing Document Preparation A with L TEX Stan Reeves Introduction A L TEX A BibTEX entry looks like: @article{lane87, title = "Automatic multidimensional deconvolution", author = "R. G. Lane and R. H. T. Bates", JOURNAL = "Journal of the Optical Society of America", YEAR = "1987", VOLUME = "4", NUMBER = "1", PAGES = "180-188", MONTH = "January" } Editors Automation Prosper Beamer Posters 26 / 38 BibTEX entry types Introducing Document Preparation A with L TEX Stan Reeves Introduction A L TEX Editors Automation Prosper Beamer Posters @booklet @conference @incollection @manual @misc @techreport @proceedings @inbook @inproceedings @mastersthesis @phdthesis @unpublished 27 / 38 Citations Introducing Document Preparation A with L TEX Stan Reeves Introduction A L TEX Use the \cite{key} command to include citations. The authors in [1] propose a new method to melt ice. Editors Automation Prosper Beamer Posters The authors in \cite{key} propose a new method to melt ice. 28 / 38 Citations Introducing Document Preparation A with L TEX Stan Reeves Introduction A L TEX Use the \cite{key} command to include citations. The authors in [1] propose a new method to melt ice. A To include an entry that was not cited in the LTEX document, add: \nocite{key} Editors Automation Prosper Beamer Posters The authors in \cite{key} propose a new method to melt ice. 28 / 38 Citations Introducing Document Preparation A with L TEX Stan Reeves Introduction A L TEX Use the \cite{key} command to include citations. The authors in [1] propose a new method to melt ice. A To include an entry that was not cited in the LTEX document, add: \nocite{key} Editors Automation Prosper Beamer Posters The authors in \cite{key} propose a new method to melt ice. May also use \nocite{*} 28 / 38 JabRef Introducing Document Preparation A with L TEX Stan Reeves Introduction A L TEX Editors Automation Prosper Beamer Posters 29 / 38 Presentations Introducing Document Preparation A with L TEX Stan Reeves Introduction A L TEX http://prosper.sourceforge.net/ Prosper Needs the following packages: prosper seminar pstricks Editors Automation Prosper Beamer Posters http://latex-beamer.sourceforge.net/ Beamer Needs the following packages: latex-beamer xcolor pgm 30 / 38 Beamer documents Introducing Document Preparation A with L TEX Stan Reeves Introduction A L TEX Uses the frame environment. A slide is defined within %\begin{frame} Slide body %\end{frame} Preserves document structure Very customizable Allows for overlays Editors Automation Prosper Beamer Posters 31 / 38 Beamer documents Introducing Document Preparation A with L TEX Stan Reeves Introduction A L TEX Uses the frame environment. A slide is defined within %\begin{frame} Slide body %\end{frame} Preserves document structure Very customizable Allows for overlays Auto-generation of ToCs and ToFs Beamer tour: http://latexbeamer.sourceforge.net/beamerexample1.pdf. Editors Automation Prosper Beamer Posters 31 / 38 Posters Introducing Document Preparation A with L TEX Stan Reeves Introduction A L TEX Editors Automation Prosper Beamer Posters The a0poster.cls class file can be used to create upto A0 size posters. It offers the following capabilities Allows for paper sizes A0, A1, A2, A3, & A4 Allows font sizes from 12pt­107pt Scales formulas and math symbols The package also creates a postscript header file for dvips to ensure that the poster will be printed in the right size. 32 / 38 a0poster.cls Introducing Document Preparation A with L TEX Stan Reeves Introduction A L TEX A The header of a LTEX poster document looks like: \documentclass[options]{a0poster} \usepackage{graphicx,pstricks,...} \begin{document} Editors Automation Prosper Beamer Posters The following options are available: landscape portrait a0b a0 a1 a2 a3 posterdraft final landscape format portrait format "DIN A0 big" DIN A0 DIN A1 DIN A2 DIN A3 reduces the postscript output to DIN A4 size. makes postscript output in original size 33 / 38 LyX Introducing Document Preparation A with L TEX Stan Reeves Introduction A L TEX LyX is a TEX based WYSIWYM editor Available for multiple platforms Offers a GUI with menus Supports BibTEX Has WYSIWYG table and math editors Uses TEX rules for indents, spacing, and hyphenation Editors Automation Prosper Beamer Posters 34 / 38 A LTEX in plotting tools Introducing Document Preparation A with L TEX Stan Reeves Introduction A L TEX A MATLAB supports LTEX Editors Automation Prosper Beamer Posters A Figure labels and other text can be parsed by a LTEX interpreter The latex command translates MATLAB matrices into A LTEX arrays A Can publish a formatted m-file, including LTEX A constructs, as a LTEX document 35 / 38 A LTEX in plotting tools Introducing Document Preparation A with L TEX Stan Reeves Introduction A L TEX Editors Automation Prosper Beamer Posters A PGFPLOTS is a drawing package for LTEXbased on PGF/Tikz text-based specification of plots can actually calculate and evaluate figures 36 / 38 A LTEX at Auburn Introducing Document Preparation A with L TEX Stan Reeves Introduction A L TEX Editors Automation Prosper Beamer Posters The Graduate School maintains AU thesis and dissertation style files A AU allows LTEX for theses. Formatting restrictions have been relaxed. Color and multimedia as well as hyper-references are possible in PDF files. We have a rather inactive tex-users mailing list. 37 / 38 Summary Introducing Document Preparation A with L TEX Stan Reeves Introduction A L TEX A LTEX is a programming language, not an application A An abundance of LTEX utilities are available for different platforms A All LTEX components and packages are free and easily available Editors Automation Prosper Beamer Posters It can be used to generate various document types Style files for Auburn University theses are available 38 / 38