Community

Looking for a challenging algebra text? Preparing for MATHCOUNTS or the AMC exams?
Check out Art of Problem Solving's Introduction to Algebra by Richard Rusczyk.
Login Register Memberlist Search AoPS Blogs Contests Galleries Forum Index
The time now is Tue Nov 24, 2009 4:36 pm
All times are UTC - 8
View posts since last visit
View unanswered posts
LaTeX FAQ
Moderators: fedja, stevem
Post new topic   Reply to topic View previous topicView next topic
20 Posts • Page 1 of 1
Author Message
stevem
Navier-Stokes Equations
Navier-Stokes Equations

Offline
Joined: 25 Apr 2004
Posts: 2192
Location: Dorset, UK

To rate posts you must be logged in
#1
LaTeX FAQ
New to LaTeX? Then here are answers to some common questions

If you'd like to suggest further topics for the FAQ or correct errors please do so in this thread.

1. I don't have LaTeX on my computer. Can I type a formula on this forum?
Yes! All you need do is enclose your mathematics between dollar signs and the rest is done by AoPS - MathLinks server. So to get \sqrt {x^{2} + y^{2}} all you need do is type
Code:
$\sqrt{x^2+y^2}$
You can see the code others have used by hovering the mouse over a formula or by clicking on the formula which will also allow you copy that code.
There is no need to put ordinary text between dollar signs.

2. How do I find out what to type on the forum?
LaTeX:Commands shows you how to get powers, fractions, integrals etc and LaTeX:Symbols shows you how to get plus or minus, greater than or equal, Greek letters etc.
You can try it out in the TeXer or the Test Forum
The LaTeX Equation Editor will help you write your LaTeX code for a short formula.

3. The margins in my LaTeX document are wrong. How can I change them?
The geometry package makes setting margins etc very easy. For example,
Code:
\usepackage[margin=1in]{geometry}
puts a margin of 1in all the way round.
You can make the various margins different and even mix measurements like this
Code:
\usepackage[top=2.9cm,left=2in,bottom=1in,right=1in]{geometry}
See the geometry package user's manual for more details.

4. How can I change the font size and colo(u)r in my document?
The font size of text in can be changed by using the following commands which got from the smallest to the largest: \tiny \scriptsize \footnotesize \normalsize \large \Large \LARGE \huge \Huge
So you can write \text{{\tiny tiny}{\large \ large}} but it looks awful so use very sparingly if at all.

To change the colo(u)r you need to use the color package with
Code:
\usepackage{color}
and then you can type things like
Code:
\color{red}This is in red and so is $x+y+z$\\
\normalcolor This is not
which works with math(s) and text. However, it's not available on the forum.

5. Tell me about eqnarray
The only thing to say is that it is now obsolete! If you want to know why then Avoid eqnarray! will explain.
The replacement is align and is very similar to use, though it doesn't need so many &'s, but does require
Code:
\usepackage{amsmath}
in your document (see 8. below). It lines up a series of equations nicely.
Code:
\begin{align}
   x &= 1 \\
   y &= 2
\end{align}
results in
\begin{align}x & = 1 \\
y & = 2 \end{align}
If you don't want the equations numbered then use align* instead of align.

6. I use MiKTeX and I want to add a new package. How should I do this?
Suppose that you want to add the fancyhdr package (the same procedure works for hundreds of other packages). In the latest version of MiKTeX (version 2.5 or later) you may just have to add the line
Code:
\usepackage{fancyhdr}
at the start of your document and MiKTeX downloads the package and installs it automatically.

Sometimes this doesn't work (you may not have given MiKTeX permission to do this) or you have an older version. In that case go to
Version 2.4: Start -> All Programs -> MiKTeX -> MiKTeX Package Manager
Version 2.5 (or 2.6): Start -> All Programs -> MiKTeX 2.5 (or 2.6) -> Browse Packages

Wait a while until MiKTeX loads all the package names. Find fancyhdr in the list, right-click, choose Install and in a few moments MiKTeX will tell you it's done and you can close the program and compile your file.

In Version 2.5 (or 2.6) you can set MiKTeX to automatically install new packages as needed. Start - All Programs -> MiKTeX 2.5 (or 2.6) -> Settings -> Install missing packages on-the-fly. I suggest you set this to Ask me first. Then when you compile a document which uses the package, MiKTeX will install it for you.

7. How can I make a table?
LaTable is a small free program that allows you to design tables complete with merged cells, borders etc. It generates the LaTeX code as you type which you then copy to TeXnicCenter. It makes tables very easy to do.

8. What packages are needed for all documents?
amsmath and similar were created to solve most people's mathematical needs so should be included in all documents. A template for your documents could look something like this:
Code:
\documentclass[12pt]{article}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsthm}
\begin{document}

\end{document}
TexnicCenter, for example, provides a number of templates you can customise which you use via File, New from Template. The templates are found in something like C:\Program Files\TeXnicCenter\Templates\Documents but you can add more places using Tools->Options->Directories.

9. My opening quotation marks are backwards, how do I correct this?
Only use ' and " for closing quotation marks not for opening ones - use one backtick ` or two backticks`` instead. You should find it on the left of the keyboard along with two other symbols ¬ and ¦ but keyboards in different countries may have it in a different place. TeXnicCenter can do this for you automatically Tools -> Options -> General -> Replace quotation marks.

10. How can I make an arc over AB?
You can use \stackrel{\frown}{AB} which looks like \stackrel{\frown}{AB} or use the arcs package (available with MiKTeX but not on this forum) where \overarc{AB} gives:
latex.gif
 Description   arcs package using \overarc{AB}
 Filesize   328Bytes
 Viewed   4736 Time(s)

latex.gif

Last edited by stevem on Fri Sep 11, 2009 4:15 am; edited 2 times in total 
PostPosted: Sun Dec 10, 2006 10:07 am  Back to top 
  ProfilePMWWW
shawtoos
Riemann Hypothesis
Riemann Hypothesis

Offline
Joined: 20 Nov 2006
Posts: 461

To rate posts you must be logged in
#2
Managing a large document in TeXnicCenter

A summary of some key components for getting started:

Start TeXnicCenter.

1. Create a project by choosing the File/New Project menu item, and choose one of the various templates. This will create a project with a main file containing standard code for the selected type of LaTex document. You can add code to this document, but at some point it becomes unwieldy to shift through.

2. Several output formats are available. I suggest choosing the DVI output: Select the Build menu item then Choose Output Type/Latex=>DVI. This will enable the YAP previewer which is the program displaying the document after it's been built.

3. Once a project is created, a main latex file is created by the system and is displayed in the TeXnicCenter editor. Build it and review the build log at the bottom of the editor and verify no critical errors occurred; this would prevent YAP from starting up the first time. Otherwise YAP displays the output of the main file. From the YAP View Menu item, select Options/Reverse DVI Search, then select TeXnicCenter, then choose Apply. Now double clicking on any word in the output document directs you to the source code at the point corresponding to the location you clicked. This allows for quick and efficient code development.

4. If necessary, segregate components of the document into chapters or other components. Do this by creating separate files for each component using the File/New/From Template option on the main menu. Choose an appropriate file type. This creates a stub file which is then added to the project. The file name should appear in the Navigator window. Add the relevant code to the chapter file. The stub includes default newcommand lines for defining short cuts. These should be edited as necessary or removed entirely to prevent "duplicate definition" error messages when multiple stubs are being loaded into the build. Rename the stubs as necessary.

5. At the point in the main file where this component is to be located, enter:

\input{file_name_here}

Each component file can now be edited separately, and the document then re-built from the editor simply by pressing Ctrl-F5. If there are no serious errors with the code, YAP displays the changes.

6. Use the Navigator tree on the left of the TeXnicCenter to navigate to various components of the document. Alternatively, each file name is located on a tab at the bottom of the edit menu. Just click one and open it in the editor.

7. When including graphics, use EPS files for DVI output and PDF, PNG, JPEG, or GIF graphics files for the PDF output. A comprehensive guide for using graphic files in LaTex can be found at:

ftp://cam.ctan.org/tex-archive/info/epslatex/english/epslatex.pdf

Graphic files slow the build and display of the output. To improve performance of developing a LaTex document, enable "draft" on some or all included graphics files. This prevents full loading of graphics files; only an empty box with the file name and a caption is displayed. For example use the following syntax for excluding a single file in a \begin{figure} block:

\includegraphics[scale=1,draft]{testeps.eps}

Alternatively, all graphics files can be excluded by enabling "draft" in the package command at the top of the main file:

\usepackage[draft]{graphicx}
_________________
"Your heart is free . . . have the courage to follow it."

PostPosted: Mon Feb 11, 2008 4:23 pm  Back to top 
  ProfilePM
hiamp
Hodge Conjecture
Hodge Conjecture


Offline
Joined: 10 Jun 2008
Posts: 85
Location: someone floating in outerspace(dont question the almighty answer)

To rate posts you must be logged in
#3
how do you get latex on your computer

PostPosted: Thu Jun 26, 2008 4:48 pm  Back to top 
  ProfilePM
stevem
Navier-Stokes Equations
Navier-Stokes Equations

Offline
Joined: 25 Apr 2004
Posts: 2192
Location: Dorset, UK

To rate posts you must be logged in
#4
See LaTeX:Downloads. But you don't need to do ths if you only want to post on the forum. See LaTeX FAQ 1 above.

PostPosted: Fri Jun 27, 2008 2:28 am  Back to top 
  ProfilePMWWW
nikeballa96
Navier-Stokes Equations
Navier-Stokes Equations


Offline
Joined: 26 Apr 2008
Posts: 1090
Location: mischighin.
IndiaUnited States

To rate posts you must be logged in
#5
either im really dumb, or, well, im really dumb.

how do you write 2^2x in latex?

PostPosted: Sat Nov 22, 2008 7:45 pm  Back to top 
  ProfilePMBlog
Akashnil
Yang-Mills Theory
Yang-Mills Theory

Offline
Joined: 17 Jan 2008
Posts: 724
Location: Barrackpore, Kolkata
IndiaAntarctica

To rate posts you must be logged in
#6
2^{2x} gives 2^{2x} and 2^2x gives 2^2x

PostPosted: Sat Nov 22, 2008 11:59 pm  Back to top 
  ProfilePM
googology101
P versus NP
P versus NP


Offline
Joined: 05 Jan 2009
Posts: 21
Location: Drifting into a world of limitless dimensions!! --Stan Lee

To rate posts you must be logged in
#7
This is the only spot where I could find a place to ask this.

How do I get a triangle to appear around text?

PostPosted: Sat Jan 10, 2009 5:46 pm  Back to top 
  ProfilePMBlogAlbum
stevem
Navier-Stokes Equations
Navier-Stokes Equations

Offline
Joined: 25 Apr 2004
Posts: 2192
Location: Dorset, UK

To rate posts you must be logged in
#8
Ask in the Asymptote forum with more detail of exactly what you are looking for.

PostPosted: Sun Jan 11, 2009 2:31 am  Back to top 
  ProfilePMWWW
AwesomeToad
Yang-Mills Theory
Yang-Mills Theory


Offline
Joined: 25 Apr 2009
Posts: 774
Location: West Lafayette, IN (Rating: 1337)
United States

To rate posts you must be logged in
#9
How do you type:
1) 9P3 (or similar)
2) <= (the < underlined; nonstrict inequality)
3) Space between words

PostPosted: Wed May 27, 2009 5:18 pm  Back to top 
  ProfilePMBlog
solafidefarms
Birch & Swinnerton Dyer
Birch & Swinnerton Dyer


Offline
Joined: 11 Feb 2004
Posts: 2716
Location: South Metro Atlanta
United States

To rate posts you must be logged in
#10
Don't put words inside your dollar signs. Space solved.

\leq \leq

\binom{9}{3} \binom{9}{3}
_________________
Rom8:35,37 Who shall separate us from the love of Christ? shall tribulation, or distress, or persecution, or famine, or nakedness, or peril, or sword? ...Nay, in all these things we are more than conquerors through him that lo

PostPosted: Wed May 27, 2009 6:21 pm  Back to top 
  ProfilePMBlogAlbum
Dojo
Navier-Stokes Equations
Navier-Stokes Equations


Offline
Joined: 04 Feb 2008
Posts: 1770
Location: Washington
Korea, Republic ofUnited States

To rate posts you must be logged in
#11
Or in the case that you do use text (maybe in a longer explanation) use the \text{} command thing.

Code:
$\text{Hi my name is Dojo}$

\text{Hi my name is Dojo}

You can also add color and bold to your text
Code:
$\textbf{Hi my name is Dojo}$

\textbf{Hi my name is Dojo}
Code:
$\color{red}\text{Hi my name is Dojo}$

\color{red}\text{Hi my name is Dojo}
_________________
-Dojo Smile

PostPosted: Wed May 27, 2009 6:57 pm  Back to top 
  ProfilePMWWWBlogAlbum
ThinkFlow
Yang-Mills Theory
Yang-Mills Theory

Offline
Joined: 17 Jun 2008
Posts: 917
United States

To rate posts you must be logged in
#12
While I'm quite sure you can use LaTeX text for explanations or in formulas, see this post.

PostPosted: Wed May 27, 2009 7:27 pm  Back to top 
  ProfilePM
AwesomeToad
Yang-Mills Theory
Yang-Mills Theory


Offline
Joined: 25 Apr 2009
Posts: 774
Location: West Lafayette, IN (Rating: 1337)
United States

To rate posts you must be logged in
#13
Thanks guys Smile . But I meant 9P3, not 9C3.
_________________
Join Mock AMC! Participation encouranged and appreciated!

PostPosted: Thu May 28, 2009 1:08 pm  Back to top 
  ProfilePMBlog
Dojo
Navier-Stokes Equations
Navier-Stokes Equations


Offline
Joined: 04 Feb 2008
Posts: 1770
Location: Washington
Korea, Republic ofUnited States

To rate posts you must be logged in
#14
Generally, you would denote permutations as
Code:
$9P3$

9P3
or
Code:
P(9,3)

P(9,3)

Either way, it's just simple text.
_________________
-Dojo Smile

PostPosted: Thu May 28, 2009 5:15 pm  Back to top 
  ProfilePMWWWBlogAlbum
stevem
Navier-Stokes Equations
Navier-Stokes Equations

Offline
Joined: 25 Apr 2004
Posts: 2192
Location: Dorset, UK

To rate posts you must be logged in
#15
Or ^9P_3 or _9P_3
topofmath needs to make clear exactly what they want, illustrating, if necessary, with a screenshot or a link to an image.

PostPosted: Fri May 29, 2009 1:12 am  Back to top 
  ProfilePMWWW
centry57
P versus NP
P versus NP


Offline
Joined: 03 Jul 2009
Posts: 40

To rate posts you must be logged in
#16
is \vec{A}\times\vec{B}\cdot\vec{C} right?

PostPosted: Sun Aug 02, 2009 6:15 pm  Back to top 
  ProfilePM
Dojo
Navier-Stokes Equations
Navier-Stokes Equations


Offline
Joined: 04 Feb 2008
Posts: 1770
Location: Washington
Korea, Republic ofUnited States

To rate posts you must be logged in
#17
I'm not sure what "right" means. If you want to test out latex, do so in the test forum.
_________________
-Dojo Smile

PostPosted: Sun Aug 02, 2009 7:36 pm  Back to top 
  ProfilePMWWWBlogAlbum
Midnight Moon
Hodge Conjecture
Hodge Conjecture


Offline
Joined: 01 Mar 2009
Posts: 69
Location: Fantasy Land!!!!!!!!

To rate posts you must be logged in
#18
What is LaTeX??

PostPosted: Thu Aug 13, 2009 10:36 pm  Back to top 
  ProfilePMAlbum
stevem
Navier-Stokes Equations
Navier-Stokes Equations

Offline
Joined: 25 Apr 2004
Posts: 2192
Location: Dorset, UK

To rate posts you must be logged in
#19
http://www.artofproblemsolving.com/LaTeX/AoPS_L_About.php

PostPosted: Fri Aug 14, 2009 12:55 am  Back to top 
  ProfilePMWWW
Midnight Moon
Hodge Conjecture
Hodge Conjecture


Offline
Joined: 01 Mar 2009
Posts: 69
Location: Fantasy Land!!!!!!!!

To rate posts you must be logged in
#20
stevem wrote:
http://www.artofproblemsolving.com/LaTeX/AoPS_L_About.php



thanks!

PostPosted: Fri Aug 14, 2009 12:29 pm  Back to top 
  ProfilePMAlbum
Display posts from previous:   Sort by:   
20 Posts • Page 1 of 1
Post new topic   Reply to topic View previous topicView next topic
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum
You cannot post calendar events in this forum


© Copyright 2008 AoPS Incorporated. All Rights Reserved. • FoundationPrivacyContact Us