Research
- Crime Categories
- Murder Circumstances
- Charges
- Murder Numbers by SHR
- Definitions of Murder
- Crime Literature
- Other Literature
- Seminars
- Journal Ranking
- Laws
- Changes in Law and Reporting in Michigan
- Citation Guides
- Datasets
Writing
Methods
- BLP
- Econometrics Models
- Econometrics Tests
- Econometrics Resources
- Event Study Plots
- Metrics Literature
- Machine Learning
Python-related
- Python Basic Commands
- Pandas Imports and Exports
- Pandas Basic Commands
- Plotting in Python
- Python web scraping sample page
- Two Sample t Test in Python
- Modeling in Python
R-related
- R Basics
- R Statistics Basics
- RStudio Basics
- R Graphics
- R Programming
- Accessing MySQL Databases from R
Latex-related
Stata-related
SQL
Github
Linux-related
Conda-related
AWS-related
Webscraping
Interview Prep
Other
LaTeX Equations
Table of Contents
- Multiline Parentheses/Brackets
- Parentheses that fit the line height
- Labeling Equations
- Bold Font in Math Mode
- Blackboard Bold Typeface
- Large bracket
Multiline Parentheses/Brackets
\usepackage{amsmath}
\begin{align}
V^*_i = X_i \beta_i &+ \varepsilon_{1, i}, Victim_i = 1(V^*_i > 0) \\
O^*_i = X_i \beta_i &+ \varepsilon_{2, i}, Offender_i = 1(O^*_i > 0) \\
\begin{pmatrix}
\varepsilon_1 \\
\varepsilon_2
\end{pmatrix} &\sim N \begin{bmatrix} \begin{pmatrix}
0 \\
0
\end{pmatrix}, \begin{pmatrix}
1 & \rho \\
\rho & 1
\end{pmatrix} \end{bmatrix}
\end{align}
Output is below:
Parentheses that fit the line height
Replace “(“ with “\left(“ and “)” with “\right)”
\begin{align}
(L-\alpha)x &= (x+\frac{L-\alpha}{B+D}x)^2 \\
(L-\alpha)x &= x^2\left(\frac{B+D+L-\alpha}{B+D}\right)^2
\end{align}
Labeling Equations
The format for creating LaTeX equations is usually \begin{equation}\end{equation}
. In order to label the equation, the common method is to write \label{eq:1}
and then later refer to it as ref{eq:1}
. See code below for an example:
Second derivative is:
\begin{align}
\frac{\partial ^2 A(a)}{\partial a^2} &= p_{aa} \delta F + p_a \delta F_a + p_a F_a + p F_{aa} + L_{aa} - p_{aa} L - p_a L_a - p_a L_a - p L_{aa} \\
&= p_{aa}(\delta F - L) + (1 + \delta)p_a F_a + p F_{aa} + (1 - p)L_{aa} - 2 p_a L_a \label{eq:1}
\end{align}
The label is not visible in text:
Reference to this equation would be:
Based on discussions after Equation \ref{eq:1}, $a_{\delta} < 0$.
The text will display as:
Bold Font in Math Mode
The \mathbf
command can only be used for non-italic math content, but the \bm
command from the package bm
provides a good alternative. It also helps with applying bold font to Greek letters. \boldsymbol{\beta}
gives us \(\boldsymbol{\beta}\). See details here.
Blackboard Bold Typeface
\usepackage{amsfonts}
\newcommand{\e}[1]{{\mathbb E} \left[ #1 \right]} % hollow E for expected value. ex. \e{something}
Large bracket
begin{cases}
\\
end{cases}