3

When I try to use

\documentclass[11pt,a4paper]{article}
\usepackage{amsmath}
\usepackage{arydshln}
\begin{document}
\[\left[
    \begin{array}{c:c:c}
        \begin{bmatrix}A_l& A_{nl}\end{bmatrix} & B_r & \begin{bmatrix}B_l& B_{nl}\end{bmatrix} \\
        \hdashline
        C &0&0
    \end{array}
    \right]\]
\end{document}

I get:

enter image description here

This is pretty good, how I would want it. However, when I start using elsarticle document class with

\documentclass[review,3p, twocolumn, times,11pt]{elsarticle}
\usepackage{amsmath}
\usepackage{arydshln}
\begin{document}
\[\left[
    \begin{array}{c:c:c}
        \begin{bmatrix}A_l& A_{nl}\end{bmatrix} & B_r & \begin{bmatrix}B_l& B_{nl}\end{bmatrix} \\
        \hdashline
        C &0&0
    \end{array}
    \right]\]
\end{document}

I get:

enter image description here

In this if you see, the interline spacing is off (please ignore the double line-spacing. It is due to the fact that the review mode is selected). How can I rectify this issue?

2 Answers 2

3

\addstackgap will add a (default) 3pt vertical buffer on its argument. It only needs to be added to one term in the row.

\documentclass[review,3p, twocolumn, times,11pt]{elsarticle}
\usepackage{amsmath,stackengine}
\stackMath
\usepackage{arydshln}
\begin{document}
\[\left[
    \begin{array}{c:c:c}
        \addstackgap{\begin{bmatrix}A_l& A_{nl}\end{bmatrix}} & B_r & \begin{bmatrix}B_l& B_{nl}\end{bmatrix} \\
        \hdashline
        C &0&0
    \end{array}
    \right]\]
\end{document}

enter image description here

Here is with \addstackgap[2pt]{...}

enter image description here

3

One typically adds extra space to an equation by using a strut (see \strut, \mathstrut and \arraystretch). The tricky bit is centering it, since the baseline is below the center.

\fbox adds space around all sides equally (\fboxsep+\fboxrule), In this case, we only want extra vertical space, hence the \vphantom.

\documentclass[review,3p, twocolumn, times,11pt]{elsarticle}
\usepackage{amsmath}
\usepackage{arydshln}
\begin{document}
\[\left[
    \begin{array}{c:c:c}
        \sbox0{$\displaystyle \begin{bmatrix}A_l& A_{nl}\end{bmatrix}$}%
        \vphantom{\fbox{\usebox0}}% strut
        \usebox0 & B_r & \begin{bmatrix}B_l& B_{nl}\end{bmatrix} \\
        \hdashline
        C &0&0
    \end{array}
    \right]\]
\end{document}

demo


This solution adds extra vertical space using \raisebox.

\documentclass[review,3p, twocolumn, times,11pt]{elsarticle}
\usepackage{amsmath}
\usepackage{arydshln}
\begin{document}
\[\left[
    \begin{array}{c:c:c}
        \raisebox{0pt}[\dimexpr \height+2pt][\dimexpr \depth+2pt]%
          {$\displaystyle \begin{bmatrix}A_l& A_{nl}\end{bmatrix}$}
         & B_r & \begin{bmatrix}B_l& B_{nl}\end{bmatrix} \\
        \hdashline
        C &0&0
    \end{array}
    \right]\]
\end{document}

You must log in to answer this question.

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