2

The slides I'm preparing for a lecture have some big equations. Sometimes I need to break lines inside an align* environment. But if I use curly brackets in an equation, their sizes are different from one line to another. Look the last two lines in the figure below:

enter image description here

How can I fix it?

Here is a minimal example:

\documentclass{article}

\usepackage{amsmath}
\usepackage{bm}

\newcommand{\Sigmab}{\bm{\Sigma}}
\newcommand{\xb}{\bm{x}}
\newcommand{\mub}{\bm{\mu}}

\begin{document}

\begin{align*}
\widehat{G} &= \arg \max_k P(G = k | X =x) \\
            &= \arg \max_k f_k(x)\pi_k \\
            &= \arg \max_k \log(f_k(x)\pi_k) \\
            &= \arg \max_k \left\{ -\log\left[(2\pi)^{p/2}|\Sigmab|^{1/2}\right] \right. \\
            &  \left. \hphantom{X} -\frac12 (\xb-\mub_k)' \Sigmab^{-1} (\xb-\mub_k) + \log(\pi_k) \right\}
\end{align*}


\end{document}

2 Answers 2

4

Just use \Big or \Bigg. Moreover, in this case, you need no more to use \left. \right.

\documentclass{article}

\usepackage{amsmath}
\usepackage{bm}

\newcommand{\Sigmab}{\bm{\Sigma}}
\newcommand{\xb}{\bm{x}}
\newcommand{\mub}{\bm{\mu}}

\begin{document}

    \begin{align*}
    \widehat{G} &= \arg \max_k P(G = k | X =x) \\
    &= \arg \max_k f_k(x)\pi_k \\
    &= \arg \max_k \log(f_k(x)\pi_k) \\
    &= \arg \max_k \Big\{ -\log\left[(2\pi)^{p/2}|\Sigmab|^{1/2}\right]\\
    &  \hphantom{X} -\frac12 (\xb-\mub_k)' \Sigmab^{-1} (\xb-\mub_k) + \log(\pi_k) \Big\}
    \end{align*}

\end{document}

enter image description here

2
  • 4
    It would be better to use the pair \Bigl … \Bigr.
    – Bernard
    Commented Sep 12, 2018 at 11:13
  • \Bigl and \Bigr worked. Thanks. Commented Sep 12, 2018 at 11:17
0

There are some ways to manually choose the size of brackets such as \Big , \Bigg, \bigg. For more detail, you may check this site.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .