1 / 20

LaTeX 2e Basics

LaTeX 2e Basics. CSE470 Fall 2000 Software Engineering B.J. Czerny Updated by J. Brown, A. Subramanian. Objectives. Learn how to create simple LaTeX2e documents, including: Creating and including figures Referencing figures and sections Inserting other tex files

urania
Download Presentation

LaTeX 2e Basics

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. LaTeX 2e Basics CSE470 Fall 2000 Software Engineering B.J. Czerny Updated by J. Brown, A. Subramanian

  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. Sample LaTeX File \documentclass[11pt]{article} \usepackage{boxedminipage, doublespace, psfig} \begin{document} \title{Sample Title} \author{Sample Author} \date{Sample Date} \maketitle \section{Sample Section} \label{s:sample} Text goes here. \end{document}

  4. Sample File Output

  5. Including a PostScript Figure \begin{figure}[h] \begin{center} \begin{boxedminipage}[htbp]{\textwidth} \centerline{\hbox {\psfig{figure=figname.ps,height=2.5in,silent=} } } \caption{\label{f:figexample}Example of a figure.} \end{boxedminipage} \end{center} \end{figure}

  6. PostScript Figure Added

  7. 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.

  8. Cross-reference Example Figure~\ref{f:figexample} in Section~\ref{s:sample} is on page~\pageref{f:figexample}. Results in: Figure 1 in Section 1 is on page 1.

  9. 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

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

  11. 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

  12. Generating ASCII Output • Dvi2tty latex-file.dvi > latex-file.txt • creates an ascii version of the latex-file

  13. 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

  14. Creating a Bibliography with BibTeX • Must create a bibliography database • .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.

  15. BibTeX Entry • Entry Type: book, article, inproceeding, etc. • Keywork identifying publication • Series of Fields • Author • Journal • Title, etc.

  16. Referencing a .bib Entry • \cite{cite-key} • \nocite{cite-key1, cite-key2, cite-key3,…} • Example: • In~\cite{pressman97}, the characteristics of software are discussed. • Result: In [1], the characteristics of software are discussed.

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

  18. LaTeX Files • Input source file: .tex • Structure and layout definition file: .sty • TeX formatted output file: .dvi • Others: .toc, .lof, .bib, .lot, .log, .aux

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

  20. References • The LaTeX Companion, Michael Goosens, et.al. • On-line: • http://www.cse.msu.edu/~cse470/Public/F99/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

More Related