Como fazer grupos de textos alinhados em colunas com sublinhado?

Como fazer grupos de textos alinhados em colunas com sublinhado?

insira a descrição da imagem aqui
Quero fazer os textos alinhados em colunas com sublinhados como acima. Qual código devo usar para fazer isso?

\documentclass{article}  
\begin{document}  
%what should I add?  
\end{document}

Responder1

Como ponto de partida:

\documentclass{standalone}

\usepackage{mathtools,array,booktabs}
\mathtoolsset{showonlyrefs}

\newcolumntype{D}{>{$}r<{$}} % Description
\newcolumntype{E}{D<{={}}@{}D} % Equation

\begin{document}
\begin{tabular}{DEDE}
  4 \cdot [\text{equation 3}] & 4x_3 & -4                  & -1 \cdot [\text{equation 3}] & -x_3 & 1 \\
  {}+ [\text{equation 2}]     & x_2 - 4x_3 & 4             & {}+ [\text{equation 1}]      & x_1 - 2x_2 + x_3 & 0 \\
  \cmidrule(lr){1-1}            \cmidrule(lr){2-3}           \cmidrule(lr){4-4}             \cmidrule(lr){5-6}
  [\text{new equation 2}]     & x_2 \hphantom{{}-4x_3} & 0 & [\text{new equation 1}]      & x_1 - 2x_2 \hphantom{{}+x_3} & 0
\end{tabular}
\end{document}

O que leva a:

insira a descrição da imagem aqui

Responder2

Você pode usar o ambiente tabular:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[frenchb]{babel}
\usepackage{array}
\usepackage[margin={1cm,1cm}]{geometry}

\begin{document}

\begin{tabular}{@{}r@{}}
  4.[equation3] \\
  + [equation2] \\
   \hline
   [new equation2]\\
\end{tabular}
\hfill
\begin{tabular}{@{}rcr@{=}r@{}}
        &     & $4x_3$ & $-4$ \\
  $x_2$ & $-$ & $4x_3$ & $4$  \\
   \hline
  $x_2$ &     &        & 0    \\
\end{tabular}    
\hfill
\begin{tabular}{@{}r@{}}
  -1.[equation3] \\
  + [equation1] \\
   \hline
   [new equation1]\\
\end{tabular}    
\hfill
\begin{tabular}{@{}rrrrr@{=}r@{}}
        &   &        &   & $-x_3$ & $1$ \\
  $x_1$ & - & $2x_2$ & + & $x_3$  & $0$ \\
   \hline
  $x_1$ & - & $2x_2$ &   &        & $1$ \\
\end{tabular}    
\end{document}

insira a descrição da imagem aqui

informação relacionada