Back to Teaching Page

LaTeX Software


Alignat

\begin{alignat*}{3}
 u&=x          &\quad &\implies &\quad du&=dx,\\
dv&=4e^{-4x}dx &      &\implies &       v&=-e^{-4x}
\end{alignat*}

Multi columns

\usepackage{multicol}
\begin{multicols}{2}
\begin{enumerate}
    \item a
    \item b
    \item c
    \item d
\end{enumerate}
\end{multicols}

Enumitem - Change space in listing globally

\usepackage{enumitem}
\setlist[enumerate]{itemsep=1pt, topsep=1pt}
\setlist[itemize]{label={\small\textbullet}, itemsep=0pt, topsep=0pt}

Custom Names for Equations

\begin{equation}\label{zzz}\tag{P1}
c^2 = a^2 + b^2
\end{equation}

Split-level Fractions

\usepackage{xfrac}
$\sfrac{12}{3}$

Tcolorbox

\usepackage{tcolorbox}
\begin{tcolorbox}[
    boxrule = 0.5pt, colback = green!10!white,
    grow to left by = -1in, grow to right by = -1in,
    enlarge top by = 0.1in, enlarge bottom by = 0.1in]
    $c^2=a^2+b^2$
\end{tcolorbox}

Long arrows

\usepackage{extarrows}
$\xLeftarrow[\text{bottom}]{\text{top}}$
$\xleftarrow[\text{bottom}]{}$
$\xRightarrow{\text{top}}$
$\xrightarrow{\text{top}}$
$A\xlongequal{\text{by ZZZ’s Theorem}} B$ 

Align (right) in matrices

\begin{pmatrix*}[r]
     1 & -2\\
    -1 & 3
\end{pmatrix*}

Spacing in arrays

\[\arraycolsep = 10pt
\def\arraystretch{2.2}
\begin{array}{c|c}
    a & b\\
    c & d
\end{array}\]

Title Spacing

\usepackage{titlesec}
\titlespacing*{\section}{0pt}{4ex plus .2ex minus .1ex}{3ex plus .2ex}
\titlespacing*{\subsection}{0pt}{3ex plus .2ex minus .1ex}{2ex plus .2ex}

Tikz - Stealth Arrows

\usepackage{arrows.meta}
\begin{tikzpicture}
\draw [-stealth] (0,0) -- (3,0);
\draw [stealth-] (0,-1) -- (3,-1);
\draw [-{Stealth[width=3mm,length=5mm]}] (0,-2) -- (3,-2);
\end{tikzpicture}

Tikz - Arcs and Ellipses

\begin{tikzpicture}
\draw (0.7,0.7) arc (45:135:1);
\draw (2,0) arc (0:-180:2 and 1);
\draw (0,0) ellipse (2 and 3);
\end{tikzpicture}

Tikz - Draw with Patterns

[More]
\usetikzlibrary{patterns, patterns.meta}
\begin{tikzpicture}
\draw[green, pattern color = green, pattern = north east lines] 
    (0,0)--(1,0)--(1,2)--(0,2)--(0,0);
\draw[red, pattern = {Lines[angle=135, distance=5pt]}, pattern color = red]
    (0,0)--(2,0)--(2,1)--(0,1)--(0,0);
\end{tikzpicture}

Tikz - Parametrized Curves

\begin{tikzpicture}
\draw [help lines] (-1,-1) grid (1,2);
\draw [blue, thick, domain=-1:0, samples=20] plot ({\x}, {1/2*((\x-1)^2-1)} );
\draw [blue, thick, domain=0:0.7, samples=20] plot ({\x}, {(\x+1)^2-1} );
\end{tikzpicture}