How To Write Mathematical Equations, Expressions, and Symbols with LaTeX: A cheatsheet.
1 What is LaTeX?
LaTeX is a programming language that can be used for writing and typesetting documents. It is especially useful to write mathematical notation such as equations and formulae.
2 How to use LaTeX to write mathematical notation
There are three ways to enter “math mode” and present a mathematical expression in LaTeX:
- inline (in the middle of a text line)
- as an equation, on a separate dedicated line
- as a full-sized inline expression (displaystyle)
2.1 inline
Inline expressions occur in the middle of a sentence. To produce an inline expression, place the math expression between dollar signs (
$
). For example, typing $E=mc^2$
yields . 2.2 equation
Equations are mathematical expressions that are given their own line and are centered on the page. These are usually used for important equations that deserve to be showcased on their own line or for large equations that cannot fit inline. To produce an inline expression, place the mathematical expression between the symbols
\[
and \]
. Typing \[x=\frac{-b\pm\sqrt{b^2-4ac}}{2a}\]
yields (1)2.3 displaystyle
To get full-sized inline mathematical expressions use
\displaystyle
. Typing I want this $\displaystyle \sum_{n=1}^{\infty}
\frac{1}{n}$, not this $\sum_{n=1}^{\infty}
\frac{1}{n}$.
yields: I want this , not this 3 Symbols (in math mode)
3.1 The basics
As discussed above math mode in LaTeX happens inside the dollar signs (
$...$
), inside the square brackets \[...\]
and inside equation
and displaystyle
environments. Here’s a cheatsheet showing what is possible in a math environment:description | command | output |
addition | + | |
subtraction | - | |
plus or minus | \pm | |
multiplication (times) | \times | |
multiplication (dot) | \cdot | |
division symbol | \div | |
division (slash) | / | |
simple text | \text{text} | |
infinity | \infty | |
dots | 1,2,3,\ldots | |
dots | 1+2+3+\cdots | |
fraction | \frac{a}{b} | |
square root | \sqrt{x} | |
th root | \sqrt[n]{x} | |
exponentiation | a^b | |
subscript | a_b | |
absolute value | |x| | |
natural log | \ln(x) | |
logarithms | \log_{a}b | |
exponential function | e^x=\exp(x) | |
deg | \deg(f) | |
degree | \degree | |
arcmin | ^\prime | |
arcsec | ^{\prime\prime} | |
circle plus | \oplus | |
circle times | \otimes | |
equal | = | |
not equal | \ne | |
less than | < | |
less than or equal to | \le | |
greater than or equal to | \ge | |
approximately equal to | \approx |
3.2 Functions
description | command | output |
maps to | \to | |
composition | \circ |
3.3 Greek and Hebrew letters
command | output | command | output |
\alpha | \tau | ||
\beta | \theta | ||
\chi | \upsilon | ||
\delta | \xi | ||
\epsilon | \zeta | ||
\varepsilon | \Delta | ||
\eta | \Gamma | ||
\gamma | \Lambda | ||
\iota | \Omega | ||
\kappa | \Phi | ||
\lambda | \Pi | ||
\mu | \Psi | ||
\nu | \Sigma | ||
\omega | \Theta | ||
\phi | \Upsilon | ||
\varphi | \Xi | ||
\pi | \aleph | ||
\psi | \beth | ||
\rho | \daleth | ||
\sigma | \gimel |
3.4 Vectors
description | command | output |
vector | \vec{v} | |
vector | \mathbf{v} | |
norm | ||\vec{v}|| |
3.5 Set theory
description | command | output |
set brackets | \{1,2,3\} | |
element of | \in | |
subset of | \subset | |
subset of | \subseteq | |
contains | \supset | |
contains | \supseteq | |
union | \cup | |
intersection | \cap | |
big union | \bigcup_{n=1}^{10}A_n | |
big intersection | \bigcap_{n=1}^{10}A_n | |
empty set | \emptyset | |
power set | \mathcal{P} | |
minimum | \min | |
maximum | \max | |
supremum | \sup | |
infimum | \inf | |
limit superior | \limsup | |
limit inferior | \liminf | |
closure | \overline{A} |
3.6 Logic
description | command | output |
not | \sim | |
and | \land | |
or | \lor | |
if...then | \to | |
if and only if | \leftrightarrow | |
logical equivalence | \equiv | |
therefore | \therefore | |
there exists | \exists | |
for all | \forall | |
implies | \Rightarrow | |
equivalent | \Leftrightarrow |
3.7 Calculus
description | command | output |
derivative | \frac{df}{dx} | |
derivative | \f' | |
partial derivative | \frac{\partial f} {\partial x} | |
limits | \lim_{x\to \infty} | |
summation | \sum_{n=1}^{\infty}a_n | |
product | \prod_{n=1}^{\infty}a_n | |
integral | \int | |
double integral | \iint | |
triple integral | \iiint |
3.8 Number theory
description | command | output |
divides | | | |
does not divide | \not | | |
greatest common divisor | \gcd | |
ceiling | \lceil x \rceil | |
floor | \lfloor x \rfloor |
3.9 Geometry and trigonometry
description | command | output |
angle | \angle ABC | |
degree | 90^{\circ} | |
triangle | \triangle ABC | |
segment | \overline{AB} | |
sine | \sin | |
cosine | \cos | |
tangent | \tan | |
cotangent | \cot | |
secant | \sec | |
cosecant | \csc | |
inverse sine | \arcsin | |
inverse cosine | \arccos | |
inverse tangent | \arctan |
4 Symbols (in text mode)
The followign symbols do not have to be surrounded by dollar signs.
description | command | output |
dollar sign | \$ | $ |
percent | \% | % |
ampersand | \& | & |
pound | \# | # |
backslash | \textbackslash | \ |
left quote marks | `` | “ right quote marks & '' & ” |
single left quote | ` | ‘ single right quote & ' & ’ |
hyphen | X-ray | X-ray |
en-dash | pp. 5--15 | pp. 5–15 |
em-dash | Yes---or no? | Yes—or no? |
5 Writing LaTeX notation in Authorea
Authorea supports LaTeX writing, but you don’t have to know LaTeX to use Authorea! In order to insert LaTeX in an Authorea document:
- Click on the Insert button in the toolbar and then select LaTeX from the dropdown.
Here are some tips for writing LaTeX in Authorea:
- Click anywhere outside of the LaTeX block to render it.
- Hover on Preview to see a Preview of the rendered content.
- Do not paste an entire LaTeX article! Instead import documents from your homepage.
- Only type LaTeX content in a LaTeX block, i.e. everything you would write after
\begin{document}
. - Do not type preamble (e.g. documentclass), frontmatter, macros or figures.
- To add macros (newcommands) and packages, click Settings Edit Macros
- Use the Insert Figure button to insert images (and data).
- Use math mode for equations, e.g. .
- Try the citation tool (click cite) to find and add citations, or use
\cite{}
. - To insert more LaTeX blocks click Insert LaTeX.
- You can use sectioning commands like
\section{},\subsection{},\subsubsection{}
to add headings.1
6 Further reading
Interested in finding out more about LaTeX? Check out these examples of how LaTeX can be used to write mathematical equations, and follow these instructions to create powerful documents in LaTeX on Authorea, beyond mathematics.
Không có nhận xét nào:
Đăng nhận xét