두 행 사이에 텍스트 위치 지정 및 \array 환경에 중괄호 하나 추가

두 행 사이에 텍스트 위치 지정 및 \array 환경에 중괄호 하나 추가

나는 마지막 열에 각 규칙의 이름을 추가하는 논리의 몇 가지 기본 규칙에 대한 테이블을 만들려고 합니다. 나는 이 모든 것을 환경에서 만들었습니다 array.

$$\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}
$$

나는 다음과 같은 최종 결과를 얻고 싶습니다.여기에 이미지 설명을 입력하세요

답변1

여기서는 환경이 최선의 선택 이라고 생각하지 않지만 array어쨌든 여기에는 패키지를 사용하는 옵션이 있습니다 multirow. \multirow{2}{*}{$\left.\hbox{\rule{0cm}{.45cm}}\right\}$ De Morgan's Laws}아래 코드와 같이 2행 셀을 추가했습니다 . 환경 array은 일반적으로 너무 조밀하므로 더 쉽게 읽을 수 있도록 \renewcommand{\arraystretch}{1.2}배열 앞에 로컬로 추가할 수 있습니다.

\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}

여기에 이미지 설명을 입력하세요

답변2

\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}

여기에 이미지 설명을 입력하세요

답변3

다음은 깨지지 않는 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}

구조의 수평 정렬은 상자를 사용하여 이루어집니다. 왼쪽 섹션은 \leftbox(을 통해 너비가 설정된 \setleftbox) 내에 설정되고 오른쪽 섹션은 \rightbox(유사한 이름 \setrightbox) 내에 설정됩니다.

표기법 은 높이/깊이가 0인 De Morgan's Law낮은 스택(2행)입니다 .array

관련 정보