Skip to content

Instantly share code, notes, and snippets.

@atuanpham
Last active May 19, 2018 05:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save atuanpham/33bb80378610aaf9fa6eac4290dced30 to your computer and use it in GitHub Desktop.
Save atuanpham/33bb80378610aaf9fa6eac4290dced30 to your computer and use it in GitHub Desktop.
Centering Equations
---
title: "centering equations"
output:
pdf_document: default
classoption: fleqn
header-includes:
- \setlength{\mathindent}{0pt}
- \setlength{\parindent}{0pt}
---
This is some text
This is the equation I would like left aligned:
\[
h(t_{ij}) = Pr[ T_i = j| T_i \geq j |
\]
This is the equation I would like centred:
\[
\makebox[\linewidth]{$h(t_{ij}) = Pr[ T_i = j| T_i \geq j |$}
\]
\noindent
\makebox[\linewidth]{centered text}
This is a set of equations to align centred:
\[
\makebox[\linewidth]{$\displaystyle
\begin{aligned}
f(x) &= ax^2 + bx + c \\
ax^2 + bx + c &= g(x)
\end{aligned}
$}
\]
From: https://tex.stackexchange.com/a/390656
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment