Making Math Look Pretty How to Use LaTeX - PowerPoint PPT Presentation

1 / 39
About This Presentation
Title:

Making Math Look Pretty How to Use LaTeX

Description:

A computer program for typesetting text and mathematical formulas ... Need to compile the file in order to see the finished product. Basics of LaTeX Commands ... – PowerPoint PPT presentation

Number of Views:137
Avg rating:3.0/5.0
Slides: 40
Provided by: Kri969
Category:
Tags: latex | formulas | look | making | math | pretty | use

less

Transcript and Presenter's Notes

Title: Making Math Look Pretty How to Use LaTeX


1
Making Math Look Pretty How to Use LaTeX
  • Haseena Ahmed
  • Iowa State University
  • haseena_at_iastate.edu

2
Basics of LaTeX
  • A computer program for typesetting text and
    mathematical formulas
  • Uses commands to create mathematical symbols
  • Not a WYSIWYG program
  • Need to compile the file in order to see the
    finished product

3
Basics of LaTeX Commands
  • Always begin with a backslash \
  • Case sensitive
  • Consist of letters only
  • Some have parameters
  • Square brackets after the command name are
    for optional parameters
  • Curly braces after the command name are for
    required parameters

4
Getting Started
  • Can use lots of different programs to create a
    LaTeX file
  • All computers here use WinEdt
  • Need to begin by creating a new file

5
Downloads
  • LaTeX is available online for free at
    http//www.latex-project.org/
  • WinEdt is also available online with a free 30
    day trial period at http//www.winedt.com/

6
Input File Structure
  • Begins with a preamble (Preamble is where the
    overall construction of your document is listed)
  • \documentclassoptionsclass
  • class specifies the type of document to be
    created
  • Usually use article or amsart
  • Can also use slides or siamltex
  • options customizes the document class you are
    using
  • Can be used to set font size (10, 11, or 12 pt),
    set paper size, use one or two columns, etc.

7
Input File Structure
  • Begins with a preamble
  • \usepackagepackage
  • Packages add new features and commands to LaTeX
  • Common packages amsmath, amssymb, graphicx
  • Can also define new commands in the preamble,
    specify page numbering, etc.

8
Input File Structure
  • Now were ready to begin the body of the text
  • \begindocument
  • \begin commands always need to be followed
    (eventually) by \end commands
  • Enter the actual content here
  • \enddocument

9
Typesetting Your Document
  • Click the LaTeX or PDF LaTeX button on the
    top right
  • To view your file, click DVI or the Adobe
    Acrobat symbol
  • DVI stands for DeVice Independent its
    basically a generic viewer
  • Can change between DVI, PDF, or PS files and
    document is automatically saved when you typeset
    it

10
Types of LaTeX Files
  • .tex input file, needs to be compiled
  • .tex.bak backup LaTeX file and is changed when
    document is typeset
  • .dvi DVI file which shows what your file looks
    like
  • .log log file, tells what happened the last
    time you compiled your document - Helpful to look
    at if there are errors and you dont know why

11
Typesetting Math
  • Mathematical text is placed between
  • Math mode is normally displayed inline
  • Can make some expressions look funny
  • To display math mode in a larger font, use
    \displaystyle
  • Makes all symbols within larger
  • For text within math mode, use \text
  • Math mode uses italics and no spaces between words

12
Useful Math Commands
  • Greek letters
  • \pi for lowercase, \Pi for uppercase
  • No command for \Alpha
  • Fractions
  • \fracnumeratordenominator
  • For a larger fraction, use \displaystyle

13
Useful Math Commands
  • Superscripts and Subscripts
  • x2
  • x_2
  • Use curly braces to group items together
  • x_i_2 or x_min
  • Can have a superscript and a subscript on the
    same character
  • x_i3

14
Useful Math Commands
  • Limits and Integrals
  • Probably want to use \displaystyle, otherwise
    theyll look funny
  • \displaystyle \lim_x \to \infty 3x
  • \displaystyle \int_02 x\, dx
  • The \, gives a space between x and dx
  • Square roots
  • \sqrtx

15
Useful Math Commands
  • Displaying special characters
  • \mathbbR or \mathcalR
  • Trignometric functions
  • \sin or \cos
  • Math inequalities
  • \le or \ge
  • Lot more commands on pages 58 65 of Getting
    Started with LaTeX

16
Other Important Characters
  • Quote marks
  • For left-hand quote marks, use
  • For right-hand quote marks, use or
  • Comments
  • Use at the beginning of any lines you want to
    comment out
  • Creating a space between two characters
  • \,
  • Creating a new line
  • \newline

17
Environments
  • Many environments available in TeX
  • Used to help format parts of your document
  • Always need \beginenvironment name and
    \endenvironment name

18
Some Environments
  • Itemize environment
  • \beginitemize and \enditemize
  • Creates an outline using bullet points
  • Items within the section are created by \item
  • Can nest itemize environments within one another

19
Some Environments
  • Enumerate environment
  • \beginenumerate and \endenumerate
  • Creates an outline using numbers and letters
  • Items within a section are created by \item
  • Can nest enumerate environments within one
    another

20
Some Environments
  • Centered environment
  • \begincenter and \endcenter
  • To end a line within the environment, use \\

21
Mathematical Environments
  • Equation environment
  • \beginequation and \endequation
  • Automatically numbers equations, so mainly used
    when you need equations to be numbered
  • For no numbers, use equation
  • Puts the equation in the center of the line
  • Can label equations by \labelname
  • Centers equation on page
  • Do not need within equation environment

22
Mathematical Environments
  • Align environment
  • \beginalign and \endalign
  • For no numbers on all equations, use align
  • For no numbers on some use \nonumber
  • Put in front of the symbol in each line that
    you want aligned
  • End each line (except the last one) with \\
  • Do not need within align environment

23
Arrays
  • Especially used for matrices
  • Begin with left symbol for matrix
  • \left
  • Next, begin array environment
  • \beginarraylrc
  • Tells how many columns you have and their
    alignment - left, right or center

24
Arrays
  • Specify the entries of the matrix
  • Separate the entries by
  • End each row (except the last one) by \\
  • End the array
  • \endarray
  • Create the right side symbol for the matrix
  • \right

25
Arrays
  • Can also have lines within arrays
  • Horizontal lines
  • Use \hline after each row that you want a line
    under
  • x2 4x 3 \\ \hline
  • Vertical lines
  • Put between the columns that you want lines
    between
  • \beginarraylrc

26
Tables
  • Basically the same as arrays
  • \begintabularlrc and \endtabular
  • Can add lines in the same way that you do for
    arrays
  • For more info see pages 34 - 37 of Getting
    Started with LaTeX

27
Figures
  • Often used to import some other type of file
    (usually a .eps file) into your document
  • Can generate graphics in LaTeX, but this is
    harder to do
  • Any imported file needs to be in the same
    directory as your main file
  • Also need to include the package graphicx in your
    preamble

28
Figures
  • Begin the figure environment by
    \beginfigureplacement
  • placement is an optional argument that tells
    LaTeX where on the page you want the figure
  • Can be h (here), t (top), b (bottom), or p (on a
    separate page)
  • Put an ! before the placement if you really want
    the figure at that page location

29
Figures
  • Include the file that you want
  • \includegraphicsdisplayfilename
  • display is an optional parameter which allows you
    to change the appearance of your graphic
  • Can use the following parameters
  • width, height, angle (rotates the graphic
    counterclockwise), scale (number between 0 and 1)
  • Changing width or height will preserve the aspect
    ratio

30
Figures
  • Can create a caption for your figure
  • \captionshortnamelongname
  • shortname is displayed in the Table of Contents
    (if you create one)
  • longname is displayed below the figure
  • Captioning also automatically labels your figures
  • Can label your figure
  • \labelreference
  • Allows you to refer to your figure later by using
    \refreference

31
Figures
  • End the figure environment
  • \endfigure
  • May sometimes need to create a PostScript file
    instead of a PDF file in order to get graphics to
    display properly
  • More info on pages 38 40 of Getting Started
    with LaTeX

32
Sections of a Paper
  • \titlelabelactual title
  • If you label your title, youll be able to
    reference it later
  • Can also label theorems, equations, figures,
    tables, etc.
  • \authorauthors
  • Need to put \maketitle after title and authors
  • \today
  • Gives the current date
  • Usually want this centered

33
Sections of a Paper
  • \thanks
  • Creates a footnote with whatever is in the braces
  • Usually used after authors names for academic
    information
  • Abstract
  • Use \beginabstract and \endabstract
  • Keywords
  • Use \beginkeywords and \endkeywords
  • OR use \keywords

34
Sections of a Paper
  • Papers should be divided into sections,
    subsections, etc.
  • Important commands
  • \sectionTitle of section
  • \subsection
  • \subsubsection
  • \paragraph
  • \subparagraph

35
Sections of a Paper
  • Bibliography
  • \beginthebibliographynumber and
    \endthebibliography
  • number is 9, 99, 999, etc.
  • Tells LaTeX how if you will be using only
    single-digit numbers, double-digit numbers, etc.
  • Use \bibitemLabel to create a new reference
  • Label lets you reference that item elsewhere in
    the paper

36
Referencing Using Labels
  • May want to reference a section, theorem, figure,
    example, etc. somewhere else in the document
  • To label a section
  • \sectionTitle\labelLabel for section
  • To reference a section
  • \refLabel for section
  • Only gives the section number youll need to
    type Section separately
  • To reference a bibliography item, use
    \citeLabel

37
Theorems and Definitions
  • \newtheoremshort namelong name is used to
    typeset Theorems, Lemmas, Definitions and
    similar structures
  • Short name is what you type
  • Long name is what is displayed on the page
  • The \newtheorem command is placed in the preamble
    of the document
  • Numbering is automatic

38
Theorems and Definitions
  • For unnumbered theorems, use either command with
    \newtheorem
  • can be used in many environments for unnumbered
    items
  • May need to include the package amsthm in order
    to properly display theorems

39
Defining New Commands
  • Typing some long commands over and over is not
    fun
  • Can define a new command thats easier to type
  • Goes in preamble
  • \newcommandnewnameoldname
  • newname cannot be the name of an existing command
Write a Comment
User Comments (0)
About PowerShow.com