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

Similar documents
Math 235: Introduction to LaTeX

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

Guide to using L A TEX

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

Introduction to L A TEX

عمادة البحث العلمي جامعة الملك سعود

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

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

Introduction to LaTeX. Paul Fodor Stony Brook University

David Helmbold, October 2005, Revised October 2007

Learning L A TEX. Patrick Lam

An Introduction to L A TEX

Getting Started in L A TEX

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

L A TEX for Psychological Researchers

A brief introduction to L A TEX

TUTORIAL 10: ARRAYS AND MATRICES. 1. Welcome. Hello. My name is Dr. Christopher Raridan (Dr. R). I want to welcome you to the L A TEX Tutorial Series.

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.

Become a L A TEX Guru

Basic L A TEX. what is LaTeX?

Introduction to L A TEX

Introduction to Latex. A workshop by Dr. Ala Eshmawi

Learning LaTeX: The Basics

Assessments for CS students:

Learn how to [learn] LATEX

L A TEXInstallation and Introduction

1. Welcome. (1) Hello. My name is Dr. Christopher Raridan (Dr. R). (3) In this tutorial I will introduce you to the amsart documentclass.

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

Basics. Options. Commands

Mikkel Madsen

L A TEX From The Ground Up

Getting started with Latex

Introduction to LAT E X

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

Introduction to LAT E X

CS 189 L A TEX and Linux: Displaying Text

MATLAB for the Sciences

Abstract A quick intro by examples to the document preparation language L A TEX.

PHYS-4007/5007: Computational Physics

LAT E X week 2: Basics for Writing a Document

A Short Introduction to L A TEX

1 Obtaining LyX and L A TEX

Helen Cameron. A Brief Overview of LATEX

Introduction to L A TEX

Introduzione a LaTex. Fabrizio Messina

Outline. A Sneak Peek

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

Mikkel Madsen

Introduction to LATEX

simpletex Documentation

Not-So-Frequently Asked Questions for L A TEX

Helen Cameron. A Brief Overview of LATEX

Introduction to LATEX

An introduction. C.D. Emmery & M.M. van Zaanen. October 22, Tilburg University

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

Getting Funky: Headers, Tables, Abstracts etc.

WYSIWYG Systems. CSCM10 Research Methodology Lecture 4 (11/2/16): A Taster of L A TEX WYSIWYM. Advantages/Disadvantages of WYSIWYG Systems

My LaTeX Document. July 7, Introduction 2

EGR 53L - Spring 2011

Part - I : Short Course Typing Text

Math 291: Lecture 5. Dr. Fagerstrom. Minnesota State University Moorhead web.mnstate.edu/fagerstrom

CSCM10 Research Methodology A Taster of L A TEX

Researcher Development Unit: Introduction to Latex

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

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

INTRODUCTION TO L A TEX

Square cells: an array cooking lesson

An Introduction to. Rado Ivanov CIS400 Senior Design Tutorial September 18, 2014

L A TEX and Basic Text Editing

Workshop on LaTeX. Outline. Muhammad Mostafa Monowar 11/13/2017

Student Learning Service: Introduction to Latex

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

An Interactive Introduction to L A TEX

Meeting One. Aaron Ecay. February 2, 2011

L A TEX Workshop. Don Brower

Course A, Part 1 Basic Formatting in L A TEX

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

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

Latex Tutorial. CIS400 Senior Design 9/5/2013

Useful L A TEX Commands

Introduction to Scientific Typesetting Lesson 1: Getting Started

Using LaTex and BibTex to Write Academic Documents. Ligang He Department of Computer Science University of Warwick

Dec. 27 th, 2010 University of Isfahan

My Mathematical Thesis

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

An Introduction to LATEX

A quick guide to L A TEX

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

L A TEX for Psychological Researchers


LaTeX A Tutorial. Mohsen Alimomeni, 2010

COMP496/901: Academic Presentation and Writing Skills Using LaTeX

Getting Started with L A TEX

INTRODUCTION TO L A TEX WHAT IS L A TEX?

Introduction to L A TEX

Absolute L A TEX Beginner

Introduction to LaTeX. M&S Talk Series August 16 th, 2016 AH Sheikh

Introduction to MCS 220 and L A TEX

CSCM10 Research Methodology A Taster of L A TEX

Written & Oral Presentation: Computer Tools

Transcription:

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

What it is What is L A TEX? a typesetting system for creating high-quality documents allows you to create complex-looking output from a simple text file tags used to describe logical structure of document Why learn L A TEX? looks much cooler than Word, HTML or Framemaker easier : instead of dictating exactly how document should be laid out, only describe its logical structure faster : text-based instead of GUI-based more powerful it s like coding your essays! Typeset by FoilTEX 1

How it works L A TEX is not a WYSIWYG editor. You first type your code in your favorite editor (vi, emacs...) and then L A TEX processes the file and creates a.dvi. You can view this file using xdvi: xemacs foo.tex latex foo.tex xdvi foo.dvi eg. If you want to print the file to a Postscript file, use dvips, dvips -o foo.ps foo.dvi eg. If you want to print the file to a PDF file, use pdflatex, pdflatex foo.dvi This creates foo.pdf. Typeset by FoilTEX 2

Work with me here Skeleton documents are available in /pro/consult/minicourses/latex/examples sample.tex paper.tex graphics.tex hw.tex your basic skeleton L A TEX document skeleton document for writing an essay example of including graphics in L A TEX skeleton document for doing theory/math homeworks Work along and try out the examples as we go! Typeset by FoilTEX 3

Basic syntax Here s an example of a simple L A TEX file: % This is a comment. \documentclass[12pt]{article} \begin{document} Hello, this is a sample file. As you can see, spaces don t matter, it ll all be formatted by \LaTeX\ so you can type it however you want it. An empty line creates a new paragraph. \end{document} %REQUIRED %REQUIRED. 12pt is the size of the font %article is probably what you want %REQUIRED Here s the L A TEX output: Hello, this is a sample file. As you can see, spaces don t matter, it ll all be formatted by L A TEX so you can type it however you want it. An empty line creates a new paragraph. Typeset by FoilTEX 4

As you might notice, the code has L A TEX commands in it which all start with a \. These commands can take arguments using {} and []. Some commands also create environments to work on. They usually look like something like \begin{env}...\end{env}. Typeset by FoilTEX 5

Formatting L A TEX makes it easy for you to organize your document into logical sections. At the top of your document, define a title and author, and then in your document tell L A TEX to make the title: \documentclass[12pt]{article} \title{\latex\ minicourse} %Defines the document title \author{mike Coglianese \\ %Defines the document authors Thomas Crulli} \begin{document} \maketitle... %Document begins %Make the title here Sections can be used to create logical divisions in your document. For the article class, use \section{...}, \subsection{...}, and additional subdivisions.... \begin{document} %Document begins \section{why \Latex\ is great} \subsection{coolness Factor}... \section{\latex\ Web Sites}... Typeset by FoilTEX 6

Fonts There are many different font sizes and styles that you can use. L A TEX defines these in simple tags: \tiny \small \normalsize \large \Large \LARGE \huge \Huge \textnormal \textbf \texttt \emph \textsl \textit For example, this sentence looks like this: For example, {\Large this sentence} \emph{\textbf{\large looks}} {\small like this}: To have your paragraph outputted exactly as it appears (without processing L A TEX tags), use \begin{verbatim}. Typeset by FoilTEX 7

Spacing You can align your text using \begin{flushleft}, \begin{flushright}, \begin{center}. As with HTML, consecutive blank spaces and tabs are treated as one space. An exception is that a blank line starts a new paragraph. There are ways to increase spacing: \<space> Space \, Thin space \; Thick space \quad Quad \qquad Double Quad There are additional commands to set more precise spacing. \vspace{...} increases space between paragraphs, and \hspace{...} sets the spacing between words. Typeset by FoilTEX 8

Lists To create a list, use the \begin{itemize} environment. Then use \item to create a list item. For example: \begin{itemize} \item This is a list item. \item[-] This is a list item with a dash. \end{itemize} This gives the L A TEX output: This is a list item. - This is a list item with a dash. Use \begin{enumerate} to make an ordered list. Typeset by FoilTEX 9

Tables Tables are created using \begin{tabular}. Cells are delimited with an & character, and rows in the column end with \\. Here s an example: \begin{tabular}{ l r } %Two columns, first is left-aligned and %second is right-aligned. There are two %vertical bars at each side and one in %the middle \hline %A horizontal line Apples & 2.19 \\ %Cell one has Apples, cell two has $2.19 Fruit Loops & 3.25 \\ Crunch and Munch & 1.99 \\ \hline %A horizontal line \end{tabular} %Ends the table Apples 2.19 Fruit Loops 3.25 Crunch and Munch 1.99 Typeset by FoilTEX 10

Math rocks! What s really cool about L A TEX is that you can very easily embed equations. To write math, you switch to math mode using $...$, which puts the equation right in the paragraph, or using $$...$$, which centers the equation on a new line. For example, $\sum_{i=1}^{\infty}\frac{1}{i}$ is displayed as i=1 1 i, whereas $$\sum_{i=1}^{\infty}\frac{1}{i}$$ is displayed as i=1 1 i Use $\displaystyle...$ to make inline math symbols appear big, i.e. as if they were inside the $$...$$. Just like the other commands, math commands start with a backslash. Most of them make sense.. no need to memorize: x^y, x_y, \frac{x}{y} x y, x y, x y \sin x, \log x, \sqrt{x} sin x, log x, x 5 \lim_{n\to\infty} {5\over n} lim ( n n {n \choose k} n k) b \int_a^b dt a dt \gamma,\gamma γ, Γ Typeset by FoilTEX 11

Another important enivronment in math is the equation array, which lets you align correctly a set of equations together. b = a We multiply both sides by a. ab = a 2 ab b 2 = a 2 b 2 (b)(a b) = (a + b)(a b) b = a + b 1 = 2 Which was created using the following. Note the use of & around the equal sign to determine what to align with what and the use of \\ to go to the next line. \begin{align*} a &= b \\ \intertext{we multiply both sides by $a$:} ab &= a^2 \\ ab - b^2 &= a^2 - b^2 \\ (b)(a-b) &= (a+b)(a-b) \\ b &= a+b \\ 1 &= 2 \end{align*} Typeset by FoilTEX 12

You can also use \textrm{} to insert text in your math. For example: \begin{displaymath} P(X=i) = \left\{ \begin{array}{ll} {1\over36} & \textrm{if } 1 \leq i \leq 36 \\ 0 & \textrm{otherwise} \\ \end{array} \right. \end{displaymath} Is displayed in L A TEX as: P (X = i) = { 1 36 if 1 i 36 0 otherwise Note that all math symbols must be inside $...$, $$...$$, \begin{displaymath}, or \begin{eqnarray}! You will get errors when math symbols are outside of these. You should take a look at the extensive listings of math commands in the reference documents listed at the end of this tutorial. In order to access some formatting commands (such as textttalign*) and more obscure math symbols, you may need to include the following packages at the top of your document: amssymb, amsmath, and mathrsfs. To use a package, include the line \usepackage{<name>} in the preamble of your document. Typeset by FoilTEX 13

Algorithms The newalg package is very useful for writing nicely formatted algorithms in L A TEX. Here s an example: Sum(n) 1 sum 0 2 for i 1 to n 3 do sum sum + i 4 return sum Which is given by the following: \begin{algorithm}{sum}{n} sum \= 0 \\ \begin{for}{i \gets 1 \TO n} sum \= sum + i \end{for} \\ \RETURN sum \end{algorithm} The package can be kind of picky about where you should put your end of line markers (\\). Typeset by FoilTEX 14

My parents want me to take humanities So you re all set, you can type your math homework from the sunlab... oh wait, you still have to type papers? DON T LEAVE THE SUNLAB! Here are a couple commands that ll probably want to use: \linespread: lets you doublespace your text fancyhdr: lets you make more advanced headers. Here s an example: \documentclass[12pt]{article} \usepackage{fancyhdr} \addtolength{\oddsidemargin}{-.3in} \addtolength{\evensidemargin}{-.3in} \addtolength{\textwidth}{.6in} \linespread{1.6} \pagestyle{fancy} \begin{document} \markright{thomas Crulli\\ BS 77 10/1/98} \renewcommand{\headrule}{} \cfoot{\thepage} Blah, blah, blah... % your name and whatever goes in header % your paper goes here \end{document} Typeset by FoilTEX 15

What about graphics? Need to include graphics in your L A TEX document? Use the psfig package, and then use \psfig{file=...} to include the graphic : \documentclass[12pt]{article} \usepackage{psfig} \begin{document} %psfig package added in %REQUIRED \psfig{file=image.eps} \end{document} %REQUIRED image.eps is an encapsulated postscript file generated using the program xfig. For the output, see /pro/consult/minicourses/latex/examples/graphics.dvi Typeset by FoilTEX 16

Additional Information Brown L A TEX web site: http://localhost/system/software/latex The Not So Short Introdution to L A TEX2e Essential L A TEX www.ctan.org/ctan/tex-archive/info/lshort/english/ newsgroup: comp.text.tex /cs/data/texmf/doc/ Typeset by FoilTEX 17