+ All Categories
Home > Documents > Introduction to LaTeX

Introduction to LaTeX

Date post: 18-Feb-2016
Category:
Upload: sani
View: 30 times
Download: 0 times
Share this document with a friend
Description:
Introduction to LaTeX. CPS470 Software Engineering Fall 1998. Objectives. Learn how to create a simple LaTeX2e document: Create a LaTeX (tex) file. Create and include figures. Reference figures and sections. Create lists. Include other tex files. Generate a postscript file. - PowerPoint PPT Presentation
24
Introduction to LaTeX CPS470 Software Engineering Fall 1998
Transcript
Page 1: Introduction to LaTeX

Introduction to LaTeX

CPS470 Software EngineeringFall 1998

Page 2: Introduction to LaTeX

Fall 1998 CPS 470 Software Engineering 2

Objectives

Learn how to create a simple LaTeX2e document: Create a LaTeX (tex) file. Create and include figures. Reference figures and sections. Create lists. Include other tex files. Generate a postscript file. Cite bibliographic references.

Page 3: Introduction to LaTeX

Fall 1998 CPS 470 Software Engineering 3

Introduction

Tex Text processing system for documents with lots of

math Donald Knuth

Latex Document preparation system based on Tex formatter Leslie Lamport

Page 4: Introduction to LaTeX

Fall 1998 CPS 470 Software Engineering 4

References

LaTeX User’s Guide and Reference Manual; Leslie Lamport

The LaTeX Companion; Michel Goossens et. al. On-line documents. (available from cps470 web page)

Page 5: Introduction to LaTeX

Fall 1998 CPS 470 Software Engineering 5

Files LaTeX Uses

Input source file (.tex). Files containing structure and layout definitions

(.sty). Tex formatted output file (.dvi). Others:

.toc (table of contents), .lof (list of figures), .lot (list of tables), .bib (bibliography)

Page 6: Introduction to LaTeX

Fall 1998 CPS 470 Software Engineering 6

Document Classes

Five standard document classes article, report, book, slides, letter

Can be further customized Specifying class options. Using additional packages (epsfig for including postscript figures)

Page 7: Introduction to LaTeX

Fall 1998 CPS 470 Software Engineering 7

Minimal LaTeX File

\documentclass[12pt]{article}% comments...\begin{document}

Text goes here…

\end{document}

Page 8: Introduction to LaTeX

Fall 1998 CPS 470 Software Engineering 8

More Complex LaTeX File

\documentclass[12pt]{article}\usepackage{doublespace,epsfig}\usepackage{../custom}\begin{document}\input{abstract}\section{Sample Section}\label{s:sample}

Text goes here...

\end{document}

Page 9: Introduction to LaTeX

Fall 1998 CPS 470 Software Engineering 9

Cross-references(internal references)

\label{key-string} assigns the key key-string to the current element of the

document \ref{key-string}

inserts a string identifying the element to which key-string refers

\pageref{key-string} inserts the page number on which the element

referenced by key-string appears

Page 10: Introduction to LaTeX

Fall 1998 CPS 470 Software Engineering 10

Cross-reference Example

Figure~\ref{f:figexample} in Section~\ref{s:sample} is on page~\pageref{f:figexample}.

Figure 1 in Section 1 is on page 1.

Page 11: Introduction to LaTeX

Fall 1998 CPS 470 Software Engineering 11

Including Other LaTeX Files

Supports modularity a single LaTeX document can consist of multiple

LaTeX files useful for group work (many authors)

\input{LaTeX-file} used to include other Latex files Latex filename is latex-file.tex

Page 12: Introduction to LaTeX

Fall 1998 CPS 470 Software Engineering 12

Including a ps Figure

\begin{figure} [htbp]

\centerline{\epsfig{figure=figname.eps, height=2.5in,silent=,clip=}}\caption{\label{f:figexample} Example of a figure.}

\end{figure}

Page 13: Introduction to LaTeX

Fall 1998 CPS 470 Software Engineering 13

Making a List

\begin{itemize}% \begin{enumerate}

\item Text for this item.

\item Text for this item.

\end{itemize}% \end{enumerate}

Page 14: Introduction to LaTeX

Fall 1998 CPS 470 Software Engineering 14

Generating, Viewing, and Printing a Postscript file

latex latex-file.tex generates latex-file.dvi

xdvi latex-file.dvi displays dvi file for preview

dvips latex-file.dvi > latex-file.ps generates postscript file

ghostview latex-file.ps displays postscript file

lpr -P <printer> latex-file.ps sends file to the specified printer

Page 15: Introduction to LaTeX

Fall 1998 CPS 470 Software Engineering 15

Generating ASCII Output

dvi2tty latex-file.dvi > file.text generates ASCII file of document for viewing

Page 16: Introduction to LaTeX

Fall 1998 CPS 470 Software Engineering 16

Drawing Tools

xfig For interactive generation of figures. Must export encapsulated postscript files (eps).

idraw Interactive drawing tool. Saves files automatically in postscript format.

Page 17: Introduction to LaTeX

Fall 1998 CPS 470 Software Engineering 17

Snapshot

Used to capture a screen or a portion of the screen (a window).

Saves file in raster format or postscript format. ras2ps converts a Sun raster file to a postscript

file.

Page 18: Introduction to LaTeX

Fall 1998 CPS 470 Software Engineering 18

Advanced Features

Creating a table of contents Creating a list of figures Creating a .bib file and a bibliography

Page 19: Introduction to LaTeX

Fall 1998 CPS 470 Software Engineering 19

Table of Contents

Contains section headings and page number where each section starts.

\tableofcontentsCauses LaTeX to generate a .toc file

Must run LaTeX on the file at least twice: On the first pass, LaTeX collects information On the second pass, LaTeX reads back information

and typesets it.

Page 20: Introduction to LaTeX

Fall 1998 CPS 470 Software Engineering 20

List of Figures

Contains caption text of the figures and page number where each figure appears.

\listoffigures Causes LaTeX to generate .lof file.

As for the table of contents, must run LaTeX at least twice.

Page 21: Introduction to LaTeX

Fall 1998 CPS 470 Software Engineering 21

Bibliographies and BIBTeX

Must create a bibliography “database” .bib file formatted by keyword, readable by BIBTeX

Bibliographies can have different formats yet the same .bib file (alphabetical, order of citation, etc.)

BIBTeX formats entries based on the bibliography style chosen (.bst or .sty)

ieeetr, plain, alpha, acm, etc.

Page 22: Introduction to LaTeX

Fall 1998 CPS 470 Software Engineering 22

BIBTeX Entry

Entry type book, article, inproceedings, etc.

Keyword identifying publication should be unique for each entry

Series of fields for each type author, title, journal, etc.

Page 23: Introduction to LaTeX

Fall 1998 CPS 470 Software Engineering 23

Referencing .bib entry

\cite{keyword} \nocite{key1, key2, key3,…} example:

In \cite{pressman97}, the characteristics of software are discussed.

In [1], the characteristics of software are discussed.

Page 24: Introduction to LaTeX

Fall 1998 CPS 470 Software Engineering 24

BIBTex and LaTeX

Command sequence latex file.tex bibtex file latex file May have to latex file again if unresolved references


Recommended