I am trying to write a few systems of equations, and I want the terms to be nicely spaced as below
2x + y + 3z = 10 \\
x + y + z = 6 \\
x + 3y + 2z = 13
Now, using some very ugly code, I was able to produce the results above.
\documentclass[10pt,a4paper]{article}
\usepackage{mathtools}
\usepackage{amsmath}
\begin{document}
\begin{align*}
\begin{bmatrix}
\begin{tabular}{r c r c r c r }
$2x$ & $+$ & $ y$ & $+$ & $3z$ & $=$ & $10$ \\
$ x$ & $+$ & $ y$ & $+$ & $ z$ & $=$ & $ 6$ \\
$ x$ & $+$ & $3y$ & $+$ & $2z$ & $=$ & $13$
\end{tabular}
\end{bmatrix}
\end{align*}
\section{Another system of equations, now without the brackets}
\begin{table}[!htpb]
\centering
\begin{tabular}{r c r c r c r }
$2x$ & $+$ & $ y$ & $+$ & $3z$ & $=$ & $10$ \\
$ x$ & $+$ & $ y$ & $+$ & $ z$ & $=$ & $ 6$ \\
$ x$ & $+$ & $3y$ & $+$ & $2z$ & $=$ & $13$
\end{tabular}
\end{table}
\end{document}
I would very much want a more automatic way to do this, and a simple method for controlling the spacing between elements. I have looked at earlier posts like
Multicol layout for systems of (linear) equations
It seems that I am looking for a simple version of this one. I have no need to use side-by-side equations, nor have numbers in front of them.
Using ideas from the post above, I guess the result is done by redefining commands such as -
and +
inside of the table? I tried to do something like this, but the code looked rather complex =(
To sum it up: Is there a way to define a simple System of Equations enviroment, with proper alignment and a optional command for defining the spacing?