
Tento escrever o sistema triangular superior de substituição para trás em látex
o formato fica assim
Tento escrever o código mas não funciona corretamente
\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*}
por favor me ajude o que está errado. Eu tento &
em outro código no meu projeto e funciona. Por que aqui não funciona corretamente? :(
Responder1
Uma array
solução baseada:
\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}
Responder2
Aqui está uma array
solução baseada em:
\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}
Responder3
ok, encontrei a solução
\[
\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}
\]
Responder4
Uma alignedat
solução baseada em , com a ajuda de 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}