0

In fact after compiling the code below, the third matrx is outside the paper form, I want to have this matrix in the next line in the middle, also I want to reduce the vertical space in a matrix, I know in this example it's reduced but generally how can we reduce it.

\immediate\write18{makeindex \jobname.nlo -s nomencl.ist -o \jobname.nls}
\documentclass[12pt]{report}
\DeclareMathSizes{12}{30}{16}{12}
\usepackage[utf8]{inputenc}
\usepackage{lineno}
\usepackage{amsmath}
\usepackage{array}
\usepackage{mathptmx}
\begin{document}
\begin{equation}
[L_{ss}]= 
\begin{bmatrix}
 R_s & M_s & M_s \\ M_s & R_s & M_s \\ M_s & M_s & R_s
\end{bmatrix},
[L_{rr}]= 
\begin{bmatrix}
R_r & M_r & M_r \\ M_r & R_r & M_r \\ M_r & M_r & R_r
\end{bmatrix}
[M_{sr}]=[M_{rs}]^t= M_{sr}
\begin{bmatrix}
cos(\theta) & cos(\theta-4\pi/3) & cos(\theta-2\pi/3) \\ cos(\theta-2\pi/3) 
& cos(\theta) & cos(\theta-4\pi/3 \\ cos(\theta-4\pi/3) & cos(\theta-2\pi/3) 
& cos(\theta)
\end{bmatrix}
\end{equation}
\end{document} 

For vertical spacing: enter image description here

2
  • What's the purpose of \DeclareMathSizes{12}{30}{16}{12}?
    – egreg
    Mar 19, 2018 at 15:02
  • Changing the font of an equation
    – twimo
    Mar 19, 2018 at 15:06

1 Answer 1

1

I propose to use the gathered environment, and the xmatrix* envoronments from mathtools (the columns alignment is an optionand the medium-sized fractions fromnccmath`:

\documentclass[12pt]{report}
\DeclareMathSizes{12}{30}{16}{12}
\usepackage[utf8]{inputenc}
\usepackage{mathtools}
\usepackage{array, nccmath}
\usepackage{mathptmx}

\begin{document}

\begin{equation}
\begin{gathered}
[L_{ss}]= \begin{bmatrix}
 R_s & M_s & M_s \\ M_s & R_s & M_s \\ M_s & M_s & R_s
\end{bmatrix},\qquad
[L_{rr}]=
\begin{bmatrix}
R_r & M_r & M_r \\ M_r & R_r & M_r \\ M_r & M_r & R_r
\end{bmatrix} \\[1.5ex]
[M_{sr}]=[M_{rs}]^t= M_{sr}
\begin{bmatrix*}[l]
\cos\theta & \cos\Bigl(\theta-\mfrac{4\pi}{3}\Bigr) & \cos\Bigl(\theta-\mfrac{2\pi}{3}\Bigr) \\[1.5ex]
\cos\Bigl(\theta-\mfrac{2\pi}{3}\Bigr) & \cos(\theta) & \cos\Bigl(\theta-\mfrac{4\pi}{3}\Bigr) \\[1.5ex]
\cos\Bigl(\theta-\mfrac{4\pi}{3}\Bigr) &\cos\Bigl(\theta-\mfrac{2\pi}{3}\Bigr) & \cos\theta
\end{bmatrix*}
\end{gathered}
\end{equation}

\end{document} 

enter image description here

Edit:

To answer a question in the comments, this code for the last matrix:

\begin{bmatrix}
\cos\theta & \cos\Bigl(\theta-\mfrac{4\pi }{3}\Bigr) & \cos\Bigl(\theta-\mfrac{2\pi }{3}\Bigr) \\[1.5ex]
\cos\Bigl(\theta-\mfrac{2\pi }{3}\Bigr) & \cos \theta  & \cos\Bigl(\theta-\mfrac{4\pi }{3}\Bigr) \\[1.5ex]
\cos\Bigl(\theta-\mfrac{4\pi }{3}\Bigr) &\cos\Bigl(\theta-\mfrac{2\pi }{3}\Bigr) & \cos\theta
\end{bmatrix}

yields this result: enter image description here

6
  • Thank you very much @Bernard but how about reducing the vertical space in a matrix see the new edited post and also I want to know how can I make cos(\theta) in the middle not aligned with the vertical expressions
    – twimo
    Mar 19, 2018 at 15:32
  • @Twimo: to reduce the vertical spacing, use \renewcommand{\arraystretch}{some number < 1} before the matrix (put it with the matrix in a group if you want it to be local). However I had to increase the spacing here – otherwise two consecutive rows touch each other. For your other question, I'll post a solution in a moment.
    – Bernard
    Mar 19, 2018 at 15:47
  • @twimo; Does the new code correspond to what you want?
    – Bernard
    Mar 19, 2018 at 15:54
  • Thank you so very much @Bernardeverything is fine but the cos \theta of the first and the third column are not in the middle even if I use {}\hfill
    – twimo
    Mar 19, 2018 at 16:11
  • @Twimo: Oh! I hadn't understood you want them centred in all columns. In this case, simply remove the optional argument [l]: all columns will be centred (it's the default). No \hfill{} to be used in this case.
    – Bernard
    Mar 19, 2018 at 17:12

You must log in to answer this question.

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