Unformatted text preview:

CSCI 3294 March 1, 2006Slide 1Administrivia• Reminder: Homework 5 due today.• Homework 6 on Web; due after spring break.Slide 2What 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).CSCI 3294 March 1, 2006Slide 3Basics (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.” ispell and aspell are common ones.)• You use the command latex to generate a .dvi file, then dvips togenerate PostScript, then (if desired) convert to PDF with ps2pdf.(You can also go directly to PDF with pdflatex.)Slide 4Isn’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 . . .CSCI 3294 March 1, 2006Slide 5Why 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 .tex sourcefor future reference.Slide 6Basics, 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}CSCI 3294 March 1, 2006Slide 7Some 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 use xfig todraw pictures — old, but nice integration with LATEX. There are other tools.(EPS is traditional, but pdflatex prefers other formats.)Slide 8More 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.CSCI 3294 March 1, 2006Slide 9More Features / Add-Ons / Tools• Tools to convert LATEX source to HTML. (I use latex2html; there areothers.)• Document classes for producing “slides”. (I use seminar; there are others.)• Tools for editing LATEX source. Support in both emacs and vim (auctexand vimlatex respectively). Also GUI frontends. See “useful links” page.Slide 10Gotchas• Some characters have special meaning and must be “escaped”: backslash,brackets, #, %, <, >, |, caret (ˆ ), underscore ( ), tilde (˜).• Quotation marks should be entered as ‘‘foo’’. Dashes should beentered as -- or ---.CSCI 3294 March 1, 2006Slide 11Advice 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?)Slide 12Minute 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?