# Homogeneous Matrices (elements size)

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{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{document}


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}
$$\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{document}


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}
$$\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{document}


• Do I need to create a .sty file? – Eduardo Casseres Jun 3 '15 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. – Steven B. Segletes Jun 3 '15 at 14:58
• Is there any way to reduce the size of the vector's elements? – Eduardo Casseres Jun 3 '15 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. – Steven B. Segletes Jun 3 '15 at 15:21