1

I would like to homogenize the size of the elements of the two matrices, but it is impossible for now because there are these fractions. It is really ugly like this.

\documentclass[paper=a4, fontsize=11pt]{scrartcl} \usepackage{amsmath,amsfonts,amsthm,latexsym} \begin{document} \begin{equation} \begin{pmatrix} -\frac{R_a}{L_a} & -\frac{K_g}{L_a} \\ \frac{Ka}{J} & - \frac{f}{J} \end{pmatrix} \begin{pmatrix} i_a(t) \\ \omega(t) \end{pmatrix} \end{equation} \end{document} 

1 Answer 1

2

Here I use TABstacks to build the elements. I control the vertical baselineskip (22pt) and the the horizontal inter-column gap (8pt).

I also created my own \vphantom strut to extend the range of the vector elements.

\documentclass[paper=a4, fontsize=11pt]{scrartcl} \usepackage{amsmath,amsfonts,amsthm,latexsym,tabstackengine} \begin{document} \begin{equation} \setstackgap{L}{22pt} \setstacktabbedgap{8pt} \def\mystrut{\vphantom{\frac{K_g}{J}}} \parenMatrixstack{ -\frac{R_a}{L_a} & -\frac{K_g}{L_a} \\ \frac{Ka}{J} & - \frac{f}{J} } \parenVectorstack{ i_a(t)\mystrut \\ \omega(t)\mystrut } \end{equation} \end{document} 

enter image description here

Another option is to present the result in \displaystyle. Since amsmath is loaded, one can use \dfrac to achieve the result. The "Long" stackgap has been increased to 34pt.

\documentclass[paper=a4, fontsize=11pt]{scrartcl} \usepackage{amsmath,amsfonts,amsthm,latexsym,tabstackengine} \begin{document} \begin{equation} \setstackgap{L}{34pt} \setstacktabbedgap{8pt} \def\mystrut{\vphantom{\dfrac{K_g}{J}}} \parenMatrixstack{ -\dfrac{R_a}{L_a} & -\dfrac{K_g}{L_a} \\ \dfrac{Ka}{J} & - \dfrac{f}{J} } \parenVectorstack{ i_a(t)\mystrut \\ \omega(t)\mystrut } \end{equation} \end{document} 

enter image description here

4
  • Do I need to create a .sty file? Commented Jun 3, 2015 at 14:58
  • @EduardoCasseres You can download it directly, along with the documentation, at ctan.org/pkg/tabstackengine. You will also need the associated stackengine package at ctan.org/pkg/stackengine. Commented Jun 3, 2015 at 14:58
  • Is there any way to reduce the size of the vector's elements? Commented Jun 3, 2015 at 15:17
  • @EduardoCasseres The vector elements are the normal size. It is the matrix elements that have been reduced. The matrix elements can be increased in size by using \displaystyle\frac (or \dfrac if using amsmath). I will revise my answer to demonstrate. Commented Jun 3, 2015 at 15:21

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.