[Tex/LaTex] Automatically size the brackets by \left and \right


My tex code

\usepackage{amsmath, amsfonts, amssymb, textcomp}
\usepackage[T4, OT1]{fontenc}
\newunicodechar{ƒ}{{\fontencoding{T4}\fontfamily{cmr}\selectfont\m f}}
\newunicodechar{Ƒ}{{\fontencoding{T4}\fontfamily{cmr}\selectfont\m F}}


x\left(a + \left(b-a\right) &\frac{k-1}{N}\right)\\
&= \lambda x y 


and I get the output

enter image description here

How can you automatically size the brackets with \left and \right?

Best Answer

Assuming that this is the result you wanted to achieve:

enter image description here

this is a MWE to obtain it:



x\biggl(a + (b-a)&\frac{k-1}{N}\biggr)\\
& \lambda x y


And these are the errors in your MWE:

  1. You cannot put an align environment inside an equation. If you want a single equation just use equation (with no alignment characters & inside). If you want multiple aligned equations use align. But, as in your case, if you want to align stuff inside a single equation, use a split environment inside an equation.
  2. If you want to use \left and \right to "automatically size the brackets" they have to be in the same equation and there should be no & between them. You can use \left. and \right. to match the missing pairs, but in your case this doesn't work well because \left and \right are applied to things with different size. In this case (and probably always) is much better to use fixed size commands like \biggl and \biggr.
Related Question