Latex: Difference between revisions

From David's Wiki
Line 15: Line 15:
Download [https://www.tug.org/texlive/ TexLive].
Download [https://www.tug.org/texlive/ TexLive].
This is several gigabytes since it includes all the popular LaTex packages and takes a while to install.
This is several gigabytes since it includes all the popular LaTex packages and takes a while to install.
You'll also need an editor. I recommend installing [[Atom]] with the following packages:  
You'll also need an editor. I recommend installing [[Atom_(text_editor) | Atom]] with the following packages:  
* <code>latex</code> for calling the TexLive compiler
* <code>latex</code> for calling the TexLive compiler
* <code>language-latex</code> for syntax highlighting
* <code>language-latex</code> for syntax highlighting
* <code>pdf-view</code> for viewing the compiled pdf.
* <code>pdf-view</code> for viewing the compiled pdf.
====Linux====
====Linux====
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">

Revision as of 11:59, 15 October 2019



Installation

No Install

Use Overleaf to create latex documents in a web browser.

Partial Install

Download MikTex. It includes the TeXworks editor and will download packages as you use them. This will not take up as much disk space as a full install.

Full Install

Windows

Download TexLive. This is several gigabytes since it includes all the popular LaTex packages and takes a while to install. You'll also need an editor. I recommend installing Atom with the following packages:

  • latex for calling the TexLive compiler
  • language-latex for syntax highlighting
  • pdf-view for viewing the compiled pdf.

Linux

sudo apt install texlive-full

Compile tex documents with

pdflatex [mydocument.tex]

Usage

Fancy Math Font

See this answer.

% Use mathbb for the set of reals R or the set of complex numbers C
% Requires amsfonts
\mathbb{R}

Spaces

See Reference

Spaces in mathematical mode.
 
\begin{align*}
f(x) =& x^2\! +3x\! +2 \\
f(x) =& x^2+3x+2 \\
f(x) =& x^2\, +3x\, +2 \\
f(x) =& x^2\: +3x\: +2 \\
f(x) =& x^2\; +3x\; +2 \\
f(x) =& x^2\ +3x\ +2 \\
f(x) =& x^2\quad +3x\quad +2 \\
f(x) =& x^2\qquad +3x\qquad +2
\end{align*}