
라텍스에서 역치환 상부 삼각 시스템을 작성하려고 합니다.
형식은 다음과 같습니다
코드를 작성하려고 하는데 제대로 작동하지 않습니다.
\begin{equation*}
\begin{split}
&a_{1,1}x_{1} + a_{1,2}x_{2} +\;.....+ a_{1},{n}X_{n} = b_{1}\\
& a_{2,2}x_{2} +\;.....+a_{2},{n}X_{n} = b_{2}\\
\end{split}
\end{equation*}
&
내 프로젝트의 다른 코드를 사용해 보니 무엇이 잘못되었는지 도와주세요 . 왜 여기서 제대로 작동하지 않습니까? :(
답변1
기반 솔루션 array
:
\documentclass{article}
\usepackage{amsmath,array}
\begin{document}
\begin{equation*}
\setlength{\arraycolsep}{0pt}% so we don't need too many @{}
\newcommand{\LD}{\ldots}%
\newcommand{\DF}[1]{\multicolumn{#1}{c}{\dotfill}}%
\newcommand{\DD}{\multicolumn{2}{r}{\ddots}}%
\newcommand{\VD}{\multicolumn{1}{c}{\vdots}}%
\begin{array}{*{5}{r>{{}}c<{{}}}l}
a_{1,1}x_1 &+& a_{1,2}x_2 &+& \DF{3} &+& a_{1,n}x_n &=& b_1 \\[1ex]
& & a_{2,2}x_2 &+& \DF{3} &+& a_{2,n}x_n &=& b_2 \\
& & \DD & & & && \VD & & \VD \\
& & & & a_{i,i}x_i &+& \LD &+& a_{i,n}x_n &=& b_i \\
& & & & \DD & && \VD & & \VD \\
& & & & && & & a_{n,n}x_n &=& b_n
\end{array}
\end{equation*}
\end{document}
답변2
다음은 array
기반 솔루션입니다.
\documentclass{article}
\usepackage{newtxtext,newtxmath} % Times Roman clone - optional
\usepackage{array} % for '\newcolumntype' macro
\newcolumntype{C}{>{{}}c<{{}}} % col. type for bin. and rel. operators
\newcommand\myddots{\multicolumn{1}{r}{\ddots}} % handy shortcut macro
\begin{document}
\[
\setlength\arraycolsep{0pt}
\begin{array}{*{5}{cC}c}
a_{1,1}x_1 &+& a_{1,2}x_2 &+& \multicolumn{3}{c}{\dotfill} &+& a_{1,n}x_n &=& b_1 \\
&& a_{2,2}x_2 &+& \multicolumn{3}{c}{\dotfill} &+& a_{2,n}x_n &=& b_2 \\
&& \myddots && && \phantom{a_{i,n}x_n} && \vdots && \vdots\\
&&&& a_{i,i}x_i &+& \dotfill &+& a_{i,n}x_n &=& b_i \\
&&&& \myddots &&&& \vdots && \vdots\\
&&&&&&&& a_{n,n}x_n &=& b_n
\end{array}
\]
\end{document}
답변3
알았어 해결책을 찾았어
\[
\begin{array}{@{}*{7}{c@{}}}
& a_{1,1}x_{1} + a_{1,2}x_{2} +\;.....+ a_{1},{n}X_{n} = b_{1}\\
& a_{2,2}x_{2} +\;.....+a_{2},{n}X_{n} = b_{2}\\
\end{array}
\]
답변4
alignedat
다음을 사용하는 기반 솔루션 eqparbox
:
\documentclass{article}
\usepackage{mathtools}
\usepackage{eqparbox}
\begin{document}
\begin{equation*}
\begin{alignedat}{2}
a_{1,1}x_{1} + a_{1,2}x_{2} & +{}&\cdots\cdots \cdots \cdots + a_{1,n}X_{n} & = b_{1}\\
a_{2,2}x_{2} & +{} &\cdots\cdots \cdots\cdots +a_{2,n}X_{n} & = b_{2}\\[-1.5ex]
&\ddots && \vdotswithin{=}\\[-1ex]
& & a_{i, i}x_{i}\eqparbox{M}{${} + \dots + a_{i, n}X_{n} $} & = b_{i} \\[-1.5ex]
& &\eqparbox{M}{\raisebox{1ex}{$\ddots $}} & \vdotswithin{=}\\[-2ex]
& & a_{n, n}X_{n} & =b_{n}
\end{alignedat}
\end{equation*}
\end{document}