# Positioning text between two rows and adding one curly brace in the \array environment

I'm trying to make a table for some basic rules in logic, where I add each rule's name in the last column. I made all of this in the array environment:

$$\begin{array}{lcccl} \mathrm{(a)} & \mathrm{P} & \mathrm{and} & \lnot(\lnot \mathrm{P}) & (\textit{Double Negation Law}) \\ \mathrm{(b)} & \mathrm{P} \lor \mathrm{Q} & \mathrm{and} & \mathrm{Q}\lor \mathrm{P} & \\ \mathrm{(c)} & \mathrm{P} \land \mathrm{Q} & \mathrm{and} & \mathrm{Q}\land \mathrm{P} & \\ \mathrm{(d)} & \mathrm{P}\lor (\mathrm{Q}\lor R) & \mathrm{and} & (\mathrm{P}\lor \mathrm{Q})\lor R & \\ \mathrm{(e)} & \mathrm{P}\land (\mathrm{Q}\land R) & \mathrm{and} & (\mathrm{P}\land \mathrm{Q})\land R &\\ \mathrm{(f)} & \mathrm{P}\land(\mathrm{Q}\lor R) & \mathrm{and} & (\mathrm{P}\land \mathrm{Q})\lor(\mathrm{P}\land R) &\\ \mathrm{(g)} & \mathrm{P}\lor(\mathrm{Q}\land R) & \mathrm{and} & (\mathrm{P}\lor \mathrm{Q})\land(\mathrm{P}\lor R) & \\ \mathrm{(h)} & \lnot(\mathrm{P}\land \mathrm{Q}) & \mathrm{and} & \lnot \mathrm{P}\lor\lnot \mathrm{Q} & \\ \mathrm{(i)} & \lnot(\mathrm{P}\lor \mathrm{Q}) & \mathrm{and} & \lnot \mathrm{P}\land\lnot \mathrm{Q} & \\ \end{array}$$


I would like to get as an end result something like this:

-
– Werner Feb 24 at 21:56

I don't think that the array environment is the best choice here, but any ways, here is an option using the multirow package. I just add a two-row cell \multirow{2}{*}{$\left.\hbox{\rule{0cm}{.45cm}}\right\}$ De Morgan's Laws} as in the code below. The array environment is usually too dense, so, to make it more readable you can add \renewcommand{\arraystretch}{1.2} locally before the array.

\documentclass{article}
\usepackage{amsmath}
\usepackage{multirow}
\begin{document}

\begin{equation*}
\renewcommand{\arraystretch}{1.2}
\begin{array}{lcccl}
\mathrm{(a)} & \mathrm{P}                  & \mathrm{and} & \lnot(\lnot \mathrm{P})           & (\textit{Double Negation Law}) \\
\mathrm{(b)} & \mathrm{P} \lor \mathrm{Q}           & \mathrm{and} & \mathrm{Q}\lor \mathrm{P}                  & \\
\mathrm{(c)} & \mathrm{P} \land \mathrm{Q}          & \mathrm{and} & \mathrm{Q}\land \mathrm{P}                 & \\
\mathrm{(d)} & \mathrm{P}\lor (\mathrm{Q}\lor R)    & \mathrm{and} & (\mathrm{P}\lor \mathrm{Q})\lor R          & \\
\mathrm{(e)} & \mathrm{P}\land (\mathrm{Q}\land R)  & \mathrm{and} & (\mathrm{P}\land \mathrm{Q})\land R        &\\
\mathrm{(f)} & \mathrm{P}\land(\mathrm{Q}\lor R)    & \mathrm{and} & (\mathrm{P}\land \mathrm{Q})\lor(\mathrm{P}\land R) &\\
\mathrm{(g)} & \mathrm{P}\lor(\mathrm{Q}\land R)    & \mathrm{and} & (\mathrm{P}\lor \mathrm{Q})\land(\mathrm{P}\lor R)  & \\
\mathrm{(h)} & \lnot(\mathrm{P}\land \mathrm{Q})    & \mathrm{and} & \lnot \mathrm{P}\lor\lnot \mathrm{Q}       &\multirow{2}{*}{$\left.\hbox{\rule{0cm}{.45cm}}\right\}$ De Morgan's Laws} \\
\mathrm{(i)} & \lnot(\mathrm{P}\lor \mathrm{Q})     & \mathrm{and} & \lnot \mathrm{P}\land\lnot \mathrm{Q}      & \\
\end{array}
\end{equation*}

\end{document}


-
Thanks for your help! – Workaholic Feb 24 at 21:27
\documentclass[10pt]{article}
\usepackage{amsmath}
\begin{document}

$\begin{array}{lcccl} \mathrm{(a)} & \mathrm{P} & \mathrm{and} & \lnot(\lnot \mathrm{P}) & (\textit{Double Negation Law}) \\ \mathrm{(b)} & \mathrm{P} \lor \mathrm{Q} & \mathrm{and} & \mathrm{Q}\lor \mathrm{P} & \\ \mathrm{(c)} & \mathrm{P} \land \mathrm{Q} & \mathrm{and} & \mathrm{Q}\land \mathrm{P} & \\ \mathrm{(d)} & \mathrm{P}\lor (\mathrm{Q}\lor R) & \mathrm{and} & (\mathrm{P}\lor \mathrm{Q})\lor R & \\ \mathrm{(e)} & \mathrm{P}\land (\mathrm{Q}\land R) & \mathrm{and} & (\mathrm{P}\land \mathrm{Q})\land R &\\ \mathrm{(f)} & \mathrm{P}\land(\mathrm{Q}\lor R) & \mathrm{and} & (\mathrm{P}\land \mathrm{Q})\lor(\mathrm{P}\land R) &\\ \mathrm{(g)} & \mathrm{P}\lor(\mathrm{Q}\land R) & \mathrm{and} & (\mathrm{P}\lor \mathrm{Q})\land(\mathrm{P}\lor R) & \\ \mathrm{(h)} & \lnot(\mathrm{P}\land \mathrm{Q}) & \mathrm{and} & \lnot \mathrm{P}\lor\lnot \mathrm{Q} & \makebox(0,0){\put(0,-20){% \left.\rule{0pt}{1.06\normalbaselineskip}\right\}\text{De Morgan's laws}}}\\ \mathrm{(i)} & \lnot(\mathrm{P}\lor \mathrm{Q}) & \mathrm{and} & \lnot \mathrm{P}\land\lnot \mathrm{Q} & \end{array}$

\end{document}


-
Thanks for your answer! I accepted Abo Ammar's one since it solves the little spacing problem. – Workaholic Feb 24 at 21:43

Here is one option that provide an actual list (rather than unbreakable block/array):

\documentclass{article}

\usepackage{enumitem}

\newlength{\leftboxlen}
\newcommand{\setleftbox}[1]{\settowidth{\leftboxlen}{#1}}
\newcommand{\leftbox}[2][c]{\makebox[\leftboxlen][#1]{#2}}
\newlength{\rightboxlen}
\newcommand{\setrightbox}[1]{\settowidth{\rightboxlen}{#1}}
\newcommand{\rightbox}[2][c]{\makebox[\rightboxlen][#1]{#2}}

\begin{document}

\noindent\textbf{Theorem 1.6.}
\setleftbox{$\mathrm{P} \land (\mathrm{Q} \land R)$}%
\setrightbox{$(\mathrm{P} \land \mathrm{Q}) \lor (\mathrm{P} \land R)$}%
\begin{enumerate}[label=(\alph*),nosep]
\item \leftbox{$\mathrm{P}$} and \rightbox{$\lnot(\lnot \mathrm{P})$} \qquad (\textit{Double Negation Law})
\item \leftbox{$\mathrm{P} \lor \mathrm{Q}$} and \rightbox{$\mathrm{Q} \lor \mathrm{P}$}
\item \leftbox{$\mathrm{P} \land \mathrm{Q}$} and \rightbox{$\mathrm{Q} \land \mathrm{P}$}
\item \leftbox{$\mathrm{P} \lor (\mathrm{Q} \lor R)$} and \rightbox{$(\mathrm{P} \lor \mathrm{Q}) \lor R$}
\item \leftbox{$\mathrm{P} \land (\mathrm{Q} \land R)$} and \rightbox{$(\mathrm{P} \land \mathrm{Q}) \land R$}
\item \leftbox{$\mathrm{P} \land(\mathrm{Q} \lor R)$} and \rightbox{$(\mathrm{P} \land \mathrm{Q}) \lor (\mathrm{P} \land R)$}
\item \leftbox{$\mathrm{P} \lor (\mathrm{Q} \land R)$} and \rightbox{$(\mathrm{P} \lor \mathrm{Q}) \land (\mathrm{P} \lor R)$}
\item \leftbox{$\lnot (\mathrm{P} \land \mathrm{Q})$} and \rightbox{$\lnot \mathrm{P} \lor \lnot \mathrm{Q}$} \qquad
\raisebox{-.45\height}[0pt][0pt]{$\left.\kern-\nulldelimiterspace\begin{array}{@{}c@{}} \mathstrut \\ \mathstrut \end{array}\right\} \mbox{(\textit{De Morgan's Law})}$}
\item \leftbox{$\lnot(\mathrm{P} \lor \mathrm{Q})$} and \rightbox{$\lnot \mathrm{P} \land \lnot \mathrm{Q}$}
\end{enumerate}

\end{document}


Horizontal alignment of the structure is achieved using boxes. The left section is set within \leftbox (which has a width set through \setleftbox), while the right section is set within \rightbox (and a similarly names \setrightbox).

The De Morgan's Law notation is a lowered stack (2-row array) with zero height/depth.

-