Index

Table of contents

latex

install

ubuntu
sudo apt-get install texlive texlive-base texlive-formats-extra

cli

create pdf from latex file
pdflatex [file]
convert to jpg (use imagemagic)
convert -density 600x600 test.pdf test.jpg

syntax

hello world
\documentclass[a4paper]{article}
\begin{document}
hello world
\end{document}

formatting

global option: no indentation on paragraphs
\usepackage{parskip}
header
\section{header text}       # numbered
\section*{header text}      # just the header text
change secion font size
\titleformat*{\section}{\huge\bfseries}
change body font size (listed from largest to smallest)
\Huge
\huge
\LARGE
\Large
\large
\normalsize
\small
\footnotesize
\scriptsize
\tiny
bold
\textbf{...}
italic
\textit{...}
underline
\underline{...}
overline
\overline{...}
blank line
\\
comment
% this is a comment line
page break
\newpage

symbols

multiply symbol x
\times
central dot ·
\cdot
plus minus ±
\pm
variations on equals sign not equal
\ne        ≠
\neq       ≠
\approx    ≈
\equiv     ≡
del ∂ (partial derivative)
\partial
infinity ∞
\infty
integral ∫
\int
\int_0^\pi
[cos(\theta)]_0^\pi
arrows (single line)
\leftarrow          ←
\rightarrow         →
\leftrightarrow     ↔
arrows (double line)
\Leftarrow
\Rightarrow
\Leftrightarrow
in
\in
degree symbol
\usepackage{gensymb}
\degree
number symbols
\usepackage{amssymb}
\mathbb{R}
\mathbb{N}
\mathbb{C}
greek
\delta  δ    \Delta  Δ
\lambda λ    \Lambda Λ
\theta  θ    \Theta  Θ
nabla (laplace)
\nabla
vector
\vec{v}
documentation
https://oeis.org/wiki/List_of_LaTeX_mathematical_symbols

math

inline math statement $...$
the formula is: $a = 2^3$
math equation with auto scaling $$...$$ (math environment) #
$$ \sqrt[n]{\frac{n^n}{n!}} $$
subscript
f_x
superscript
e^x
composite superscript
$e^{a-1}$
sqrt
\sqrt{x+1}
\sqrt[n]{x+1}     # nth root
fraction
\frac{dy}{dx}
documentation
https://www.overleaf.com/learn/latex/Mathematical_expressions
https://docutils.sourceforge.io/docs/ref/rst/mathematics.html

color

dark mode
\usepackage{color}
\usepackage{xcolor}
\pagecolor{black}
\color{lightgray}
custom RGB color
\definecolor{mycolor}{RGB}{219, 122, 50}
\color{mycolor}
documentation
https://www.overleaf.com/learn/latex/Using_colours_in_LaTeX#Setting_the_page_background_colour