1

Hi I'm noob in Latex and I began to use Lyx because it is much simpler to type in mathematical symbols. I'm typing in 5*5 matrix, but it appears too small so I want to increase spaces between each rows. This is my original matrix, latex code (I'm not sure if latex code is needed cuz I always work in Lyx.)

\begin{pmatrix}\frac{\omega}{k_{\bot}}-v_{E} & -1 & 0 & 0 & 0\\
0 & \Omega_{e} & \nu_{en} & 0 & 0\\
-ik\frac{k_{B}T}{m_{e}} & \nu_{en} & -\Omega_{e} & \frac{i}{m_{e}} & 0\\
-\frac{\omega}{k} & 0 & 0 & 0 & 1\\
k_{\bot}v_{th,i}^{2} & 0 & 0 & -\frac{1}{m_{i}} & \omega+i\nu_{in}
\end{pmatrix}\begin{pmatrix}\frac{\delta n}{n_{0}}\\
\delta v_{ey}\\
\delta v_{ez}\\
k_{\bot}e\delta\varphi\\
\delta v_{iy}
\end{pmatrix}=0

When I google it, I can see advices to use \renewcommand{\arraystretch}{1.5} like that, but I'm not sure how to use it. I inserted \usepackage{array} in preamble (is is needed?)

And I tried to type in \renewcommand at the space for the first element but Lyx does not recognize that command. I tried other spots but I couldn't find the space it works.

Can somebody help me to clear this thing?

enter image description here

6
  • Insert > TeX : And then {\renewcommand{\arraystretch}{1.5} just before your code and } just after [both in newlines]
    – koleygr
    Commented Feb 27, 2018 at 22:44
  • @koleygr I'm sorry but where can I find [both in newlines]? And what does it means just before my code? Should I write code in Latex and import in Lyx?
    – Septacle
    Commented Feb 27, 2018 at 22:50
  • 1
    [both in newlines] should be (both in newlines) and mean, they shouldn't be on the same line as your matrix, but in new lines, I guess, with one prior to your matrix, the other after it.
    – Skillmon
    Commented Feb 27, 2018 at 22:53
  • @Skillmon I'm sorry but I have completely no idea what is going on. LATEX and Lyx look completely different to me so I'm not sure how to use codes in Lyx. I attached a screenshot of my Lyx. Do you mean I have to insert the Tex code like that? But that does not work...
    – Septacle
    Commented Feb 27, 2018 at 22:59
  • 1
    Theri is an insert "action" high in your image... This contains a TeX... This is what I mean "Insert->TeX" in the first comment... Then you will find the code you posted... add the lines of my answer above and below of that code
    – koleygr
    Commented Feb 27, 2018 at 23:04

2 Answers 2

1
\documentclass{article}
\usepackage{polyglossia}
\setmainlanguage{english}
\usepackage{array}
\usepackage{amsmath}
\begin{document}
\[
\begin{pmatrix}\frac{\omega}{k_{\bot}}-v_{E} & -1 & 0 & 0 & 0\\
0 & \Omega_{e} & \nu_{en} & 0 & 0\\
-ik\frac{k_{B}T}{m_{e}} & \nu_{en} & -\Omega_{e} & \frac{i}{m_{e}} & 0\\
-\frac{\omega}{k} & 0 & 0 & 0 & 1\\
k_{\bot}v_{th,i}^{2} & 0 & 0 & -\frac{1}{m_{i}} & \omega+i\nu_{in}
\end{pmatrix}
\begin{pmatrix}\frac{\delta n}{n_{0}}\\
\delta v_{ey}\\
\delta v_{ez}\\
k_{\bot}e\delta\varphi\\
\delta v_{iy}
\end{pmatrix}=0\]

%%%The changes here: compare with above

{\renewcommand{\arraystretch}{1.5}% Added this line
\[
\begin{pmatrix}\frac{\omega}{k_{\bot}}-v_{E} & -1 & 0 & 0 & 0\\
0 & \Omega_{e} & \nu_{en} & 0 & 0\\
-ik\frac{k_{B}T}{m_{e}} & \nu_{en} & -\Omega_{e} & \frac{i}{m_{e}} & 0\\
-\frac{\omega}{k} & 0 & 0 & 0 & 1\\
k_{\bot}v_{th,i}^{2} & 0 & 0 & -\frac{1}{m_{i}} & \omega+i\nu_{in}
\end{pmatrix}
\begin{pmatrix}\frac{\delta n}{n_{0}}\\
\delta v_{ey}\\
\delta v_{ez}\\
k_{\bot}e\delta\varphi\\
\delta v_{iy}
\end{pmatrix}=0\]
}%Added this line
\end{document}

Output:

enter image description here

PS: if you dont find \[ and \] the following is the same and also works:

\[
{\renewcommand{\arraystretch}{1.5}% Added this line
\begin{pmatrix}\frac{\omega}{k_{\bot}}-v_{E} & -1 & 0 & 0 & 0\\
0 & \Omega_{e} & \nu_{en} & 0 & 0\\
-ik\frac{k_{B}T}{m_{e}} & \nu_{en} & -\Omega_{e} & \frac{i}{m_{e}} & 0\\
-\frac{\omega}{k} & 0 & 0 & 0 & 1\\
k_{\bot}v_{th,i}^{2} & 0 & 0 & -\frac{1}{m_{i}} & \omega+i\nu_{in}
\end{pmatrix}
\begin{pmatrix}\frac{\delta n}{n_{0}}\\
\delta v_{ey}\\
\delta v_{ez}\\
k_{\bot}e\delta\varphi\\
\delta v_{iy}
\end{pmatrix}=0
}%Added this line
\]

This means forget the \[ and \] if not there

1

enter image description here

in preamble should be \usepackage{amsmath}, used are \dfrac{...}{...} and arraystrertch had to be (in this case) 2:

{\renewcommand\arraystretch{2}
\begin{pmatrix}
\dfrac{\omega}{k_{\bot}}-v_{E}  & -1            & 0             & 0                 & 0 \\
0                               & \Omega_{e}    & \nu_{en}      & 0                 & 0 \\
-ik\dfrac{k_{B}T}{m_{e}}        & \nu_{en}      & -\Omega_{e}   & \dfrac{i}{m_{e}}  & 0 \\
-\dfrac{\omega}{k}              & 0             & 0             & 0                 & 1\\
k_{\bot}v_{th,i}^{2}            & 0             & 0             & -\dfrac{1}{m_{i}} & \omega+i\nu_{in}
\end{pmatrix}\begin{pmatrix}
\dfrac{\delta n}{n_{0}}\\
\delta v_{ey}\\
\delta v_{ez}\\
k_{\bot}e\delta\varphi\\
\delta v_{iy}
\end{pmatrix}=0
}
4
  • Thanks. For somewhat reason, my Lyx shows less space than what you posted. (One of the reason is I didn't used dfrac) That was the reason I thought \renewcommand doesn't work in the first place. My arraystretch is optimal at 3 without dfrac.
    – Septacle
    Commented Feb 27, 2018 at 23:14
  • than set arraystreatch to be 3 and not use \dfrac{...}{...}, i.e. stick with accepted answer.
    – Zarko
    Commented Feb 27, 2018 at 23:16
  • Oh I thought I can accept both answers. Anyway thank you. I could find where is wrong from your answer.
    – Septacle
    Commented Feb 27, 2018 at 23:54
  • I upvote your answer +1.
    – Sebastiano
    Commented Feb 28, 2018 at 9:42

You must log in to answer this question.

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