Difference between revisions of "LaTeX"
Line 3: | Line 3: | ||
image=[[File:LaTeX logo.png|200 px]]| | image=[[File:LaTeX logo.png|200 px]]| | ||
caption=| | caption=| | ||
− | version=pdfeTeX 3.141592-1. | + | version=pdfeTeX 3.141592-1.40.3| |
dlocation=On Unix| | dlocation=On Unix| | ||
manufacturer=| | manufacturer=| | ||
webpage=[http://www.latex-project.org/ <math>LaTeX</math> Project]| | webpage=[http://www.latex-project.org/ <math>LaTeX</math> Project]| | ||
label_color=|Color value_color=| | label_color=|Color value_color=| | ||
− | update=8/ | + | update=8/23/2014}} |
'''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''' 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. | ||
Line 14: | Line 14: | ||
==LaTeX on Pratt Pundit== | ==LaTeX on Pratt Pundit== | ||
===The Basics=== | ===The Basics=== | ||
+ | <!-- ## New math does not need \,\! | ||
Pratt Pundit can process most basic LaTeX structures by using <code>math</code> tags. For example, | Pratt Pundit can process most basic LaTeX structures by using <code>math</code> tags. For example, | ||
<center> | <center> | ||
Line 29: | Line 30: | ||
<math>q(t)=q(t_0)+\int_{t_0}^ti(\tau)~d\tau</math> | <math>q(t)=q(t_0)+\int_{t_0}^ti(\tau)~d\tau</math> | ||
</center> | </center> | ||
− | 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 <code>\,\!</code> part: | + | which is not nearly as...cool - though apparently if you are *not* logged in the graphic gets rendered regardless... |
+ | --> | ||
+ | |||
+ | Pratt Pundit can process most basic LaTeX structures by using <code>math</code> tags. For example, | ||
+ | <center> | ||
+ | <math>q(t)=q(t_0)+\int_{t_0}^ti(\tau)~d\tau</math> | ||
+ | </center> | ||
+ | can be created using | ||
+ | <source lang="latex"> | ||
+ | <center> | ||
+ | <math>q(t)=q(t_0)+\int_{t_0}^ti(\tau)~d\tau</math> | ||
+ | </center> | ||
+ | </source> | ||
+ | |||
+ | Some equations will not need the <code>\,\!</code> part: | ||
<center> | <center> | ||
<math>a=\left(\frac{dv}{dt}\right)</math> | <math>a=\left(\frac{dv}{dt}\right)</math> | ||
</center> | </center> | ||
− | 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 <math>c^2=a^2+b^2-2ab\cos(\theta)</math> as opposed to something like <math>c^2=a^2+b^2-2ab\cos(\theta)\,\!</math> which is not quite as smooth. | + | 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 <math>c^2=a^2+b^2-2ab\cos(\theta)</math> |
+ | as opposed to something like <math>c^2=a^2+b^2-2ab\cos(\theta)\,\!</math> which is not quite as smooth. | ||
===Equation Lists=== | ===Equation Lists=== | ||
For multiple equations one after the other, use the <code>\begin{align}</code> environment. This will allow you to line equations up by placing an ampersand just before the symbol on each line you want as the alignment character. Use \\ to go to the next equation. For example, | For multiple equations one after the other, use the <code>\begin{align}</code> environment. This will allow you to line equations up by placing an ampersand just before the symbol on each line you want as the alignment character. Use \\ to go to the next equation. For example, |
Revision as of 15:41, 23 August 2014
Version | pdfeTeX 3.141592-1.40.3 |
---|---|
Download | On Unix |
Web Page | \(LaTeX\) Project |
Pundit Updated | 8/23/2014 |
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.
Contents
- 1 LaTeX on Pratt Pundit
- 2 Known Issues
- 3 FAQ
- 3.1 What's the 15-second summary of using LaTeX?
- 3.2 What do I do if LaTeX just sits there?
- 3.3 What did I do wrong?
- 3.4 What is Underfull hbox -10000?
- 3.5 Why does LaTeX think my align or align* environment is messed up?
- 3.6 My \pagebreak doesn't...page...break Why?
- 3.7 How can I double space?
- 3.8 How do I get a $ Symbol
- 4 Questions
- 5 External Links
- 6 References
LaTeX on Pratt Pundit
The Basics
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>
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.
Equation Lists
For multiple equations one after the other, use the \begin{align}
environment. This will allow you to line equations up by placing an ampersand just before the symbol on each line you want as the alignment character. Use \\ to go to the next equation. For example,
<center>\(
\begin{align}
q(t)&=q(t_0)+\int_{t_0}^ti(\tau)~d\tau\\
a&=\left(\frac{dv}{dt}\right)
\end{align}
\)</center>
produces:
You can also have multiple equations in the same row:
<center>\(
\begin{align}
L_1&=10~\mbox{mH} & R_1&=15~\mbox{k}\Omega & C_1&=22~\mu\mbox{F}\\
L_2&=18~\mbox{mH} & R_2&=22~\mbox{k}\Omega & C_2&=17~\mu\mbox{F}
\end{align}
\)</center>
produces:
Arrays
Arrays work perfectly well in Pundit - as long as you don't try to stretch them:
Known Issues
- LaTeX on Pundit does not know "unnumbered" versions of things. That is to say, trying to use
\begin{align*}
, for example with:
<center>\(
\begin{align*}
e^x&=\sum_{k=0}^{\infty}\frac{x^k}{k!}
\end{align*}
\)</center>
will cause:
which is bad... Use the "unstarred" version:
<center>\(
\begin{align}
e^x&=\sum_{k=0}^{\infty}\frac{x^k}{k!}
\end{align}
\)</center>
to get:
- LaTeX on Pundit does not know the
\renewcommand
command - so arrays cannot be stretched.
FAQ
What's the 15-second summary of using LaTeX?
- Use emacs blah.tex & to generate the source code.
- Use latex blah.tex to process the file. If successful, among other things, you will have a new blah.dvi file.
- Use dvips -t letter blah.dvi to create a PostScript file from the DVI file.
- Use evince blah.ps & 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 okular step. Also, once you have run evince, you won't need to re-run it each time; evince will always look at the most current version of the ps file - meaning you 'will have to run both latex and dvips to get a new version of the PostScript file to view. That is to say, a typical command history might be:
emacs lab1.tex &
latex lab1.tex
dvips -t lab1.dvi
evince lab1.ps &
latex lab1.tex
dvips -t lab1.dvi
latex lab1.tex
dvips -t lab1.dvi
latex lab1.tex
dvips -t lab1.dvi
latex lab1.tex
dvips -t lab1.dvi
latex lab1.tex
dvips -t lab1.dvi
What do I do if LaTeX just sits there?
If LaTeX hits an error, hit CTRL-D to get out of LaTeX, then search above for the error, its location, and its probably cause.
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 a blank 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{setspace}
\setstretch{2.0}
The MIT page has more options, including adding different spacing to sections of a document.
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
- Displaying a formula on the Meta-Wiki
- Wikibook on LaTeX - a wiki devoted to LaTeX! All kinds of good stuff here.
- LaTeX on Wikipedia - includes several tutorials and references
- Tobias Oetiker's "The Not So Short Introduction to LaTeX2e" - great guide for beginning (and not so beginning) users. Should be version 5.01 (from 4/6/2011; last checked 8/17/2013). If that link doesn't work, try
- Mirror in Switzerland
- Andrew Roberts' "Getting to grips with LaTeX" tutorial (last checked 8/17/2013)
- The Comprehensive LaTeX Symbol List, Scott Pakin (PDF, over 100 pages! from 11/9/2009; last checked 8/17/2013)
- Short Math Guide for LaTeX, Michael Downes (PDF, 17 pages - from 3/22/2002; last checked 8/17/2013)
- A more "visual" version of LaTeX: LyX.
- LaTeX Showcase
- MacTeX- LaTeX for Macintosh Users with OS 10.5 or higher