User Tools

Site Tools


latex

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
latex [2016/04/16 14:47]
jgcorliss
latex [2017/08/08 15:56] (current)
jgcorliss [Editors]
Line 1: Line 1:
 ====== LaTeX Tutorial ====== ====== LaTeX Tutorial ======
  
-[[http://​en.wikipedia.org/​wiki/​TeX|TeX]] is a 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 easier, is used by most mathematicians.+[[http://​en.wikipedia.org/​wiki/​TeX|TeX]] is a 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 easier, is used by most mathematicians ​and many professionals in other scientific fields.
  
-===== Online Tutorials ===== +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.
- +
-  * [[https://​en.wikibooks.org/​wiki/​LaTeX|LaTeX Wikibook]] ​-- An excellent, readable reference on LaTeX fundamentals +
-  * [[http://​www.andy-roberts.net/​writing/​latex|Getting to Grips with LaTeX]]+
  
 ===== Getting Started ===== ===== Getting Started =====
  
 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 a PDF. Congratulations,​ you are now a LaTeX user! 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 a PDF. Congratulations,​ you are now a LaTeX user!
 +
 +-- Insert link to a basic TeX file template here --
  
 ===== Installation ===== ===== Installation =====
  
-==== LaTeX on Macintosh ====+==== 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. 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.
  
-==== LaTeX on Windows ====+==== Windows ====
  
 Install [[http://​www.tug.org/​protext/​|proTeXt]]. Install [[http://​www.tug.org/​protext/​|proTeXt]].
  
-==== LaTeX on Linux ====+==== Linux ====
  
 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''​. 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''​.
Line 28: Line 27:
 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. 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 ===+=== Escaping from Error Messages ​on Linux ===
  
-An error message indicates invalid LaTeX. ​ When you get a message like+An error message indicates invalid LaTeX. ​ When you get a message like,
  
   ! LaTeX Error: Bad math environment delimiter.   ! LaTeX Error: Bad math environment delimiter.
Line 38: Line 37:
   ?   ?
  
-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.+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 ===== ===== Editors =====
  
-There are many tools available for editing TeX files. Here are few+There are many programs ​available for editing TeX files. Here is [[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]]   * [[http://​texstudio.sourceforge.net/​|TeXstudio]]
-  * [[http://www.xm1math.net/​texmaker/|Texmaker]] +  * [[https://www.overleaf.com/|Overleaf]] -- real-time collaborative writing and publishing tools 
-  * [[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 ===== ===== 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 are even more macros that work on top of the basic LaTeX setup. ​ For example, the ''​diagrams''​ package ​below enables ​easier-to-use ​commands to create commutative diagrams ​than in standard LaTeX.+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. Some of these packages may already be installed in your version of TeX.
  
 ^ Package ^ Description ^ ^ Package ^ Description ^
-diagrams.sty This is [[http://www.paultaylor.eu/diagrams/|Paul Taylor'​s]] commutative diagrams package | +mathtools | Don't fly without it. Includes the ''​amsmath''​ package while adding bug fixes, useful settings, more symbols, and new environments. | 
-| hyperref | Use this to typeset urls and create (internal and external) hyperlinks in your documents. ​ Download the package and manual ​[[http://www.tug.org/applications/hyperref/|from TUG]]your TeX distribution will most likely already have this installed. | +| amssymb | Adds math symbols. | 
-| setspace | Use this to create one-and-a-half spacing, double-spacing,​ etc. Your TeX distribution will most likely already have this installed. | +| 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]]. | 
-===== Examples and Templates ===== +| parskip | Replaces paragraph indentation by vertical whitespace between paragraphs. | 
- +| color, xcolor | Add text coloring commands. | 
-Before beginning the tutorial, we present a selection of example LaTeX files. +| 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. | 
--- Insert here a link to a sample ​.tex file for beginners --+| diagrams.sty | This is [[http://​www.paultaylor.eu/​diagrams/​|Paul Taylor'​s]] commutative diagrams package. |
  
--- Insert here a LaTeX template for a qual proposal --+===== Templates =====
  
--- Insert ​the dissertation template(s) ​here --+-- Insert ​a link here to a TeX template for a qual proposal ​--
  
-A great place to find many examples of LaTeX source code is the [[http://​front.math.ucdavis.edu"​|arXiv]]. Virtually every preprint on the arXiv is typeset using LaTeX and has source code available for download from the summary page.+-- Insert link(s) here to the dissertation template(s) --
  
 ===== Additional Resources ===== ===== Additional Resources =====
  
-  * [[http://​www.colorado.edu/​physics/​phys4610/​phys4610_sp13/​Symbols.pdf|short list]] of the most commonly used LaTeX mathematical symbols. +  * [[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]]+  * [[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.   * 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.)   * 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.   * 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]] +  * [[http://​www.tex.ac.uk/​cgi-bin/​texfaq2html?​label=cv|CV ​Resources]]
-  * [[http://​tex.stackexchange.com/​|TeX/​LaTeX Stack Exchange]]+
latex.1460843223.txt.gz · Last modified: 2016/04/16 14:47 by jgcorliss