[Tex/LaTex] Adding braces around equations

braces

Is there any way to add braces around a system of equations? Say I want to add braces around:

a=x+2y+3z

b=6x+y+2z

c=5x+3y+z

The best example I could find of how I want the braces to look is the "2d,3d,4th,5th,6th" thing here:

enter image description here

In other words, they need to be curly braces and appear on both sides. They also need to enclose the whole system.

Thanks!

Best Answer

Here are two possibilities, depending on what you mean by "curly".

The first type of brace grows wider the taller it gets; however, in this case, I have limited its maximum width to 3ex.

The second type of brace will never grow wider, but only taller.

EDITED to add \stackMath to perform stacks in math mode.

\documentclass{article}
\usepackage{scalerel}
\usepackage[usestackEOL]{stackengine}
\stackMath
\begin{document}
\[
\scaleleftright[3ex]{\{}
{\Centerstack{a=x+2y+3z\\
b=6x+y+2z\\
c=5x+3y+z}}
{\}}
\quad
\left\{ 
\Centerstack{a=x+2y+3z\\
b=6x+y+2z\\
c=5x+3y+z}
\right \}
\]
\end{document}

enter image description here

If you had a curly-brace glyph that was more to your liking from a different (importable) font, it could be used in the first method presented below.

For example, here we use the brace from the mathdesign package.

\documentclass{article}
\usepackage{scalerel}
\usepackage[usestackEOL]{stackengine}
\stackMath
\usepackage[utopia]{mathdesign}
\begin{document}
\[
\scaleleftright[3ex]{\{}
{\Centerstack{a=x+2y+3z\\
b=6x+y+2z\\
c=5x+3y+z}}
{\}}
\quad
\left\{ 
\Centerstack{a=x+2y+3z\\
b=6x+y+2z\\
c=5x+3y+z}
\right \}
\]
\end{document}

enter image description here

As a follow up for the OP, the mathdesign braces may be solely obtained (as \textbraceleft and \textbraceright) using the method of egreg at Import curly brackets from MathDesign (Utopia).

In the MWE below, I only import it as such. So the left hand \scaleleftright uses it, while the right-hand solution uses the default LaTeX brace. However, by uncommenting the additional code provided, these curly braces will become the default math brace.

In either case, however, the rest of the mathdesign glyphs are not imported.

\documentclass{article}
\usepackage{scalerel}
\usepackage[usestackEOL]{stackengine}
\stackMath
%\usepackage[utopia]{mathdesign}
\DeclareSymbolFont{mdsymbols}     {OMS}{mdput}{m}{n}
\DeclareSymbolFont{mdlargesymbols}{OMX}{mdput}{m}{n}
% TO GET ALL BRACES REPLACED WITH THE mathdesign BRACE
%\DeclareMathDelimiter{\lbrace}
%   {\mathopen}{mdsymbols}{"66}{mdlargesymbols}{"08}
%\DeclareMathDelimiter{\rbrace}
%   {\mathclose}{mdsymbols}{"67}{mdlargesymbols}{"09}
%
% TO JUST IMPORT mathdesign BRACES AS \textbraceleft and \textbraceright
\renewcommand{\textbraceleft}{%
  {\fontfamily{mdput}\fontencoding{OMS}\selectfont\char"66}}
\renewcommand{\textbraceright}{%
  {\fontfamily{mdput}\fontencoding{OMS}\selectfont\char"67}}
\begin{document}
\[
\scaleleftright[3ex]{$\textbraceleft$}
{\Centerstack{a=x+2y+3z\\
b=6x+y+2z\\
c=5x+3y+z}}
{$\textbraceright$}
\quad
\left\{ 
\Centerstack{a=x+2y+3z\\
b=6x+y+2z\\
c=5x+3y+z}
\right \}
\]
\end{document}

enter image description here

Related Question