8

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.

  • 1
    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
1

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

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

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

enter image description here

2

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}

enter image description here

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

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}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.