[Tex/LaTex] How to have centered equations on right case

casesmath-mode

Here is an example of what I want to achieve.

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.

Best Answer

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}

enter image description here

Related Question