0

Below is my code. I have tried using the arraystretch but it is not working well for my document since it affects all the tables and matrices I dont want to adjust. I also tried some techniques from this link Using display style fraction in a matrix environment but I failed to achieve the results I want.

\documentclass[11pt,oneside,openany]{book}
\usepackage[a4paper, left=1.5cm, right=1.5cm, top=3cm, bottom=3cm]{geometry}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\begin{document}
    \begin{alignat*}{2}
        \begin{bmatrix}
            5 & 6 & 7 \\
            0 & 2 &  \\
            4 & 8 & 
        \end{bmatrix}&=\begin{bmatrix}
            \frac{327}{78} & \frac{132}{7} & \frac{312}{17} \\
            \frac{32}{7} & \frac{32}{7} &  \\
            \frac{32}{7} & \frac{32}{7} & 
        \end{bmatrix}+&\begin{bmatrix}
            \frac{10}{7} & \frac{10}{7} & \frac{10}{7} \\
            -\frac{25}{7} & -\frac{25}{7} &  \\
            \frac{10}{7} & \frac{10}{7}&\end{bmatrix}+&\begin{bmatrix}
            -1 & 0 & 1 \\
            -1 & 1 &  \\
            -2 & 2 & 
        \end{bmatrix}
    \end{alignat*}
\end{document}
gernot
  • 49,614
itc
  • 657

1 Answers1

4

Redefine \arraystretch, but confine the change to this math environment.

{\renewcommand\arraystretch{1.4}\begin{alignat*}{2}...\end{alignat*}}

Note the braces {...} surrounding the whole expression.

enter image description here


\documentclass[11pt,oneside,openany]{book}
\usepackage[a4paper, left=1.5cm, right=1.5cm, top=3cm, bottom=3cm]{geometry}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\begin{document}
   {\renewcommand\arraystretch{1.4}%
    \begin{alignat*}{2}
        \begin{bmatrix}
            5 & 6 & 7 \\
            0 & 2 &  \\
            4 & 8 & 
        \end{bmatrix}&=\begin{bmatrix}
            \frac{327}{78} & \frac{132}{7} & \frac{312}{17} \\
            \frac{32}{7} & \frac{32}{7} &  \\
            \frac{32}{7} & \frac{32}{7} & 
        \end{bmatrix}+&\begin{bmatrix}
            \frac{10}{7} & \frac{10}{7} & \frac{10}{7} \\
            -\frac{25}{7} & -\frac{25}{7} &  \\
            \frac{10}{7} & \frac{10}{7}&\end{bmatrix}+&\begin{bmatrix}
            -1 & 0 & 1 \\
            -1 & 1 &  \\
            -2 & 2 & 
        \end{bmatrix}
      \end{alignat*}%
     }
\end{document}
gernot
  • 49,614