Difference between revisions of "LaTeX:Help"
(→LaTeX Errors with Error Messages) |
(Tag: Undo) |
||
(23 intermediate revisions by 15 users not shown) | |||
Line 2: | Line 2: | ||
This article will answer common LaTeX questions and provide solutions to common LaTeX problems. For more active help, please consult the AoPS [http://www.artofproblemsolving.com/Forum/index.php?f=123 message board]. | This article will answer common LaTeX questions and provide solutions to common LaTeX problems. For more active help, please consult the AoPS [http://www.artofproblemsolving.com/Forum/index.php?f=123 message board]. | ||
− | + | -----Frequently Asked Questions----- | |
Here are commonly asked LaTeX questions and possible answers. | Here are commonly asked LaTeX questions and possible answers. | ||
===Installation=== | ===Installation=== | ||
==== I'm using a Macintosh. What do I do? ==== | ==== I'm using a Macintosh. What do I do? ==== | ||
− | Some Mac users use [http://www.uoregon.edu/%7Ekoch/texshop/texshop.html TeXShop], [http://www.trevorrow.com/oztex/ OzTeX] or [http://www. | + | Some Mac users use [http://www.uoregon.edu/%7Ekoch/texshop/texshop.html TeXShop], [http://www.trevorrow.com/oztex/ OzTeX] or [http://www.blueskytex.com/ Textures] (we wrote the Art of Problem Solving textbooks in 1993 using Textures). The TeXShop is free. (Special thanks to Community member '''nr1337''' for letting us know about TeXShop.) |
− | |||
− | |||
====How can I install LaTeX on my website like you have on the TeXer and your message board?==== | ====How can I install LaTeX on my website like you have on the TeXer and your message board?==== | ||
We used LatexRender, which can be found [http://www.mayer.dial.pipex.com/tex.htm here]. You will need to be able to install LaTeX and imagemagick on your server to use this. That site also has a TeX Converter that doesn't require LaTeX and Imagemagick. | We used LatexRender, which can be found [http://www.mayer.dial.pipex.com/tex.htm here]. You will need to be able to install LaTeX and imagemagick on your server to use this. That site also has a TeX Converter that doesn't require LaTeX and Imagemagick. | ||
+ | |||
+ | ==== I've upgraded MiKTeX and now TeXnicCenter won't work ==== | ||
+ | You need to tell TeXnicCenter where MiKTeX has moved to. If you are using MiKTeX 2.7 it will probably be <tt>C:\Program Files\MiKTeX 2.7\miktex\bin</tt> (this folder contains lots of exe files including <tt>latex.exe</tt>). You do this by clicking on Build, Define Output Profiles and clicking on the Wizard button in the bottom left corner. [http://www.youtube.com/watch?v=-h8Oi1oCTQg This video] will show you what to do. | ||
+ | |||
+ | |||
+ | |||
===Coding Questions=== | ===Coding Questions=== | ||
====My pages start too low!==== | ====My pages start too low!==== | ||
Line 27: | Line 31: | ||
Here are some common error messages, as well as other possible problems, and a little information about what the problem usually is. Most of these error messages will appear right after the red symbol. Occasionally, they will appear 1-2 lines before it. A few of these are just warnings - they generate yellow triangles in TeXnicCenter when compiling. | Here are some common error messages, as well as other possible problems, and a little information about what the problem usually is. Most of these error messages will appear right after the red symbol. Occasionally, they will appear 1-2 lines before it. A few of these are just warnings - they generate yellow triangles in TeXnicCenter when compiling. | ||
− | ===Extra alignment tab has been changed=== | + | ===Extra alignment tab has been changed to \cr=== |
You have too many &s in a row of a table or array or eqnarray. | You have too many &s in a row of a table or array or eqnarray. | ||
+ | |||
===LaTeX Error: \begin{something} on input line line number ended by \end{document}=== | ===LaTeX Error: \begin{something} on input line line number ended by \end{document}=== | ||
You've left out the \end{whatever}. Perhaps you're building a table or an eqnarray that has a bunch of lines and you've forgotten the \end statement. | You've left out the \end{whatever}. Perhaps you're building a table or an eqnarray that has a bunch of lines and you've forgotten the \end statement. | ||
Line 48: | Line 53: | ||
Here are some problems that might occur that don't have error messages in the compiler. If your problem isn't solved by this page, consider posting on the AoPS [http://www.artofproblemsolving.com/Forum/index.php?f=123 message board] for help. | Here are some problems that might occur that don't have error messages in the compiler. If your problem isn't solved by this page, consider posting on the AoPS [http://www.artofproblemsolving.com/Forum/index.php?f=123 message board] for help. | ||
===Forget the error messages, when I try to compile, it starts, but then just hangs. Nothing happens, and I can't do anything. Then when I try to save the file, it won't let me save it with the same name.=== | ===Forget the error messages, when I try to compile, it starts, but then just hangs. Nothing happens, and I can't do anything. Then when I try to save the file, it won't let me save it with the same name.=== | ||
− | + | You probably have tried to use a package that you haven't installed. For example, if you try \usepackage{fancyhdr} but haven't installed the [[LaTeX:Packages|package]], then you'll hang TeXnicCenter so badly that you should just restart your computer (or, if you know how, kill the latex process you've started). | |
===I'm trying to use fancyhdr to make headers and footers, but they don't align with the rest of my page. The rest of the page extends beyond the header line to the right or left.=== | ===I'm trying to use fancyhdr to make headers and footers, but they don't align with the rest of my page. The rest of the page extends beyond the header line to the right or left.=== | ||
− | + | You probably have called \textwidth (or some other command dealing with page dimensions) after the \pagestyle command in your preamble. The \pagestyle and header and footer commands should come after all the page dimensions are set in the header. | |
===I'm using referencing, but the page numbers or equation numbers aren't coming out right.=== | ===I'm using referencing, but the page numbers or equation numbers aren't coming out right.=== | ||
You have references in your document. You need to compile again so LaTeX will be able to get the [[LaTeX:Layout|references]] right. | You have references in your document. You need to compile again so LaTeX will be able to get the [[LaTeX:Layout|references]] right. | ||
==Helpful Links== | ==Helpful Links== | ||
− | * | + | *<url>index.php?f=123 Art of Problem Solving LaTeX forum</url> - ask your question to our knowledgable LaTeX community. |
+ | *<url>../LaTeX/AoPS_L_TeXer.php AoPS TeXeR</url> - the AoPS TeXer, which allows you to practice LaTeX typesetting and/or create pictures for your own website. | ||
*[http://www.tug.org/ TeX Users Group home page] - a source for all matters TeX. | *[http://www.tug.org/ TeX Users Group home page] - a source for all matters TeX. | ||
*[http://tug.ctan.org/tex-archive/help/Catalogue/catalogue.html TeX Catalogue Online] - a comprehensive database of LaTeX packages. | *[http://tug.ctan.org/tex-archive/help/Catalogue/catalogue.html TeX Catalogue Online] - a comprehensive database of LaTeX packages. |
Latest revision as of 19:01, 8 September 2022
LaTeX |
About - Getting Started - Diagrams - Symbols - Downloads - Basics - Math - Examples - Pictures - Layout - Commands - Packages - Help |
This article will answer common LaTeX questions and provide solutions to common LaTeX problems. For more active help, please consult the AoPS message board.
Frequently Asked Questions-----
Here are commonly asked LaTeX questions and possible answers.
Contents
- 1 Installation
- 2 Coding Questions
- 3 LaTeX Errors with Error Messages
- 3.1 Extra alignment tab has been changed to \cr
- 3.2 LaTeX Error: \begin{something} on input line line number ended by \end{document}
- 3.3 LaTeX Warning: Reference ... undefined on ....
- 3.4 LaTeX Warning: There were undefined references.
- 3.5 Missing $ inserted
- 3.6 Paragraph ended before \end was complete.
- 3.7 Runaway argument?
- 3.8 Undefined control sequence.
- 4 Other LaTeX Errors
- 4.1 Forget the error messages, when I try to compile, it starts, but then just hangs. Nothing happens, and I can't do anything. Then when I try to save the file, it won't let me save it with the same name.
- 4.2 I'm trying to use fancyhdr to make headers and footers, but they don't align with the rest of my page. The rest of the page extends beyond the header line to the right or left.
- 4.3 I'm using referencing, but the page numbers or equation numbers aren't coming out right.
- 5 Helpful Links
- 6 See Also
Installation
I'm using a Macintosh. What do I do?
Some Mac users use TeXShop, OzTeX or Textures (we wrote the Art of Problem Solving textbooks in 1993 using Textures). The TeXShop is free. (Special thanks to Community member nr1337 for letting us know about TeXShop.)
How can I install LaTeX on my website like you have on the TeXer and your message board?
We used LatexRender, which can be found here. You will need to be able to install LaTeX and imagemagick on your server to use this. That site also has a TeX Converter that doesn't require LaTeX and Imagemagick.
I've upgraded MiKTeX and now TeXnicCenter won't work
You need to tell TeXnicCenter where MiKTeX has moved to. If you are using MiKTeX 2.7 it will probably be C:\Program Files\MiKTeX 2.7\miktex\bin (this folder contains lots of exe files including latex.exe). You do this by clicking on Build, Define Output Profiles and clicking on the Wizard button in the bottom left corner. This video will show you what to do.
Coding Questions
My pages start too low!
Use \topmargin in the preamble as described here to set the top margin smaller.
LaTeX Errors with Error Messages
When you use TeXnicCenter, a separate window contains output from LaTeX concerning various compiling information, including errors. Much of this text can be ignored. However, if you see a symbol that looks like this:
Then you have a serious problem.
If you have a whole string of these error messages, scroll back until you hit the first one. Often one error will cause many others, so you should fix them starting with your first problem. Also, the output from the compiler will give you a line number to help you find the error in your code. In TeXnicCenter, the line number you are on is given at the bottom of the TeXnicCenter window on the right.
Here are some common error messages, as well as other possible problems, and a little information about what the problem usually is. Most of these error messages will appear right after the red symbol. Occasionally, they will appear 1-2 lines before it. A few of these are just warnings - they generate yellow triangles in TeXnicCenter when compiling.
Extra alignment tab has been changed to \cr
You have too many &s in a row of a table or array or eqnarray.
LaTeX Error: \begin{something} on input line line number ended by \end{document}
You've left out the \end{whatever}. Perhaps you're building a table or an eqnarray that has a bunch of lines and you've forgotten the \end statement.
LaTeX Warning: Reference ... undefined on ....
You have references in your document. You need to compile again so LaTeX will be able to get the references right.
LaTeX Warning: There were undefined references.
You have references in your document. You need to compile again so LaTeX will be able to get the references right.
Missing $ inserted
You left out a $ or \[ or \] or $$ somewhere when you were writing text that needs to be in math mode.
Paragraph ended before \end was complete.
You are probably missing an } at the end of an \end{something} statement.
Runaway argument?
A runaway argument occurs when you leave off a }.
Undefined control sequence.
You've tried to call a command that doesn't exist. Usually this is the result of a typo. Go to the line number mentioned in the error and look at all your commands. You'll probably find something like \rfac where you wanted \frac.
Other LaTeX Errors
Here are some problems that might occur that don't have error messages in the compiler. If your problem isn't solved by this page, consider posting on the AoPS message board for help.
Forget the error messages, when I try to compile, it starts, but then just hangs. Nothing happens, and I can't do anything. Then when I try to save the file, it won't let me save it with the same name.
You probably have tried to use a package that you haven't installed. For example, if you try \usepackage{fancyhdr} but haven't installed the package, then you'll hang TeXnicCenter so badly that you should just restart your computer (or, if you know how, kill the latex process you've started).
You probably have called \textwidth (or some other command dealing with page dimensions) after the \pagestyle command in your preamble. The \pagestyle and header and footer commands should come after all the page dimensions are set in the header.
I'm using referencing, but the page numbers or equation numbers aren't coming out right.
You have references in your document. You need to compile again so LaTeX will be able to get the references right.
Helpful Links
- <url>index.php?f=123 Art of Problem Solving LaTeX forum</url> - ask your question to our knowledgable LaTeX community.
- <url>../LaTeX/AoPS_L_TeXer.php AoPS TeXeR</url> - the AoPS TeXer, which allows you to practice LaTeX typesetting and/or create pictures for your own website.
- TeX Users Group home page - a source for all matters TeX.
- TeX Catalogue Online - a comprehensive database of LaTeX packages.
- MiKTeX home page - a popular TeX engine for Windows-based computers.
- TeXnicCenter home page - a popular TeX editor for Windows-based computers.
- MetaPost home page - MetaPost is a programming language for creating graphic images for inclusion into LaTeX documents. It is not easy to install or use but the quality of the images produced by MetaPost is outstanding. (All of the Art of Problem Solving's new Introductory textbooks used MetaPost to generate the diagrams.)