# How do I have centered equations on right case?

Here is an example of what I want to achieve. I have tried below but the equations won't center automatically.

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{gather*}
\begin{rcases}
p \\
p \rightarrow r \\
q \rightarrow \neg r
\end{rcases}
\end{gather*}
\end{document}


I want automatic centering.

• Welcome to TeX.SX! Please help us to help you and add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}.
– user31729
Jan 25 '15 at 9:47

## 4 Answers

The use of the array environment in your equation or inline math would be the easiest solution I suppose. It also doesn't really require a gather*or gatheredenvironment:

\documentclass{article}
\begin{document}
$\left. \begin{array}{c} p \\ p \rightarrow r \\ q \rightarrow \neg r \\ \end{array} \right\} \Rightarrow \neg q$
\end{document}


• There is a difference between using array and gathered: with the latter, \displaystyle is used for every line. Jan 25 '15 at 20:44

You can use the gathered environment inside equation.

MWE

\documentclass{article}
\usepackage{mathtools}

\begin{document}
\begin{equation*}
\left.
\begin{gathered}
p \\
p \rightarrow r \\
q \rightarrow \neg r
\end{gathered}
\right\rbrace
\quad\Rightarrow\quad\neg q
\end{equation*}
\end{document}


Output

You can revert to a classical array environment.

\documentclass[12pt]{scrartcl}
\usepackage{mathtools}
\begin{document}
\begin{gather*}
\left.
\begin{array}{c}
p \\
p \rightarrow r \\
q \rightarrow \neg r
\end{array}
\right\rbrace
\end{gather*}
\end{document}


• Never use gather* as a substitute for equation*. Jan 25 '15 at 20:44

Very straightforward with a stack.

\documentclass{article}
\usepackage{amsmath}
\usepackage[usestackEOL]{stackengine}
\stackMath
\begin{document}
\begin{equation*}
\left.\Centerstack{
p \\
p \rightarrow r \\
q \rightarrow \neg r
}\right\}
\Rightarrow \neg q
\end{equation*}
\end{document}