Download presentation
Presentation is loading. Please wait.
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 \documentclass{article} \begin{document} \section{sample section} Text goes here \end{document}
4
Simple LateX file after compiling …
5
Sample LaTeX File \documentclass[11pt]{article} \usepackage{boxedminipage, doublespace, psfig} \begin{document} \title{CSE470: Lab1} \author{Prasad} \date{1/12/2000} \maketitle \section{Introduction to Latex} \label{s:IntroSection} Introduction to Latex goes here. \end{document}
6
Sample File Output
7
Including a PostScript Figure \begin{figure}[h] \begin{center} \center{\psfig{figure=figname.ps}} \caption{\label{f:figexample} Example of a figure.} \end{center} \end{figure}
8
PostScript Figure Added
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 that the element key- string refers to \pageref{key-string} –inserts the number of the page that key-string is on.
10
Cross-reference Example Figure \ref{f:figexample} in Section \ref{s:IntroSection} is on page \pageref{f:figexample}. 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 \input{latex-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 > 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: @book{pressman97, title = {Software Engg, A practitioner’s 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 \bibliography{References} Cite the reference by using: \cite{cite-key} Example: –In \cite{pressman97}, 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/Lab1/latex-index.html –A Short Introduction to LaTeX –Essential LaTeX –A Gentle Introduction to TeX –http://www.sci.usq.edu.au/staff/robertsa/LaTeX/latex2e.html
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.