1 / 13

LaTeX Introduction

LaTeX Introduction. A CSUA Help Session. TeX History. Written by Donald Knuth, Professor of Computer Science at Stanford Knuth was writing The Art of Computer Programming , a classic CS text. Existing typesetting methods were not good enough. He created TeX in the late 1970s.

socrates
Download Presentation

LaTeX Introduction

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 Introduction A CSUA Help Session

  2. TeX History • Written by Donald Knuth, Professor of Computer Science at Stanford • Knuth was writing The Art of Computer Programming, a classic CS text. • Existing typesetting methods were not good enough. • He created TeX in the late 1970s. • Also: METAFONT, a font description language.

  3. TeX Was Too Low-level • TeX requires explicit invocation of font and layout commands to control appearance of text. • Instead of saying: \font\sec=cmbx20\sec\noindent, people wanted to say \section to start a section title. • You could define your own commands, though.

  4. Enter LaTeX • LaTeX is a collection of defined commands. • There is a \section command to write a section title, for example. • Written by Leslie Lamport in 1985. • Provides many more features • e.g., the \section command provides for automatic numbering and table of contents generation if you want • Most recent version is LaTeX2e.

  5. Classes and packages • These are LaTeX’s method for extending it. • Different documents have different classes (you’ll see this later; for example there are article and letter classes). • Packages allow you to call in extra features • E.g., there is a package for inserting figures into your document.

  6. AMS-TeX • LaTeX was not the only set of extensions to TeX. • AMS-TeX was a collection of extensions to TeX with more advanced mathematical typesetting features. • Now LaTeX is by far the most popular. Most features from AMS-TeX have been absorbed.

  7. Getting LaTeX • It is free. • It is on EECS instructional systems. • It is on CSUA and OCF systems. • It comes with all normal Linux distributions. • For Windows try http://www.miktex.org/.

  8. Writing LaTeX • A sample document: \documentclass{article} \begin{document} Hello, world! \end{document}

  9. What do you do with it? • You turn LaTeX files into DVI files, with this command: latex file.tex. • The file extension should be “tex”. • LaTeX will create a file called file.dvi.

  10. DVI Files • DVI files are what TeX creates by default. • For display, type xdvi file.dvi at the prompt (in X). • On Windows, read the manual. • For printing, turn them into Postscript files with dvips file.dvi -o • Then print the Postscript file file.ps as you would any Postscript file. • If you omit the -o, dvips will have some default behavior which might be to print the file and might be to produce a ps file, depending on how it’s set up.

  11. Creating PDF files • To create PDF files, type pdflatex file.tex • The program is basically the same as latex, except it produces a file.pdf PDF file.

  12. Problems • Often LaTeX will fail with an error. • If it has a question mark for you, type “x” and press enter. • This will quit LaTeX. • When LaTeX dies like this, it is almost always because you screwed up.

  13. How to solve problems • Look at the error LaTeX gave you. • It will have a line number which will help you find the error. • Common mistakes: • Mismatched \begin{}/\end{} blocks • Mismatched {/} • Mismatched $, $$, or \(\) or \[\] • Misspelled keywords • Sometimes lines are too long. This isn’t fatal but looks bad. LaTeX outputs a warning with a line number so you can fix it.

More Related