# How can I get vertical lines left and right of an align with a linear system of equations?

I've tried to use the align environment for my work. But, I don't know how to get vertical lines either side of the equations. The picture shows my attempt, but, it uses the tabular environment and the lines aren't the same length.

\begin{tabular}{|ccc|}

$\mathsf{-1x+5y}$&$=$&      $\mathsf{6}$\\

$\mathsf{-3x-5y}$&$=$&      $\mathsf{-4}$\\ \\

\end{tabular}


I can't go close to that result with the align environment.

• Any motivation behind this need? Do you need the individual equations numbered, or the whole thing numbered? Sep 10 at 17:22
• Just remove the backslashes at the end of the second line.
– Mico
Sep 10 at 17:42

empheq provides functionality for inserting content before (to the left) or after (to the right) of an align-like environment:

\documentclass{article}

\usepackage{empheq}

\begin{document}

\begin{empheq}[left=\left|,right=\right|]{align*}
-1x + 5y &=  6 \\
-3x - 5y &= -4
\end{empheq}

\end{document}


It is very simple with the systeme package:

\documentclass{article}
\usepackage{systeme}
\usepackage{sansmath}

\begin{document}

\sansmath
$\sysdelim| | \systeme{% -1x+5y=6, -3x-5y=-4\,}$

\end{document}


Since the contents of the tabular environment are all math-y, I'd switch to an array environment to save myself from having to enter lots of $ symbols. Since you seem to be interested in sans-serif math lettering, I'd load the sansmath package and run \sansmath, freeing me from having to inputs lots of \mathsf directives. \documentclass{article} \usepackage{sansmath} \sansmath \usepackage{array} \newcolumntype{C}{>{{}}c<{{}}} % for columns with binary and relational operators \begin{document}$\begin{array}{| r @{}C@{} r @{}C@{} r|}
-1x &+& 5y  &=&  6 \,\\
-3x &-& 5y  &=& -4
\end{array}\$

\end{document}