2

I am displeased with some of my display in the following equation :

\begin{frame}
        \begin{align*}
        \left[ \begin{array}{l}
        \dfrac{\partial \log L}{\partial b} \\ 
        \dfrac{\partial \log L}{\partial \sigma^2_u} 
        \end{array}\right]
        &= 
        \left[ \begin{array}{c}
        \dfrac{1}{\hat{\sigma}_u^2}X^T(y-X\hat{b}) \\ 
        - \dfrac{T}{2\hat{\sigma}^2_u}+\dfrac{1}{2\hat{\sigma}^4_u}(y-\textbf{X}    \hat{\textbf{b}})^T(y-\textbf{X}\hat{\textbf{b}})
        \end{array}\right]
        = \left[\begin{array}{l} 0 \\ 0 \end{array} \right]
        \end{align*}
\end{frame}

I get that : enter image description here

And I have two points of concern :

  • I feel there should me a little more spacing between the two lines of my matrices (it is obivious because of $\sigma^2_u$ but even in the first matrix it is too little
  • I would like the last matrix to be the same size as the other two

How could I achieve these two things ?

Thanks

2

One way is to increase the array inter-line space by \renewcommand{\arraystretch}{2.2}.

\documentclass[11pt]{beamer}
\usepackage{lmodern,amsmath}
\begin{document}

\begin{frame}
\begin{equation*}\renewcommand{\arraystretch}{2.2}
        \left[ \begin{array}{l}
        \dfrac{\partial \log L}{\partial b} \\ 
        \dfrac{\partial \log L}{\partial \sigma^2_u} 
        \end{array}\right]
        = 
        \left[ \begin{array}{c}
        \dfrac{1}{\hat{\sigma}_u^2}X^T(y-X\hat{b}) \\ 
        - \dfrac{T}{2\hat{\sigma}^2_u}+\dfrac{1}{2\hat{\sigma}^4_u}(y-\textbf{X}    \hat{\textbf{b}})^T(y-\textbf{X}\hat{\textbf{b}})
        \end{array}\right]
        = \left[\begin{array}{l} 0 \\ 0 \end{array} \right]
\end{equation*}
\end{frame}

\end{document}

enter image description here

Another (better) option is to use a bmatrix:

\begin{equation*}\renewcommand{\arraystretch}{2.2}
        \begin{bmatrix}
        \dfrac{\partial \log L}{\partial b} \\ 
        \dfrac{\partial \log L}{\partial \sigma^2_u} 
        \end{bmatrix}
        = 
        \begin{bmatrix}
        \dfrac{1}{\hat{\sigma}_u^2}X^T(y-X\hat{b}) \\ 
        - \dfrac{T}{2\hat{\sigma}^2_u}+\dfrac{1}{2\hat{\sigma}^4_u}(y-\textbf{X}    \hat{\textbf{b}})^T(y-\textbf{X}\hat{\textbf{b}})
        \end{bmatrix}
        = 
        \begin{bmatrix} 
        \ 0\ \\ 0 
        \end{bmatrix}
\end{equation*}

enter image description here

| improve this answer | |
  • I was slowly figuring the initial choice of array was part of the problem. Thx for your solution. But don't you find in the second solution that the last matrix is a bit too narrow horizontally ? (I am sorry to be both asking for help and picky) – Anthony Martin Mar 14 '16 at 14:44
  • 1
    @Aerandal - You can simply change one of the zeros in the last matrix to \ 0 \ to thicken the matrix a bit. – AboAmmar Mar 14 '16 at 15:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.