Latex

From David's Wiki
Revision as of 11:57, 15 October 2019 by David (talk | contribs) (→‎Spaces)
\( \newcommand{\P}[]{\unicode{xB6}} \newcommand{\AA}[]{\unicode{x212B}} \newcommand{\empty}[]{\emptyset} \newcommand{\O}[]{\emptyset} \newcommand{\Alpha}[]{Α} \newcommand{\Beta}[]{Β} \newcommand{\Epsilon}[]{Ε} \newcommand{\Iota}[]{Ι} \newcommand{\Kappa}[]{Κ} \newcommand{\Rho}[]{Ρ} \newcommand{\Tau}[]{Τ} \newcommand{\Zeta}[]{Ζ} \newcommand{\Mu}[]{\unicode{x039C}} \newcommand{\Chi}[]{Χ} \newcommand{\Eta}[]{\unicode{x0397}} \newcommand{\Nu}[]{\unicode{x039D}} \newcommand{\Omicron}[]{\unicode{x039F}} \DeclareMathOperator{\sgn}{sgn} \def\oiint{\mathop{\vcenter{\mathchoice{\huge\unicode{x222F}\,}{\unicode{x222F}}{\unicode{x222F}}{\unicode{x222F}}}\,}\nolimits} \def\oiiint{\mathop{\vcenter{\mathchoice{\huge\unicode{x2230}\,}{\unicode{x2230}}{\unicode{x2230}}{\unicode{x2230}}}\,}\nolimits} \)



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*}