LaTeX 2e Basics - PowerPoint PPT Presentation

About This Presentation
Title:

LaTeX 2e Basics

Description:

Cross-reference Example ... Cite the reference by using: ... article, report, book, , letter. Classes can be further customized. Specify class options ... – PowerPoint PPT presentation

Number of Views:157
Avg rating:3.0/5.0
Slides: 23
Provided by: Bro2
Learn more at: http://www.cse.msu.edu
Category:

less

Transcript and Presenter's Notes

Title: LaTeX 2e Basics


1
LaTeX 2e Basics
  • CSE470 Spring 2000
  • Software Engineering
  • B.J. Czerny
  • Updated by Prasad

2
Objectives
  • Learn how to create simple LaTeX2e documents,
    including
  • Creating and including figures
  • Referencing figures and sections
  • Inserting other tex files
  • Learn how to generate a Postscript file
  • Learn some advanced LaTeX features
  • Creating a Table of Contents
  • Creating Bibliography

3
A Simple Latex File
  • \documentclassarticle
  • \begindocument
  • \sectionsample section
  • Text goes here
  • \enddocument

4
Simple LateX file after compiling
5
Sample LaTeX File
  • \documentclass11ptarticle
  • \usepackageboxedminipage, doublespace, psfig
  • \begindocument
  • \titleCSE470 Lab1
  • \authorPrasad
  • \date1/12/2000
  • \maketitle
  • \sectionIntroduction to Latex
  • \labelsIntroSection
  • Introduction to Latex goes here.
  • \enddocument

6
Sample File Output
7
Including a PostScript Figure
  • \beginfigureh
  • \begincenter
  • \center\psfigfigurefigname.ps
  • \caption\labelffigexample Example of a
    figure.
  • \endcenter
  • \endfigure

8
PostScript Figure Added
9
Cross-references (internal references)
  • \labelkey-string
  • assigns the key key-string to the current element
    of the document
  • \refkey-string
  • inserts a string identifying that the element
    key-string refers to
  • \pagerefkey-string
  • inserts the number of the page that key-string is
    on.

10
Cross-reference Example
  • Figure \refffigexample in Section
    \refsIntroSection is on page
    \pagerefffigexample.
  • Results in
  • Figure 1 in Section 1 is on page 1.

11
Including Other LaTeX Files
  • LaTeX supports modularity
  • a single LaTeX document can consist of multiple
    LaTeX files
  • \inputlatex-file
  • Command to include other LaTeX files
  • LaTeX filename includes the .tex extension

12
Processing a LaTeX file
  • latex latex-file.tex
  • generates latex-file.dvi
  • xdvi latex-file.dvi
  • displays the dvi file for preview

13
Generating a PostScript File
  • Dvips latex-file.dvi
  • generates latex-file.ps
  • gv latex-file.ps
  • displays the postscript version of the document
  • lpr -Pmountaind latex-file.ps
  • prints latex-file.ps to the mountaind printer

14
Generating HTML or ASCII Output
  • latex2html latex-file.tex
  • dvi2tty latex-file.dvi gt latex-file.txt
  • creates an ascii version of the latex-file

15
Table of Contents
  • Contains titles of section units and the
    corresponding page number where the section
    starts
  • \tableofcontents
  • cause LaTeX to generate a .toc file
  • Must run LaTeX at least twice

16
Creating a Bibliography with BibTeX
  • Must create a bibliography database
  • References.bib file
  • read by BibTeX
  • Bibliographies can have different formats
  • e.g., Alphabetical, Numbered, etc.
  • BibTeX formats entries based on the bibliography
    style chosen
  • e.g., Plain, Alpha, IEEE, ACM, etc.

17
BibTeX Entry
  • Entry Type book, article, in proceeding, etc.
  • Keywork identifying publication
  • Series of Fields
  • Author
  • Journal
  • Title, etc.
  • Example
  • _at_bookpressman97,
  • title Software Engg, A practitioners
    Approach,
  • author Roger S.Pressman,
  • publisher McGraw-Hill,
  • year 1997

18
Referencing a .bib Entry
  • References.bib file must be included in LateX by
    using
  • \bibliographyReferences
  • Cite the reference by using
  • \citecite-key
  • Example
  • In \citepressman97, the characteristics of
    software are discussed.
  • Result In 1, the characteristics of software
    are discussed.

19
Command Sequence
  • latex latex-file.tex
  • bibtex latex-file
  • latex latex-file.tex

20
LaTeX Files
  • Input source file .tex
  • TeX formatted output file .dvi
  • Others .toc, .lof, .bib, .lot, .log, .aux

21
Document Classes
  • Five standard document classes
  • article, report, book, slide, letter
  • Classes can be further customized
  • Specify class options
  • Use additional packages

22
References
  • The LaTeX Companion, Michael Goosens, et.al.
  • On-line
  • http//www.cse.msu.edu/cse470/S2000/Labs/Notes/La
    b1/latex-index.html
  • A Short Introduction to LaTeX
  • Essential LaTeX
  • A Gentle Introduction to TeX
  • http//www.sci.usq.edu.au/staff/robertsa/LaTeX/lat
    ex2e.html
Write a Comment
User Comments (0)
About PowerShow.com