System of equations explanation

System of equations explanation

I want to make an explanation to solve a simple system of equation below, with alignment at =. Can you please show me how? Thanks.

enter image description here

답변1

Probably an overkill, but allowing you to adjust things like distances, line widths etc. rather easily:

\documentclass{article}
\usepackage{amsmath}
\usepackage{tikz}
\usetikzlibrary{decorations.pathreplacing}
\newcommand{\tikznode}[2]{\tikz[remember picture,baseline=(#1.base)]{\node(#1)[inner sep=0pt]{#2};}}
\begin{document}
\begin{align*}
 \tikznode{1}{\strut}x+y&=7\\
 \tikznode{2}{\strut}x-y&=3\\[2pt]
 \tikznode{3}{\strut}2x&=10\tikznode{4}{\strut}
\end{align*}
\begin{tikzpicture}[remember picture,overlay]
\draw[thick,decorate,decoration={brace},transform canvas={xshift=-2pt}] (2.south)-- (1.north);
\draw[,transform canvas={yshift=1pt}](4.north)--(3.north)--++(-1cm,0);
\end{tikzpicture}
\end{document}

enter image description here

답변2

With some care about automatically added spaces:

\documentclass{article}
\usepackage{amsmath,booktabs}

\begin{document}

\begin{equation*}
\begin{array}{r}
\left\{
\begin{array}{@{}r@{}}
x+y=7\hphantom{0}\\[1ex]
x-y=3\hphantom{0}
\end{array}
\right.\kern-\nulldelimiterspace
\\ \midrule
2x=10
\end{array}
\end{equation*}

\end{document}

enter image description here

관련 정보