5

I found this latex sample, close to what I need but fail to modify it like I need. I try to understand how to do, reading about eqparbox package but it doesn't help me more.

I want to make braces on several lines of left text (text 1,2,3,...) with explanations on the right side of the braces (explanation A, B). I would like to:

  • align braces
  • remove (1a, 1b, ...)

it only be text, no math or calculus.

here is the code:

\documentclass{article}
\usepackage{mathtools}
\usepackage{eqparbox}

\newcommand\EqMathBox[2][x]{% \eqparbox{#1}{$\displaystyle #2$}% }

\begin{document}

\begin{subequations} \begin{align} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% & \begin{rcases} \text{text 1} \ \text{text 2} \ \text{text 3} \ \end{rcases}% \quad\text{explenation A} && \ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% & \begin{rcases} \text{a longer text} \ \text{a quit more longer text} \ \end{rcases} \quad\text{explenation B} && %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \end{align} \end{subequations}

\end{document}

here is the origin of the sample

  • Welcome to TeX:SE. first question you not employ eqparbox (if you like to have braces at the same horizontal positions) , for second: just remove environment subequations. See link, which you provided, again. – Zarko Nov 29 '22 at 10:59

3 Answers3

7

See, if you are after the following :

\documentclass{article}
\usepackage{mathtools}

\usepackage{eqparbox} \newcommand{\eqmathbox}[2][l]{\eqmakebox[#1][l]{$\displaystyle#2$}}

\begin{document}

\begin{align} &\begin{rcases} \eqmathbox{\text{text 1}} \ \eqmathbox{\text{text 2}} \ \eqmathbox{\text{text 3}}
\end{rcases} && \text{three equations}\[1ex] &\begin{rcases} \eqmathbox{\text{a longer text}} \ \eqmathbox{\text{a quit more longer text}}
\end{rcases} && \text{two equations} \end{align}

\end{document}

enter image description here

Zarko
  • 296,517
6

Something iike this? (Note the absence of \eqmathbox wrappers.)

enter image description here

\documentclass{article}
\usepackage{mathtools}

\begin{document}

\begin{align} \begin{rcases} \text{text 1} \ \text{text 2} \ \text{text 3} \end{rcases}\ &\text{explanation A} \ \begin{rcases} \text{a longer text} \ \text{a quite a bit longer text} \end{rcases}\ &\text{explanation B} \end{align}

\end{document}

Mico
  • 506,678
3

In the solution below, the main environment array is used to add the right braces. Then inner tabular is to gather rows of text with eqpabox to make sure all right braces are right-aligned.

In order to apply \eqparbox to each row (cell) of tabular env., I load collcell along with array package and defined a custom column which adds a small macro: \pbox which in turn applies \eqparbox.

\documentclass{article}
\usepackage{array}
\usepackage{collcell}
\usepackage{eqparbox}

\newcommand\pbox[1]{\eqparbox{alist}{#1}} \newcolumntype{P}{>{\collectcell\pbox}l<{\endcollectcell}}

\begin{document} \bgroup \setlength\tabcolsep{0pt} \setlength\arraycolsep{0pt} \renewcommand\arraystretch{1.25} [ \begin{array}{l @{\quad} l} \left.\begin{tabular}{P} text 1\ text 2\ text 3\ text 4 \end{tabular}\right} & \textrm{explanation A} \ \left.\begin{tabular}{P} a longer text\ a quit more longer text\ ... even much much longer text \end{tabular}\right} & \textrm{explanation B} \end{array} ] \egroup \end{document}

enter image description here

Celdor
  • 9,058
  • I may be wrong here, but I thought the OP wanted to keep the 'equations' numbered -- but just not as 1a, 1b, etc. Let's see if the OP sees fit to provide some additional information on this issue. – Mico Nov 29 '22 at 12:39
  • It was slightly ambiguous whether OP wanted eq. numbers or this was just a side effect of using a wrong environment. I agree I could wait and see which version is correct. Thanks. – Celdor Nov 29 '22 at 13:57