Unformatted text preview:

CSCI 3294 March 1, 2006Administrivia• Reminder: Homework 5 due today.• Homework 6 on Web; due after spring break.1CSCI 3294 March 1, 2006What are TEX and LATEX?• TEX — program for typesetting mathematics, developed by Knuth (1978) forhis book The Art of Computer Programming and made freely available.• LATEX — extensive set of macros for TEX written by Lamport (1985), thatprovide functionality needed for scholarly papers. Extended over the years bymany people.• These are “text formatters” not “word processors”, and as such don’t include abuilt-in editor.• Basic idea — you write “source code” for your document (text and markup)with a text editor, then use TEX or LATEX to turn it into a formatted document.• Both available in zero-cost form for many platforms. Included in completeLinux distributions (as far as I know).2CSCI 3294 March 1, 2006Basics (Under Unix)• You write “source” (foo.tex) with a text editor — includes your text plus“logical markup” — e.g.,\section{A Section Heading}.(What about checking spelling? Use a separate tool — “each program shoulddo one thing, and do it well.”ispellandaspellare common ones.)• You use the commandlatexto generate a.dvifile, thendvipstogenerate PostScript, then (if desired) convert to PDF withps2pdf.(You can also go directly to PDF withpdflatex.)3CSCI 3294 March 1, 2006Isn’t That a Lot of Trouble?• In some ways, yes — there is a learning curve, and there are many “gotchas”.• For some jobs (where visual layout matters more than logical structure), LATEXis probably the wrong tool.• But if you persevere . . .4CSCI 3294 March 1, 2006Why It Might Be Worth the Trouble• Output looks good — math in particular.• Logical structure of document is clearly spelled out. (You can do this with,e.g., MS Word, but it’s less transparent.)• Cross-referencing, bibliographic references, footnotes, tables of contents,indexing, etc., “just works”.• Documents are stable — only way to “corrupt” a document is to mess up withyour text editor. Very old documents usually still compile, and if they don’t thecontent is still accessible.• Once you figure out how to do a particular trick, it’s there in the.texsourcefor future reference.5CSCI 3294 March 1, 2006Basics, Continued• LATEX provides a small set of “document classes” — article, report, book, etc.These classes group definitions for section headers, lists, etc., in a way thateverything looks good together. Also can have “packages” that group togetherrelated customizations, provide extra features.• Basic document structure (look at example):–\documentclass[options]{foo}– Additional global definitions, packages, etc.–\begin{document}– Your text. “Paragraphs” continue until first blank line.–\end{document}6CSCI 3294 March 1, 2006Some Features• “Sectioning commands” provide consistent layout and automatic numbering.Also allows collecting info to make table of contents.• “Environments” provide support for lists (bulleted and numbered), tables,centered text, “verbatim” (equivalent of HTML preformatted text), etc.• Macros provide simple markup, e.g.,\textit{foo}.• Math — a bit cryptic, but IMO not worse than point-and-click equation editor.Support for (automatically) numbered equations.• Graphics in EPS form can be included (and scaled nicely). I usexfigtodraw pictures — old, but nice integration with LATEX. There are other tools.(EPS is traditional, butpdflatexprefers other formats.)7CSCI 3294 March 1, 2006More Features• Figures and tables can “float” (LATEX will put them where they fit). Alsofootnotes.• Lots of cross-referencing features — declare symbolic label (for section,figure, etc.) with\label{foo}, reference with\ref{foo}.• Support for bibliography / list of references — usually use companionpackage BIBTEX.• Support for indexes. (Also glossaries, through add-on packages.)• Facilities to define your own “commands” and “environments”. Makes it easyto get consistent formatting; also allows shorthand.8CSCI 3294 March 1, 2006More Features / Add-Ons / Tools• Tools to convert LATEX source to HTML. (I uselatex2html; there are others.)• Document classes for producing “slides”. (I useseminar; there are others.)• Tools for editing LATEX source. Support in bothemacsandvim(auctexandvimlatexrespectively). Also GUI frontends. See “useful links” page.9CSCI 3294 March 1, 2006Gotchas• Some characters have special meaning and must be “escaped”: backslash,brackets, #, %,<, >, |, caret (ˆ ), underscore ( ), tilde (˜).• Quotation marks should be entered as‘‘foo’’. Dashes should be enteredas--or---.10CSCI 3294 March 1, 2006Advice For Getting Started• Get hold of an example that looks somewhat similar to what you want toproduce, plus some sort of documentation — a guide from online or a book.• Tinker with the example, putting in your prose and other stuff.• When something doesn’t work, ask a local expert.• (How many of you have tried LATEX? What did you like/dislike?)11CSCI 3294 March 1, 2006Minute Essay• What do you currently use to produce formatted documents? What do youlike/dislike about


View Full Document

TRINITY CSCI 3294 - Lecture Notes

Download Lecture Notes
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Lecture Notes and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Lecture Notes 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?