Difference between revisions of "LaTeX"

From PrattWiki
Jump to navigation Jump to search
m
Line 47: Line 47:
 
emacs lab1.tex &
 
emacs lab1.tex &
 
latex lab1.tex
 
latex lab1.tex
kdvi lab1.tex &
+
kdvi lab1.dvi &
 
latex lab1.tex
 
latex lab1.tex
 
latex lab1.tex
 
latex lab1.tex

Revision as of 23:09, 1 February 2009

LaTeX
Download On Unix
Web Page \(LaTeX\) Project


LaTeX is a document preparation system written by Don Knuth (TeX) and extended by Leslie Lamport. It is a powerful, and free, way to generate professional, dynamic documents.




LaTeX on Pratt Pundit

Pratt Pundit can process most basic LaTeX structures by using math tags. For example,

\(q(t)=q(t_0)+\int_{t_0}^ti(\tau)~d\tau\,\!\)

can be created using

<center>
\(q(t)=q(t_0)+\int_{t_0}^ti(\tau)~d\tau\,\!\)
</center>

Note that the \,\! part forces Pundit to create a PNG graphic out of the equation. Otherwise, it may try to render the equation using text:

\(q(t)=q(t_0)+\int_{t_0}^ti(\tau)~d\tau\)

which is not nearly as...cool - though apparently if you are *not* logged in the graphic gets rendered regardless... Some equations will not need the \,\! part:

\(a=\left(\frac{dv}{dt}\right)\)

though putting it in will not hurt. As time goes on, the default setting for Pundit may be to always render math as a graphic. The advantage of not doing that is, in text mode, you can have something like \(c^2=a^2+b^2-2ab\cos(\theta)\) as opposed to something like \(c^2=a^2+b^2-2ab\cos(\theta)\,\!\) which is not quite as smooth.

FAQ

What's the 15-second summary of using LaTeX?

  1. Use emacs blah.tex & to generate the source code.
  2. Use latex blah.tex to process the file. If successful, among other things, you will have a new blah.dvi file.
  3. Use kdvi blah.dvi & to look at (and eventually print) the file.

Note - if you have a \tableofcontents, or a \listoffigures, or any \label and \ref commands, you will want to run the latex step three times before progressing to the kdvi step. Also, once you have run kdvi, you won't need to re-run it each time; kdvi will always look at the most current version of the dvi file. That is to say, a typical command history might be:

emacs lab1.tex &
latex lab1.tex
kdvi lab1.dvi &
latex lab1.tex
latex lab1.tex
latex lab1.tex
latex lab1.tex
latex lab1.tex

What do I do if LaTeX just sits there?

This depends on what kind of error you have. If you just typed latex or you spelled the name of the file you were trying to process incorrectly, you need to hit CTRL-D to get out of it. For all other errors, hitting CTRL-C, then x and return, will always get out of LaTeX regardless of the error

What did I do wrong?

Generally, LaTeX will try to tell you - look closely at the error message LaTeX gives you

What is Underfull hbox -10000?

It's a warning that something is a bit thin - generally a table or a figure. Don't worry about these at all.

Why does LaTeX think my align or align* environment is messed up?

To continue: "I have checked it thousands of time and it looks good to me!" Make sure there are no blank lines within the environment. For some reason align hates those. The following, for example, causes problems:

\begin{align}
a\\

b
\end{align}

Also - it may be in a line above the end of the align environment. You can use % in front of a line of LaTeX code to turn that whole line into a comment - doing that, you can find which line is having a bad day and correct it.

My \pagebreak doesn't...page...break Why?

Make sure there is ablank line after the \pagebreak command; that is:

blah
\pagebreak

more blah

How can I double space?

Basically, include the following two lines between the \documentclass and the \begin{document}[1]:

\usepackage{spacing}
\setstretch{2.0}

How do I get a $ Symbol

For the characters that LaTeX uses as code ($ and { or }) you need to issue the command to print those - in other words, \$ \{ and \} are the commands to print those individual characters. For example, the code:

\$\{10,000\}

will produce \( \$\{10,000\} \)

Questions

Post your questions by editing the discussion page of this article. Edit the page, then scroll to the bottom and add a question by putting in the characters *{{Q}}, followed by your question and finally your signature (with four tildes, i.e. ~~~~). Using the {{Q}} will automatically put the page in the category of pages with questions - other editors hoping to help out can then go to that category page to see where the questions are. See the page for Template:Q for details and examples.

External Links

References