Some useful commands for LaTex
NOTE: always use the $
(dollar) sign before and afer the expression when you are writing a mathematical expression in LaTex
\geq
-
$a^b$
is$a^b$ (exponents) -
$a_b$
is$a_b$ (subscript.. can be used to write chemical formulaes like$Ch_6$ -
\frac{first arg}{second arg}
is$\frac{first \space arg}{second \space arg}$ (fractions.. replace first arg and second arg by your expression) -
\neq
is$\neq$ (not equals to.. can be used when a != b) -
\int
is$\int$ ($\int$
) or Integral Sign -
\lambda
is$\lambda$ ($lambda
) or Lambda -
\infty
is$\infty$ or Infitnity -
\pi
is$\pi$ orpi
.. can be used to write the formula for circle's area($\pi r^2$ ) -
\sum
is$\sum$ or Sumation
-
\circ
is used to make a circle or degree symbol such as$180^{\circ}$ ($180^{\circ}$
) -
\square
is used to make a square.. like:$\square$ -
\space
is used to add spacing inside a mathematical expression..$\int(x) \space + 1$ ($\int(x) \space + 1$
) -
\rightarrow
is$\rightarrow$ (Right Arrow) -
\leftarrow
is$\leftarrow$ (Left Arrow)
NOTE: in order for colorization you must add package xcolor
\usepackage{xcolor}
The available colors are black, blue, brown, cyan, darkgray, gray, green, lightgray, lime, magenta, olive, orange, pink, purple, red, teal, violet, white, yellow
\color{your_color}This is a colored text\color{white} % white is the FG here
\usepackage {xcolor}
\color{red}This is a red text\color{white}
\color{orange}This is an orange text\color{white}
\color{yellow}This is a yellow text\color{white}
\color{green}This is a green text\color{white}
\color{blue}This is a blue text\color{white}
\color{purple}This is a purple text\color{white}
Your preamble is where you setup your LaTeX envioment and packages, often its imported from a spereate file called preamble.tex
using the \input{}
command.
Creating vectors in LaTeX can be a hassle, use the folloing macros to make the process faster. This code introduces two new commands \vec{}
and \pvec{}
, \vec{ab}
creates an arrow above your variable name like \pvec{}
creates a vector column such as \pvec{3 \\ 4 \\ 1}
Add the following code to your preamble after importing the amsmath
(the amarecan mathmatical assosiation math package)
% Vectors
\renewcommand{\vec}[1]{\overrightarrow{#1}}
% Custom command for display vectors using pmatrix, use \pvec{1 \\ 2 \\ 3}
\newcommand{\pvec}[1]{%
\begin{pmatrix}
#1
\end{pmatrix}%
}
On this README.md you may add an section or fix some mistakes