Getting Started with L A T E X for a Technical Document or Thesis

Similar documents
L A TEX Tutorial. 1 Introduction. 2 Running L A TEX. J. E. Rice. May 2010

Intro to LATEX I. Aaron Erlich POLS/CSSS 510, Why LATEX? Programming Document Structure Floats Tables Lists Math

A Very Brief Introduction to L A T E X MAT 3535

L A TEX for Psychological Researchers

Introduction to L A TEX

Written & Oral Presentation: Computer Tools

Introduction to LaTeX. Paul Fodor Stony Brook University

David Helmbold, October 2005, Revised October 2007

Workshop P. Stallinga 16-X-2012

Math 235: Introduction to LaTeX

An Introduction to LATEX

The Name of the Game. An Introduction to LATEX. Why L A TEX? The Name of the Game

LaTeX A Tutorial. Mohsen Alimomeni, 2010

An Interactive Introduction to L A TEX

Introduzione a LaTex. Fabrizio Messina

L A T E X FOSSEE. Department of Aerospace Engineering IIT Bombay. FOSSEE (IIT Bombay) LAT E X 1 / 58

Lecture 1. MA2730: Analysis I. Lecture slides for MA2730 Analysis I. Study and Assessment Components. MA L A TEX: topics for Lecture 1

Assessments for CS students:

Introduction to LAT E X

Introduction to LAT E X

Began as TeX, in 1982 (Knuth). Purely a typesetting tool. LaTeX added macros, maintaining TeX as it s typesetting engine (Lamport).

Become a L A TEX Guru

COMP496/901: Academic Presentation and Writing Skills Using LaTeX

An Interactive Introduction to L A TEX. Part 1: The Basics. John Lees-Miller. writel A TEX

L A T E X Workshop. Bijulal D & Anu Thomas Industrial Engineering and Operations Research Indian Institute of Technology

Helen Cameron. A Brief Overview of LATEX

Introduction to L A TEX

Learning LaTeX: The Basics

L A TEX. COMPSCI 111 / 111G Mastering Cyberspace: An introduction to practical computing. LaTeX. Development. Why?

Introduction to LATEX

What is LaTeX. Is a document markup language and document preparation system for the TeX typesetting program

Intro to LaTeX Workshop

Latex Tutorial. CIS400 Senior Design 9/5/2013

(Yet Another) Introduction to L A TEX 2ε (V3)

An introduction to L A TEX for students

Introduction to L A TEX

L A TEX for Psychological Researchers

Outline. Installing LaTeX. Opening TeXShop. Intro to LaTeX. Intro to LaTeX interface Working with text Tabbing and tables Figures Math and equations

Formatting with LaTeX

L A TEX. The Logo. Introduction to L A TEX. Overview. Primary Benefits. Kinds of Documents. Bill Slough and Andrew Mertz

LaTeX. Information Literacy II EN(IL2) Course

An introduction to LaTeX

Helen Cameron. A Brief Overview of LATEX

An Introduction to L A TEX

MATLAB for the Sciences

What is T E X? T E X and L A T E X Document preparation tools. Setting and casting type. What Knuth was setting. Setting and casting type

L A TEX Workshop. Don Brower

Environments, Equations, and Tables

Introduction to L A T E X

An Introduction to LATEX

A Short L A TEX Introduction

A Short Introduction to L A TEX

COMS 6100 Class note

LaTeX Seminar III: Environments and More Advanced Mathematical Typesetting

Learn how to [learn] LATEX

Basic L A TEX. what is LaTeX?

Meeting One. Aaron Ecay. February 2, 2011

Guide to using L A TEX

Effective Programming Practices for Economists

L A TEX Overview. Jiayi Liu. January 31, Colorado School of Mines

The basics of LaTeX. Cédric Buron. April 25, 2016

Very Short Introduction to LaTeX

Typing Mathematics. Darrin Doud

Introduction to LaTex 2ε. Based on The Not So Short Introduction to LaTeX 2ε by Tobias Oetiker et al., April 2001

Introduction to Scientific Typesetting Lesson 1: Getting Started

1 Different Document Classes

Introduction to MCS 220 and L A TEX

Introduction to L A TEX

Introduction to Latex. A workshop by Dr. Ala Eshmawi

A Beginner s guide to L A TEX for CSCA67/MATA67. Kohilan Mohanarajan

Introduction to L A T E X

A quick guide to L A TEX

An introduction to LaTeX

Introduction to L A TEX beamer

Explanatory note on the LaTeX thesis template. Basic knowledge of using LaTeX

A brief introduction to L A TEX

L A TEX Document Formatting Examples

Note di Matematica instructions for authors

Lecture 1: Short summary of LaTeX basics

Using L A TEX. A numbered list is just that a collection of items sorted and labeled by number.

Using L A TEX Tom Edgar

T E X and L A T E X Document preparation tools

1 Obtaining LyX and L A TEX

How to L A TEX. George Wong, David Mykytyn. 6 October 2016

An Introduction to. Andrew G. West, Jian Chang CIS400 Senior Design Tutorial September 15, 2009

LaTeX: Scientific Document Writing

LATEX Workshop. Yi Liu Chen SUNY Geneseo PRISM Math Club. February 6, Wordmark Reversed Geneseo Wordmark Style Guide 4

Typesetting in wxmaxima

An Interactive Introduction to L A TEX. Part 2: Structured Documents & More. Dr John D. Lees-Miller. writel A TEX.

L A TEX: Online module 6

Latex Tutorial 1 L A TEX. 1.1 Text

Creating Tables and Figures with L A T E X

L A TEX minicourse. dstowell, mag, sar, scannell,... September Typeset by FoilTEX

My Mathematical Thesis

L A TEX examples. a b c a b c b b a c b c c b a. This table was typeset with the following commands.

A Brief Introduction to L A TEX

Getting started General Tables Figures Math Wrap up. UCLA Department of Statistics Statistical Consulting Center. LaTeX Bootcamp

Introduction to Scientific Typesetting Lesson 7: Graphics and Floats

Tools for Scientific Writing with LAT E X. Johan Carlson

University of Waterloo E-Thesis Template for LATEX

Transcription:

Getting Started with L A T E X for a Technical Document or Thesis University of Waterloo Nov 2015

Outline What is LAT E X? 1 What is L A T E X? 2 3 4 5

What is L A T E X? What is LAT E X? L A T E X is a mark-up language for typesetting documents (Leslie Lamport, 1985).... based on T E X, a typesetting system created by Donald Knuth (1977) L A T E X is simpler and more structured than T E X (it s a macro language). L A T E X attempts to separate the content from the look of the document. L A T E X is not a WYSIWYG word processor.

What is L A T E X? 2 L A T E X and T E X have stong mathematical typsetting capabilities. The source document is plain text so is easily portable. L A T E X is available as free software on all computing platforms. To produce a typeset document, the plain text source file is processed by a suite of programs. There are commercial versions of L A T E X that provide a slicker user interface, e.g., TeXtures, Scientific Workplace

1 All L A T E X mark-up commands begin with a \. Commands use braces { } to indicate the argument (scope): e.g., \emph{this text emphasized} Some commands can act as on-off switches (no argument): e.g., \large turns on larger font size (scope not explicit) Commands may have options: e.g., \documentclass[12pt,twocolumn]{article}

2 There are 10 special characters used in L A T E X commands: \ # $ % & ~ _ ^ { } Backslash, tilde and caret are produced with: \textbackslash \textasciitilde \textasciicircum Other special characters are entered as text by preceding them with a backslash. Extra spacing between words and commands is ignored. Anything following % is ignored. A blank line indicates a new paragraph.

3 Environments define more complex structures, scoped with \begin and \end commands: e.g., \begin{itemize}... \end{itemize} Environments define their own commands e.g., \item defines an item within a list. Some environments are automatically numbered e.g., section and equation The starred form turns off auto-numbering e.g., \begin{equation*}

Text Mode and Math Mode L A T E X typesets text and math differently. Text (paragraph) mode is the default. Math mode must be turned on explicitly by using special delimiters $...$ or by using a math environment. Font changing commands are different in text and math modes: e.g., \textbf vs. \mathbf for bolding.

Source File Preamble The source file(s) contain the document text and L A T E X mark-up. There is one master source file, beginning with the \documentclass command. The preamble section defines: the document type via \documentclass add-on packages needed e.g., \usepackage{amsmath,amssymb} any special dimensions, e.g., margins, spacing any user-defined commands or environments

Source File Logical Document The document section lies between \begin{document} and \end{document} commands. The logical document contains the content material and mark-up. Other source files e.g., chapters, may be read into the master file with \input{filename.tex} commands. Additional source files should not contain a preamble section or \begin{document} and \end{document} commands.

Text Mark-up 1 What is LAT E X? There are a few simple commands to remember: 1 L A T E X recognizes three types of dashes Punctuation - - -, or \textmdash e.g., He jumped too late. Range - -, or \textndash e.g., chapters 1 12 Interword - e.g., thought-provoking 2 Use pairs of opening and closing single quotes rather than double quotes, to get this rather than "this".

Text Mark-up 2 What is LAT E X? 3 Force a space with a backslash followed by a space. e.g., L A T E Xbeats Word! (\LaTeX beats Word!) e.g., L A T E X beats Word! (\LaTeX\ beats Word!) 4 If necessary, force a line break with \\ 5 Prevent inappropriate line break with tilde e.g., Ms.~Wong or \mbox{no breaks in here}. 6 Ellipsis... is produced with \ldots. 7 Change font sizes: \tiny, \small, \large, \Large, \LARGE, \huge, \Huge

Text Mark-up 3 Environments List-type environments: Bulleted lists Use the itemize environment. Numbered lists Use enumerate. Descriptions Use description. Example: \begin{enumerate} \item First item \item Second item \end{enumerate} List environments can be nested. 1 First item 2 Second item

Text Mark-up 4 Layout Layout environments: Tables Use tabular. Borders optional. Fancier Layout Use minipage. Example table: \begin{tabular}{lr} One & Two Three & Four \end{tabular} Example minipage: \begin{minipage}{4cm} This is some text in a minipage. \end{minipage} One Three Two Four This is some text in a minipage.

Text Mark-up 5 Cross-references Any numbered structure (section, equation, etc.) can be given a name. When that name is referred to, the number is inserted. Use e.g., \label{sec-intro} right after the \begin{section} command. Refer to label in text with \ref{sec-intro} e.g., In section~\ref{sec-intro}

Math Mark-up 1 What is LAT E X? Only certain fonts contain many math symbols: Computer Modern (the default Donald Knuth-designed font) Lucida Bright Times AMS packages amsmath, amssymb, amstext provide many useful environments and symbols (hundreds!). Math content can be in-line or displayed. In-line Between $ s or \( and \). Displayed Use equation or equation* environments. Text can be added in math mode: e.g., \text{some text} (requires amstext)

Math Mark-up 2 What is LAT E X? Spacing in math mode can be adjusted manually, if necessary. Default Spacing 34 \, \thinspace 3 4 \; \medspace 3 4 \; \thickspace 3 4 \quad 3 4 \qquad 3 4 \! \negthinspace 34 \negmedspace 34 \negthickspace 34

Math Mark-up 3 Simple Example In-line Math: We define matrix $A_{m \times n}$, where $m=4$ and $n=5$. We define matrix A m n, where m = 4 and n = 5. Example Displayed Math: \begin{equation*} \label{quad_form} x = \frac{ -b \pm \sqrt{b^2-4ac} }{ 2a} \end{equation*} For ax 2 + bx + c = 0, x = b ± b 2 4ac 2a is the quadratic formula.

Math Mark-up 4 Multi-line Eqns Example eqnarray environment: \begin{eqnarray} a &=& b+c-d \nonumber\\ a = b + c d &\:& +e-f\\ +e f (1) &=& g+h\\ = g + h (2) &=& i = i (3) \end{eqnarray} Suppress a line number with \nonumber. An eqnarray has exactly 3 columns, tabbed with &.

Math Mark-up 5 Matrices & Arrays Example Matrix: \begin{equation*} \begin{bmatrix} \alpha & \beta^{*}\\ \gamma^{*} & \delta \end{bmatrix} \end{equation*} Example Array: \begin{equation*} \left \begin{array}{lr} 1 & \cos(\theta) \\ \sin(\theta) & 0 \end{array}\right \end{equation*} [ ] α β γ δ 1 cos(θ) sin(θ) 0

Math Mark-up 6 Cases Example Case: \begin{equation*} P_{r-j} = \begin{cases} 0 & \text{if $r-j$ odd},\\ r!\,(-1)^{(r-j)/2} & \text{if $r-j$ even}. \end{cases} \end{equation*} { 0 if r j odd, P r j = r! ( 1) (r j)/2 if r j even.

Math Markup 7 Cross-References Use \label and \eqref e.g., \begin{equation} \label{alg} \begin{split} a = b+c-d\\ +e-f \end{split} \end{equation} In equation \eqref{alg}, \ldots a = b + c d +e f In equation (4)... (4)

1 Encapsulated Postscript The latex formatter only allows embedded EPS figures. Encapsulated PostScript is PS that describes a partial page. PS is easily produced from your favourite drawing package via Print to file though a Postscript print driver. GSView can convert PS to EPS (calculates the drawing s bounding box ). Your drawing program may also export to EPS directly. Otherwise, programs such as ImageMagic can convert among many image formats.

2 \includegraphics Graphics are included via the \includegraphics command, defined by the graphicx package. e.g., \includegraphics[height=5cm]{myfig.eps} Options to \includegraphics allow resizing, etc. However, it s better to draw your figures to the size you need (to avoid problems with scaling text annotations). Common options to \includegraphics are: width=, height= Set only one to keep original proportions. clip=true For cropped images, ensure the figure is clipped to the bounding box.

3 Portable Document Format The pdflatex formatter only allows embedded graphics in the following formats: PDF JPEG PNG TIFF For PDF documents vector graphics are preferred, to allow zooming without degradation. EPS is a scalable vector graphic format. EPS drawings may be converted to PDF through GSView or Acrobat Pro. Graphics are included via the \includegraphics command (as above).

4 Floating Figures (and Tables) The figure and table environments provide floating structures that are numbered and captioned. Captions are listed in the lists of figures and tables. q p \begin{figure}[htbp] \begin{center} \includegraphics[clip=true]{beam.pdf} \end{center} \caption{cantilever Beam} \label{fig.beam} \end{figure} A B r l Figure: Cantilever Beam

5 Floats... continued Floating structures are placed in the document by L A T E X where they cause the least disruption to the look of the typesetting. Options [htbp] allow you to state your location preferences in order. h Here, if possible t Top of a following page b Bottom of current or following page p Page of floats The float package provides the H option for keeping a figure environment from floating. The floatfig provides for wrapping text around narrow floating figure environments.

Thesis Template Example Preamble % Example thesis for formatting with "latex", i.e. EPS figs. and dvips DVI formatter \documentclass[12pt]{report} \usepackage{amsmath,amssymb,amstext} % lots of Math symbols and environments \usepackage[dvips]{graphicx} % includegrahics environment \usepackage[dvips=true,bookmarks=true]{hyperref} % hyperlinks in PDF % Create a listing in the log of all files needed to process this document \listfiles % Reset page margins according to UW thesis regulations \setlength{\hoffset}{0pt} % 1 inch left margin \setlength{\oddsidemargin}{0pt} % 1 inch left margin \setlength{\voffset}{0pt} % 1 inch top margin \setlength{\marginparwidth}{0pt} % no margin notes \setlength{\marginparsep}{0pt} % no margin notes \raggedbottom \renewcommand{\baselinestretch}{1.2} % 1.2 line spacing for legibility (optional)

What is LAT E X? The UW LaTeX for EThesis and Large Documents page. The Comprehensive TeX Archive Network where all things T E X and L A T E X are found. There are many good books on L A T E X. The standards are: L A T E X, A Document Preparation System, by Lamport The L A T E X Companion, by Goosens, Mittelbach and Samarin