unerline을 사용하여 열에 정렬된 텍스트 그룹을 만드는 방법은 무엇입니까?

unerline을 사용하여 열에 정렬된 텍스트 그룹을 만드는 방법은 무엇입니까?

여기에 이미지 설명을 입력하세요
위와 같이 unerlines를 사용하여 열에 텍스트를 정렬하고 싶습니다. 만들려면 어떤 코드를 사용해야 하나요?

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

답변1

출발점:

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

이는 다음과 같은 결과를 낳습니다:

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

답변2

테이블 형식 환경을 사용할 수 있습니다.

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

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

관련 정보