I have already asked this question: Define an environment similar to align such that it can be used in tabularx or tabular.
Zarko's answer to that question (https://tex.stackexchange.com/a/693393/277990) includes an Addendum whose code gives exactly the output I want for situations in which there is only one group of successive statements whose '=' symbols are horizontally aligned.
I would like to allow for situations in which there is more than one such group. Please see my remarks in the following code:
\documentclass{article}
\usepackage{tabularx}
\begin{document}
% The code given in the Addendum to Zarko's answer:
\begin{tabularx}{250pt}{r l @{;} >{$\raggedright}X<{$} l}
- & \multicolumn{2}{l}{Math}
& Words \
- & m & = 9/3 & Words \
- & & = 3 & Words \
\end{tabularx}
\vspace{1cm}
The above code is succcessful.
However, it cannot cope with situations in which
there are two or more different groups of successive statements
requiring separate horizontal alignments of = symbols.
For example, look what happens to the output if we keep going
(e.g. if we add lines 4 and 5 to the above):
\vspace{1cm}
\begin{tabularx}{250pt}{r l @{;} >{$\raggedright}X<{$} l}
- & \multicolumn{2}{l}{Math}
& Words \
- & m & = 9/3 & Words \
- & & = 3 & Words \
- & 34x+2 & = 30/2 & Words \
- & & = 15 & Words \
\end{tabularx}
\vspace{1cm}
We see that the horizontal alignment of all four =' symbols is determined by the=' symbol in line 4,
whereas what we want is for the =' symbol in line 3 to be aligned with the=' symbol in line 2
and for the =' symbol in line 5 to be aligned with the=' symbol in line 4.
In other words, we want to eliminate
the space between m' and= 9/3',
and then align the =' symbol in line 3 directly below the=' symbol in line 2.
\end{document}
