User Tools

Site Tools


latex

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
latex [2016/02/16 09:21]
jasnyder created
latex [2017/08/08 15:56] (current)
jgcorliss [Editors]
Line 1: Line 1:
-<​html>​ +====== LaTeX Tutorial ​======
-<​p><​h1>​What is LaTeX?</​h1>​ +
-<a href="​http://​en.wikipedia.org/​wiki/​TeX">​TeX</​a>​ is a powerful typesetting system that is especially useful for mathematical expressions. +
-A system called LaTeX (which is TeX with many additional "​macros"​) is used by most mathematicians. +
-Either  +
-<a href="​http://​abel.math.harvard.edu/​computing/​latex/​manual/​texman.html">​An Introduction to Using TeX</​a>​ +
-or +
-<a href="​http://​www.mecheng.adelaide.edu.au/​~will/​texstart/">​TeX on Mac OS X</​a>​ +
-might get you started quickly. ​ See also "​Diving into LaTeX quickly"​ below.</​p>​ +
-<​p><​h1>​Examples and Templates</​h1></​p>​ +
-<​p>​Before beginning the tutorial, we present a selection of example LaTeX files.</​p>​ +
-<​p><​table border=1 cellpadding=4 cellspacing=0> +
-  <​tr>​ +
-    <​td><​a href="​samplearticle.tex">​samplearticle.tex</​a></​td>​ +
-    <​td>​A ​LaTeX sample that shows some basics so you can copy and learn by example.</​td>​ +
-  </​tr>​ +
-  <​tr>​ +
-    <​td><​a href="​quals_proposal_template.tex">​quals_proposal_template.tex</​a></​td>​ +
-    <td>A template for a proposal for the qualifying exam.</​td>​ +
-  </​tr>​ +
-  <​tr>​ +
-    <td colspan=2 align=center><​b>​The fast-growing list of <a href="​http://​galois.math.ucdavis.edu/​UsefulGradInfo/​HelpfulAdvice/​WritingYourThesis">​dissertation templates</​a>​ has moved.</​b></​td>​ +
-  </​tr>​ +
-</​table></​p>​ +
-<p>A great place to find many examples of LaTeX source code is the <a href="​http://​front.math.ucdavis.edu">​arXiv</​a>​. +
-Virtually every preprint on the arXiv is typeset using LaTeX and has source code available for download from the summary page.</​p>​ +
-<​p><​h1>​Diving into LaTeX quickly</​h1></​p>​ +
-<​p>​Decide whether you're going to use the department computers (Linux) or your own (Windows, Mac, or Linux). +
-Get a valid LaTeX file (such as "​samplearticle.tex"​ above). +
-Follow the instructions below specific to your operating system (Windows, Mac, or Linux) to typeset/​compile the file.</​p>​ +
-<​p>​Compare the LaTeX file to the PDF file to see how the correspond. +
-Once you mostly get the LaTeX file, you can try making some changes, save, and recompile!</​p>​ +
-<​p><​a name="​Mac"></​a><​h2>​LaTeX on Macintosh</​h2></​p>​ +
-<​p>​Install <a href="​http://​www.tug.org/​mactex/">​MacTeX</​a>,​ which includes <a href="​http://​www.uoregon.edu/​~koch/​texshop/​texshop.html">​TeXShop</​a>​. +
-Open a LaTeX file in TeXShop and click the "​Typeset"​ button. +
-You can make changes in the editing window and view the results in the PDF preview window.</​p>​ +
-<​p></​p>​ +
-<​p><​a name="​Windows"></​a><​h2>​LaTeX on Windows</​h2></​p>​ +
-<​p>​Install <a href="​http://​www.tug.org/​protext/">​proTeXt</​a>​.</​p>​ +
-<​p><​a name="​linux"></​a><​h2>​LaTeX on Linux</​h2></​p>​ +
-<​p>​Using a terminal, change into the directory where your LaTeX file is. +
-If your file is called "​myfile.tex",​ then run the command "​pdflatex myfile.tex"​. +
-In the same directory should be "​myfile.pdf"​. +
-You can make changes using any text editor (or retransfer / download your updated LaTeX file) and rerun "​pdflatex"​.</​p>​ +
-<p>If you get a "​command doesn'​t exist" error, some of the "local machines"​ (like the math department computers in the grab lab) don't have TeX/LaTeX installed. +
-First, SSH into one point/​round/​line/​tangent,​ cd to the right directory, and try again. +
-If you're running Linux on your own computer at home, you might need to first install tetex.</​p>​ +
-<​p><​h3>​Escaping from error messages on Linux</​h3></​p>​ +
-<p>An error message indicates invalid LaTeX. ​ When you get a message like</​p>​ +
-<​p><​blockquote>​ +
-<​code>​! LaTeX Error: Bad math environment delimiter.</​code></​p>​ +
-<​p><​code>​See the LaTeX manual or LaTeX Companion for explanation.</​code><​br>​ +
-<​tt>​Type ​ H &​lt;​return&​gt; ​ for immediate help.</​tt><​br>​ +
-<​code>​ ...                                              </​code><​br></​p>​ +
-<​p><​code>​l.12 \begin{displaymath}</​code></​p>​ +
-<​p><​code>?</​code>​ +
-</​blockquote></​p>​ +
-<​p>​Enter either <​code>​q</​code>​ or <​code>​x</​code>​ to get out.  LaTeX suggests the error is at line 12.  In reality, it may be on some line nearbay.</​p>​ +
-<​p><​h1>​Packages</​h1>​ +
-Everything before the line \begin{document} is called the <​i>​preamble</​i>​. ​ You may have noticed that some <​code>​LaTeX</​code>​ preambles contain lines starting with \usepackage. ​ This is how you load packages, which are even more macros that work on top of the basic <​code>​LaTeX</​code>​ setup. ​ For example, the diagrams package below enables easier-to-use commands to create commutative diagrams than in standard <​code>​LaTeX</​code>​.</​p>​ +
-<​p>​Some of these packages may already be installed in your version of <​code>​TeX</​code>​.</​p>​ +
-<​dl>​ +
-<​dt><​a href="​diagrams.sty">​diagrams.sty</​a></​dt>​ +
-<​dd>​this is <a href="​http://​www.cs.man.ac.uk/​~pt/​diagrams/​index.html">​Paul Taylor'​s</​a>​ commutative diagrams package</​dd>​ +
-<​dt>​hyperref</​dt>​ +
-<​dd>​Use this to typeset urls and create (internal and external) hyperlinks in your documents. ​ Download the package and manual <a href="​http://​www.tug.org/​applications/​hyperref/">​from TUG</​a>;​ your <​code>​TeX</​code>​ distribution will most likely already have this installed.</​dd>​ +
-<​dt>​setspace</​dt>​ +
-<​dd>​Use this to create one-and-a-half spacing, double-spacing,​ etc.  Download (via ftp) <a href="​ftp://​cam.ctan.org/​tex-archive/​macros/​latex/​contrib/​setspace/​setspace.sty">​from CTAN</​a>;​ your <​code>​TeX</​code>​ distribution will most likely already have this installed.</​dd>​ +
-</​dl>​ +
-<​p><​a name="​References"></​a><​H2>​Further reading</​H2></​p>​ +
-<​p>​There are many resources there for learning LaTeX:</​p>​+
  
-<​ul>​ +[[http://en.wikipedia.org/wiki/TeX|TeX]] is powerful typesetting system that is the current standard ​for creating mathematical documents. A system called [[http://​www.latex-project.org/|LaTeX]], which includes TeX along with many "macros" to make your life easieris used by most mathematicians ​and many professionals in other scientific fields.
-<​li>​As their name suggests, the website for the <a href="http://www.tug.org/"><​code>​TeX</​code>​ Users' Group</a> (TUG) is a good place to look for all things related to using (<​code>​La</​code>​)<​code>​TeX</​code>​. In particular, TUG maintains ​the also aptly named <a href="​http://​www.tug.org/​ctan.html">​Comprehensive <​code>​TeX</​code>​ Archive Network</​a>​ (CTAN), which contains many files for learning about and extending the capabilities of <​code>​LaTeX</​code>​.<br /><br /></​li>​ +
-<​li><​a href="​http://​www.loria.fr/">​Loria Labs</​a>​ maintains a useful online <a href="​http://​tex.loria.fr/">​(<​code>​La</​code>​)<​code>​TeX</​code>​ encyclopaedia</​a><​br /><br /></​li>​ +
-<​li><​a href="​http://​www.artofproblemsolving.com/">​The Art of Problem Solving</​a>​ maintains a well-organized <HREF="http://www.artofproblemsolving.com/​Wiki/​index.php/​LaTeX:​About"><​code>​LaTeX</​code>​ Tutorial</​A>​.<​br /><br /></​li>​ +
-<​li><​a href="​http://​www.giss.nasa.gov/">​Goddard Institute for Space Studies</​a>​ (a subdivision of NASA) has online descriptions of most <a href="​http://​www.giss.nasa.gov/​latex/ltx-2.html">​standard <​code>​LaTeX<​/code> commands</​a>​.<​br /><br /></​li>​ +
-<​li>​There are also many books of varying quality that one can buy, the most popular being <​cite><​a href="​http://​research.microsoft.com/​users/​lamport/​pubs/​pubs.html#​latex"><​code>​LaTeX</​code>​ : A Document Preparation System</​a></​cite>​by <​code>​LaTeX</​code>​ creator <a href="​http://​research.microsoft.com/​users/​lamport/">​Leslie Lamport</​a>​.<​br /><br /></​li>​ +
-<​li>​Another popular book is <a href="​http://​www.maths.umanitoba.ca/​homepages/​gratzer/">​George Gr&#​228;​tzer</​a>'​s <​cite>​Math into <​code>​LaTeX</​code></​cite>,​ the <a href="​http://​www.ctan.org/​tex-archive/​info/​mil/​mil.pdf">​first part</​a>​ of which is available online. (This file contains a rather comprehensive introduction for getting started ​with <​code>​LaTeX</​code>​ as well as well-formated tables of special characters.)</​li>​ +
-<li>A popular reference, especially for those just starting to use LaTeX, is the <a href="http://​www.ctan.org/​tex-archive/​info/​lshort/​english/​lshort.pdf">(Not so) Short guide to Latex</​a>​. ​   +
-It has pages of sample math codes and tables of math symbols including arrows, binary relations, and more  </​li>​ +
-<​li><​a href="​http://​www.tex.ac.uk/​cgi-bin/​texfaq2html?​label=cv">​CV</​a>​ resources</​li>​+
  
-</ul> +The [[https://​en.wikibooks.org/​wiki/​LaTeX|LaTeX Wikibook]] is an excellent, readable reference on LaTeX fundamentals. It also includes a quick, easy intro to the ''​beamer''​ document class, which is used for slide presentations. 
-<​p><​name="bottom"></a> + 
-</p> +===== Getting Started ===== 
-</html>+ 
 +Decide whether you're going to use the department computers (Linux) or your own (Windows, Mac, or Linux). Getting LaTeX working on your computer takes two steps: (1) installing LaTeX, and (2) getting an editor. Once you've completed these two steps, download an example TeX file (see below) and try compiling the TeX file into PDF. Congratulations,​ you are now a LaTeX user! 
 + 
 +-- Insert link to a basic TeX file template here -- 
 + 
 +===== Installation ===== 
 + 
 +==== Macintosh ==== 
 + 
 +Install [[http://​www.tug.org/​mactex/​|MacTeX]],​ which includes [[http://​www.uoregon.edu/​~koch/​texshop/​texshop.html|TeXShop]]. Open a LaTeX file in TeXShop and click the "Typeset" ​button. You can make changes in the editing window and view the results in the PDF preview window. 
 + 
 +==== Windows ==== 
 + 
 +Install [[http://​www.tug.org/​protext/​|proTeXt]]. 
 + 
 +==== Linux ==== 
 + 
 +Using terminal, change into the directory where your LaTeX file is. If your file is called ''​myfile.tex'',​ then run the command ''​pdflatex myfile.tex''​. In the same directory should be ''​myfile.pdf''​. You can make changes using any text editor (or retransfer / download your updated LaTeX file) and rerun ''​pdflatex''​. 
 + 
 +If you get a ''​command doesn'​t exist''​ error, some of the "local machines"​ (like the math department computers in the grab lab) don't have TeX/LaTeX installed. First, SSH into one point/​round/​line/​tangent,​ cd to the right directory, and try again. If you're running Linux on your own computer at home, you might need to first install tetex. 
 + 
 +=== Escaping from Error Messages on Linux === 
 + 
 +An error message indicates invalid LaTeX. ​ When you get a message like, 
 + 
 +  ! LaTeX Error: Bad math environment delimiter. 
 +  See the LaTeX manual or LaTeX Companion for explanation. 
 +  Type  H &​lt;​return&​gt; ​ for immediate help. 
 +  l.12 \begin{displaymath} 
 +  ? 
 + 
 +enter either ''​q''​ or ''​x''​ to get out.  LaTeX suggests the error is at line 12.  In reality, it may be on some line nearby. 
 + 
 +===== Editors ===== 
 + 
 +There are many programs available for editing TeX files. Here is a [[https://​tex.stackexchange.com/​questions/​339/​latex-editors-ides|pretty comprehensive list]]. In particular:​ 
 +  * [[http://​www.xm1math.net/​texmaker/​|Texmaker]] -- great for beginners 
 +  * [[http://​texstudio.sourceforge.net/​|TeXstudio]] 
 +  * [[https://​www.overleaf.com/​|Overleaf]] -- real-time collaborative writing and publishing tools 
 +  * [[https://​www.sublimetext.com/​|Sublime Text]] -- general code editor, has good packages for TeX editing 
 +  * Add your favorite editor here! 
 + 
 +===== Packages ===== 
 + 
 +Everything before the command ''​\begin{document}''​ is called the //​preamble//​. ​ You may have noticed that some LaTeX preambles contain lines starting with ''​\usepackage''​. ​ This is how you load packages, which contain even more macros that work on top of the basic LaTeX setup. ​ For example, the ''​diagrams''​ package enables simple commands to create commutative diagrams. 
 + 
 +Some of these packages may already be installed in your version of TeX. 
 + 
 +^ Package ^ Description ^ 
 +| mathtools | Don't fly without it. Includes the ''​amsmath''​ package while adding bug fixes, useful settings, more symbols, and new environments. | 
 +| amssymb | Adds math symbols. | 
 +| mathrsfs | More math symbols. | 
 +| geometry | Used to easily control [[https://​en.wikibooks.org/​wiki/​LaTeX/​Page_Layout#​Page_size|page size]] and [[https://​en.wikibooks.org/​wiki/​LaTeX/​Page_Layout#​Margins|page margins]]. | 
 +| parskip | Replaces paragraph indentation by vertical whitespace between paragraphs. | 
 +| color, xcolor | Add text coloring commands. | 
 +| hyperref | Adds commands to create internal and external hyperlinks in your documents, including page links in a table of contents. | 
 +| setspace | Use this to create one-and-a-half spacing, double-spacing,​ etc. | 
 +| diagrams.sty | This is [[http://​www.paultaylor.eu/​diagrams/​|Paul Taylor'​s]] commutative diagrams package. | 
 + 
 +===== Templates ===== 
 + 
 +-- Insert a link here to a TeX template for a qual proposal -- 
 + 
 +-- Insert link(s) here to the dissertation template(s) -- 
 + 
 +===== Additional Resources ===== 
 + 
 +  * [[http://​www.colorado.edu/​physics/​phys4610/​phys4610_sp13/​Symbols.pdf|LaTeX Mathematical Symbols]] -- includes all the common mathematical symbols 
 +  * [[http://​ctan.math.utah.edu/​ctan/​tex-archive/​info/​symbols/​comprehensive/​symbols-a4.pdf|Comprehensive LaTeX Symbol List]] -- for all the other symbols 
 +  * [[http://​tex.stackexchange.com/​|TeX/​LaTeX Stack Exchange]] -- when you're lazy or desperate, ask the LaTeX community for help 
 +  * [[http://​detexify.kirelabs.org/​classify.html|Detexify LaTeX handwritten symbol recognition]] 
 +  * The [[http://​www.tug.org/​|TeX Users' Group (TUG)]] is a good place to look for all things (La)TeX. In particular, TUG maintains the [[http://​www.ctan.org/​|Comprehensive TeX Archive Network (CTAN)]], which contains many files for learning about and extending the capabilities of LaTeX. 
 +  * Another popular book is George Gratzer'​s //Math into LaTeX//, the [[http://​www.ctan.org/​tex-archive/​info/​mil/​mil.pdf|first part]] of which is available online. (This file contains a comprehensive introduction for getting started with LaTeX as well as well-formatted tables of special characters.) 
 +  * A popular reference, especially for those just starting to use LaTeX, is the [[http://​www.ctan.org/​tex-archive/​info/​lshort/​english/​lshort.pdf|(Not so) Short guide to Latex]]. It has pages of sample math codes and tables of math symbols including arrows, binary relations, and more. 
 +  * [[http://​www.tex.ac.uk/​cgi-bin/​texfaq2html?​label=cv|CV Resources]]
latex.1455643269.txt.gz · Last modified: 2016/02/16 09:21 by jasnyder