3

I'm writing a report that contains a lot of matrices. At some point in the text, I've written the following code

EDIT: as I've been told, I'll upload a code that better represents the problem I'm having, including the structure configuration.

%----------------------------------------------------------------------------------------
%   PACKAGES AND OTHER DOCUMENT CONFIGURATIONS
%----------------------------------------------------------------------------------------

\documentclass[a4paper, 11pt]{article}
\usepackage{cite} % bibtex

\input{structure}

%----------------------------------------------------------------------------------------
%   ASSIGNMENT INFORMATION
%----------------------------------------------------------------------------------------
\title{Problem with matrix alignment}
\author{Not Sure \\ \texttt{not.sure@email.com} \\ Number: \texttt{123456} }
\date{25th-Sep-2018}

\begin{document}
\maketitle

Equation (\ref{eqn:volt_hf_theta_esteemed}) is not aligned.

\begin{equation} \label{eqn:volt_hf_theta_esteemed}
    \begin{bmatrix}
        u_{dh}^{\hat{r}} \\
        u_{qh}^{\hat{r}}
    \end{bmatrix}
    =
    \begin{bmatrix}
        j\omega_h \left(L_{avg} + \frac{L_\Delta}{2}\cos(2\theta_\epsilon)\right) & j\omega_h \frac{L_\Delta}{2}\sin(2\theta_\epsilon) \\
        j\omega_h \frac{L_\Delta}{2}\sin(2\theta_\epsilon) & j\omega_h \left(L_{avg} - \frac{L_\Delta}{2}\cos(2\theta_\epsilon)\right)
    \end{bmatrix}
    \begin{bmatrix}
        i_{dsh}^{\hat{r}} \\
        i_{qsh}^{\hat{r}}
    \end{bmatrix}
\end{equation} % fix horiziontal alignment

\end{document}

The "\input{structure}" thing is the following template

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Lachaise Assignment
% Structure Specification File
% Version 1.0 (26/6/2018)
%
% This template originates from:
% http://www.LaTeXTemplates.com
%
% Authors:
% Marion Lachaise & François Févotte
% Vel (vel@LaTeXTemplates.com)
%
% License:
% CC BY-NC-SA 3.0 (http://creativecommons.org/licenses/by-nc-sa/3.0/)
% 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%----------------------------------------------------------------------------------------
%   PACKAGES AND OTHER DOCUMENT CONFIGURATIONS
%----------------------------------------------------------------------------------------

\usepackage{amsmath,amsfonts,stmaryrd,amssymb,tabstackengine} % Math packages

\usepackage{enumerate} % Custom item numbers for enumerations

\usepackage[ruled]{algorithm2e} % Algorithms

\usepackage[framemethod=tikz]{mdframed} % Allows defining custom boxed/framed environments

\usepackage{listings} % File listings, with syntax highlighting
\lstset{
    basicstyle=\ttfamily, % Typeset listings in monospace font
}

%----------------------------------------------------------------------------------------
%   DOCUMENT MARGINS
%----------------------------------------------------------------------------------------

\usepackage{geometry} % Required for adjusting page dimensions and margins

\geometry{
    paper=a4paper, % Paper size, change to letterpaper for US letter size
    top=2.5cm, % Top margin
    bottom=3cm, % Bottom margin
    left=2.5cm, % Left margin
    right=2.5cm, % Right margin
    headheight=14pt, % Header height
    footskip=1.5cm, % Space from the bottom margin to the baseline of the footer
    headsep=1.2cm, % Space from the top margin to the baseline of the header
    %showframe, % Uncomment to show how the type block is set on the page
}

%----------------------------------------------------------------------------------------
%   FONTS
%----------------------------------------------------------------------------------------

\usepackage[utf8]{inputenc} % Required for inputting international characters
\usepackage[T1]{fontenc} % Output font encoding for international characters

\usepackage{XCharter} % Use the XCharter fonts

%----------------------------------------------------------------------------------------
%   COMMAND LINE ENVIRONMENT
%----------------------------------------------------------------------------------------

% Usage:
% \begin{commandline}
%   \begin{verbatim}
%       $ ls
%       
%       Applications    Desktop ...
%   \end{verbatim}
% \end{commandline}

\mdfdefinestyle{commandline}{
    leftmargin=10pt,
    rightmargin=10pt,
    innerleftmargin=15pt,
    middlelinecolor=black!50!white,
    middlelinewidth=2pt,
    frametitlerule=false,
    backgroundcolor=black!5!white,
    frametitle={Command Line},
    frametitlefont={\normalfont\sffamily\color{white}\hspace{-1em}},
    frametitlebackgroundcolor=black!50!white,
    nobreak,
}

% Define a custom environment for command-line snapshots
\newenvironment{commandline}{
    \medskip
    \begin{mdframed}[style=commandline]
}{
    \end{mdframed}
    \medskip
}

%----------------------------------------------------------------------------------------
%   FILE CONTENTS ENVIRONMENT
%----------------------------------------------------------------------------------------

% Usage:
% \begin{file}[optional filename, defaults to "File"]
%   File contents, for example, with a listings environment
% \end{file}

\mdfdefinestyle{file}{
    innertopmargin=1.6\baselineskip,
    innerbottommargin=0.8\baselineskip,
    topline=false, bottomline=false,
    leftline=false, rightline=false,
    leftmargin=2cm,
    rightmargin=2cm,
    singleextra={%
        \draw[fill=black!10!white](P)++(0,-1.2em)rectangle(P-|O);
        \node[anchor=north west]
        at(P-|O){\ttfamily\mdfilename};
        %
        \def\l{3em}
        \draw(O-|P)++(-\l,0)--++(\l,\l)--(P)--(P-|O)--(O)--cycle;
        \draw(O-|P)++(-\l,0)--++(0,\l)--++(\l,0);
    },
    nobreak,
}

% Define a custom environment for file contents
\newenvironment{file}[1][File]{ % Set the default filename to "File"
    \medskip
    \newcommand{\mdfilename}{#1}
    \begin{mdframed}[style=file]
}{
    \end{mdframed}
    \medskip
}

%----------------------------------------------------------------------------------------
%   NUMBERED QUESTIONS ENVIRONMENT
%----------------------------------------------------------------------------------------

% Usage:
% \begin{question}[optional title]
%   Question contents
% \end{question}

\mdfdefinestyle{question}{
    innertopmargin=1.2\baselineskip,
    innerbottommargin=0.8\baselineskip,
    roundcorner=5pt,
    nobreak,
    singleextra={%
        \draw(P-|O)node[xshift=1em,anchor=west,fill=white,draw,rounded corners=5pt]{%
        Question \theQuestion\questionTitle};
    },
}

\newcounter{Question} % Stores the current question number that gets iterated with each new question

% Define a custom environment for numbered questions
\newenvironment{question}[1][\unskip]{
    \bigskip
    \stepcounter{Question}
    \newcommand{\questionTitle}{~#1}
    \begin{mdframed}[style=question]
}{
    \end{mdframed}
    \medskip
}

%----------------------------------------------------------------------------------------
%   WARNING TEXT ENVIRONMENT
%----------------------------------------------------------------------------------------

% Usage:
% \begin{warn}[optional title, defaults to "Warning:"]
%   Contents
% \end{warn}

\mdfdefinestyle{warning}{
    topline=false, bottomline=false,
    leftline=false, rightline=false,
    nobreak,
    singleextra={%
        \draw(P-|O)++(-0.5em,0)node(tmp1){};
        \draw(P-|O)++(0.5em,0)node(tmp2){};
        \fill[black,rotate around={45:(P-|O)}](tmp1)rectangle(tmp2);
        \node at(P-|O){\color{white}\scriptsize\bf !};
        \draw[very thick](P-|O)++(0,-1em)--(O);%--(O-|P);
    }
}

% Define a custom environment for warning text
\newenvironment{warn}[1][Warning:]{ % Set the default warning to "Warning:"
    \medskip
    \begin{mdframed}[style=warning]
        \noindent{\textbf{#1}}
}{
    \end{mdframed}
}

%----------------------------------------------------------------------------------------
%   INFORMATION ENVIRONMENT
%----------------------------------------------------------------------------------------

% Usage:
% \begin{info}[optional title, defaults to "Info:"]
%   contents
%   \end{info}

\mdfdefinestyle{info}{%
    topline=false, bottomline=false,
    leftline=false, rightline=false,
    nobreak,
    singleextra={%
        \fill[black](P-|O)circle[radius=0.4em];
        \node at(P-|O){\color{white}\scriptsize\bf i};
        \draw[very thick](P-|O)++(0,-0.8em)--(O);%--(O-|P);
    }
}

% Define a custom environment for information
\newenvironment{info}[1][Info:]{ % Set the default title to "Info:"
    \medskip
    \begin{mdframed}[style=info]
        \noindent{\textbf{#1}}
}{
    \end{mdframed}
}

The uploaded code produces the result in figure. enter image description here

I'd like to align the left and right text at the same height as the text included into the matrix. Thanks everyone for the help!

  • 1
    Welcome to TeX.SE! Please provide us with a minimal example that starts with \documentclass and ends with \end{document}. One reason why I am asking this is because your screen shot does not get reproduced when I compile your code with a preamble \documentclass{article} \usepackage{amsmath} \begin{document}` and \end{document} at the end. Notice also that very similar questions have been asked and answered here before. – user121799 Sep 24 '18 at 16:35
  • Unrelated: the code for trigonometric functions is \sin, \cos, &c. with a backslash, in order to have them typed with an upright font. – Bernard Sep 24 '18 at 17:46
3

In the tabstackengnine package, there are macros that stack things based on a specified baselineskip between rows. That is what you need here.

I show before (OP code) and after (TABstacks). However, without your full code (just snippets), I don't get the same misalignment as you with bmatrix.

Note that if the vertical extent of some matrices is taller/deeper than others, the TABstack rows will still align---however, the bracket heights may differ (requiring a \vphantom).

\documentclass{article} 
\usepackage{amsmath,tabstackengine}
\TABstackMath
%\TABstackMathstyle{\displaystyle}
\begin{document} 
\begin{equation} \label{eqn:volt_hf_theta_esteemed}
    \begin{bmatrix}
        u_{dh}^{\hat{r}} \\
        u_{qh}^{\hat{r}}
    \end{bmatrix}
    =
    \begin{bmatrix}
        j\omega_h \left(L_{avg} + \frac{L_\Delta}{2}cos(2\theta_\epsilon)\right) & j\omega_h \frac{L_\Delta}{2}sin(2\theta_\epsilon) \\
        j\omega_h \frac{L_\Delta}{2}sin(2\theta_\epsilon) & j\omega_h \left(L_{avg} - \frac{L_\Delta}{2}cos(2\theta_\epsilon)\right)
    \end{bmatrix}
    \begin{bmatrix}
        i_{dsh}^{\hat{r}} \\
        i_{qsh}^{\hat{r}}
    \end{bmatrix}
\end{equation}
\begin{equation} 
\setstackgap{L}{18pt}
\setstacktabbedgap{6pt}
    \bracketVectorstack{
        u_{dh}^{\hat{r}} \\
        u_{qh}^{\hat{r}}
    }
    =
    \bracketMatrixstack{
        j\omega_h \left(L_{avg} + \frac{L_\Delta}{2}cos(2\theta_\epsilon)\right) & j\omega_h \frac{L_\Delta}{2}sin(2\theta_\epsilon) \\
        j\omega_h \frac{L_\Delta}{2}sin(2\theta_\epsilon) & j\omega_h \left(L_{avg} - \frac{L_\Delta}{2}cos(2\theta_\epsilon)\right)
    }
    \bracketVectorstack{
        i_{dsh}^{\hat{r}} \\
        i_{qsh}^{\hat{r}}
    }
\end{equation}
\end{document}

enter image description here

Using the actual packages/template now provided by the OP, while tabstackengine aligns the row data, one indeed has to add a \vphantom to the vectors to match the bracket sizes. Note that in this 2-row case, one could argue that the constant baselineskip feature of tabstackengine is not necessary since one also has to use the \vphantoms. However, if the matrix is higher than 2 rows, then the use of tabstackengine will limit the need of the \vphantoms to the top and bottom rows, rather than each row of the matrix, as shown in the equation 2 given below.

    %----------------------------------------------------------------------------------------
%   PACKAGES AND OTHER DOCUMENT CONFIGURATIONS
%----------------------------------------------------------------------------------------

\documentclass[a4paper, 11pt]{article}
\usepackage{cite} % bibtex

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Lachaise Assignment
% Structure Specification File
% Version 1.0 (26/6/2018)
%
% This template originates from:
% http://www.LaTeXTemplates.com
%
% Authors:
% Marion Lachaise & François Févotte
% Vel (vel@LaTeXTemplates.com)
%
% License:
% CC BY-NC-SA 3.0 (http://creativecommons.org/licenses/by-nc-sa/3.0/)
% 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%----------------------------------------------------------------------------------------
%   PACKAGES AND OTHER DOCUMENT CONFIGURATIONS
%----------------------------------------------------------------------------------------

\usepackage{amsmath,amsfonts,stmaryrd,amssymb,tabstackengine} % Math packages

\usepackage{enumerate} % Custom item numbers for enumerations

\usepackage[ruled]{algorithm2e} % Algorithms

\usepackage[framemethod=tikz]{mdframed} % Allows defining custom boxed/framed environments

\usepackage{listings} % File listings, with syntax highlighting
\lstset{
    basicstyle=\ttfamily, % Typeset listings in monospace font
}

%----------------------------------------------------------------------------------------
%   DOCUMENT MARGINS
%----------------------------------------------------------------------------------------

\usepackage{geometry} % Required for adjusting page dimensions and margins

\geometry{
    paper=a4paper, % Paper size, change to letterpaper for US letter size
    top=2.5cm, % Top margin
    bottom=3cm, % Bottom margin
    left=2.5cm, % Left margin
    right=2.5cm, % Right margin
    headheight=14pt, % Header height
    footskip=1.5cm, % Space from the bottom margin to the baseline of the footer
    headsep=1.2cm, % Space from the top margin to the baseline of the header
    %showframe, % Uncomment to show how the type block is set on the page
}

%----------------------------------------------------------------------------------------
%   FONTS
%----------------------------------------------------------------------------------------

\usepackage[utf8]{inputenc} % Required for inputting international characters
\usepackage[T1]{fontenc} % Output font encoding for international characters

\usepackage{XCharter} % Use the XCharter fonts

%----------------------------------------------------------------------------------------
%   COMMAND LINE ENVIRONMENT
%----------------------------------------------------------------------------------------

% Usage:
% \begin{commandline}
%   \begin{verbatim}
%       $ ls
%       
%       Applications    Desktop ...
%   \end{verbatim}
% \end{commandline}

\mdfdefinestyle{commandline}{
    leftmargin=10pt,
    rightmargin=10pt,
    innerleftmargin=15pt,
    middlelinecolor=black!50!white,
    middlelinewidth=2pt,
    frametitlerule=false,
    backgroundcolor=black!5!white,
    frametitle={Command Line},
    frametitlefont={\normalfont\sffamily\color{white}\hspace{-1em}},
    frametitlebackgroundcolor=black!50!white,
    nobreak,
}

% Define a custom environment for command-line snapshots
\newenvironment{commandline}{
    \medskip
    \begin{mdframed}[style=commandline]
}{
    \end{mdframed}
    \medskip
}

%----------------------------------------------------------------------------------------
%   FILE CONTENTS ENVIRONMENT
%----------------------------------------------------------------------------------------

% Usage:
% \begin{file}[optional filename, defaults to "File"]
%   File contents, for example, with a listings environment
% \end{file}

\mdfdefinestyle{file}{
    innertopmargin=1.6\baselineskip,
    innerbottommargin=0.8\baselineskip,
    topline=false, bottomline=false,
    leftline=false, rightline=false,
    leftmargin=2cm,
    rightmargin=2cm,
    singleextra={%
        \draw[fill=black!10!white](P)++(0,-1.2em)rectangle(P-|O);
        \node[anchor=north west]
        at(P-|O){\ttfamily\mdfilename};
        %
        \def\l{3em}
        \draw(O-|P)++(-\l,0)--++(\l,\l)--(P)--(P-|O)--(O)--cycle;
        \draw(O-|P)++(-\l,0)--++(0,\l)--++(\l,0);
    },
    nobreak,
}

% Define a custom environment for file contents
\newenvironment{file}[1][File]{ % Set the default filename to "File"
    \medskip
    \newcommand{\mdfilename}{#1}
    \begin{mdframed}[style=file]
}{
    \end{mdframed}
    \medskip
}

%----------------------------------------------------------------------------------------
%   NUMBERED QUESTIONS ENVIRONMENT
%----------------------------------------------------------------------------------------

% Usage:
% \begin{question}[optional title]
%   Question contents
% \end{question}

\mdfdefinestyle{question}{
    innertopmargin=1.2\baselineskip,
    innerbottommargin=0.8\baselineskip,
    roundcorner=5pt,
    nobreak,
    singleextra={%
        \draw(P-|O)node[xshift=1em,anchor=west,fill=white,draw,rounded corners=5pt]{%
        Question \theQuestion\questionTitle};
    },
}

\newcounter{Question} % Stores the current question number that gets iterated with each new question

% Define a custom environment for numbered questions
\newenvironment{question}[1][\unskip]{
    \bigskip
    \stepcounter{Question}
    \newcommand{\questionTitle}{~#1}
    \begin{mdframed}[style=question]
}{
    \end{mdframed}
    \medskip
}

%----------------------------------------------------------------------------------------
%   WARNING TEXT ENVIRONMENT
%----------------------------------------------------------------------------------------

% Usage:
% \begin{warn}[optional title, defaults to "Warning:"]
%   Contents
% \end{warn}

\mdfdefinestyle{warning}{
    topline=false, bottomline=false,
    leftline=false, rightline=false,
    nobreak,
    singleextra={%
        \draw(P-|O)++(-0.5em,0)node(tmp1){};
        \draw(P-|O)++(0.5em,0)node(tmp2){};
        \fill[black,rotate around={45:(P-|O)}](tmp1)rectangle(tmp2);
        \node at(P-|O){\color{white}\scriptsize\bf !};
        \draw[very thick](P-|O)++(0,-1em)--(O);%--(O-|P);
    }
}

% Define a custom environment for warning text
\newenvironment{warn}[1][Warning:]{ % Set the default warning to "Warning:"
    \medskip
    \begin{mdframed}[style=warning]
        \noindent{\textbf{#1}}
}{
    \end{mdframed}
}

%----------------------------------------------------------------------------------------
%   INFORMATION ENVIRONMENT
%----------------------------------------------------------------------------------------

% Usage:
% \begin{info}[optional title, defaults to "Info:"]
%   contents
%   \end{info}

\mdfdefinestyle{info}{%
    topline=false, bottomline=false,
    leftline=false, rightline=false,
    nobreak,
    singleextra={%
        \fill[black](P-|O)circle[radius=0.4em];
        \node at(P-|O){\color{white}\scriptsize\bf i};
        \draw[very thick](P-|O)++(0,-0.8em)--(O);%--(O-|P);
    }
}

% Define a custom environment for information
\newenvironment{info}[1][Info:]{ % Set the default title to "Info:"
    \medskip
    \begin{mdframed}[style=info]
        \noindent{\textbf{#1}}
}{
    \end{mdframed}
}

%----------------------------------------------------------------------------------------
%   ASSIGNMENT INFORMATION
%----------------------------------------------------------------------------------------
\title{Problem with matrix alignment}
\author{Not Sure \\ \texttt{not.sure@email.com} \\ Number: \texttt{123456} }
\date{25th-Sep-2018}
\usepackage{tabstackengine}
\begin{document}
\maketitle

Equation (\ref{eqn:volt_hf_theta_esteemed}) is not aligned.

\begin{equation} \label{eqn:volt_hf_theta_esteemed}
\setstackgap{L}{22pt}
    \bracketVectorstack{\vphantom{\Big(}
        u_{dh}^{\hat{r}} \\
        u_{qh}^{\hat{r}}
    \vphantom{\Big)}}
    =
    \bracketMatrixstack{
        j\omega_h \left(L_{avg} + \frac{L_\Delta}{2}\cos(2\theta_\epsilon)\right) & j\omega_h \frac{L_\Delta}{2}\sin(2\theta_\epsilon) \\
        j\omega_h \frac{L_\Delta}{2}\sin(2\theta_\epsilon) & j\omega_h \left(L_{avg} - \frac{L_\Delta}{2}\cos(2\theta_\epsilon)\right)
    }
    \bracketVectorstack{\vphantom{\Big(}
        i_{dsh}^{\hat{r}} \\
        i_{qsh}^{\hat{r}}
    \vphantom{\Big)}}
\end{equation} % fix horiziontal alignment

\TABstackMathstyle{\displaystyle}
\begin{equation} \label{eqn:volt_hf_theta_esteemed}
\setstackgap{L}{30pt}
    \bracketVectorstack{\vphantom{\bigg(}
        u_{dh}^{\hat{r}} \\
        u_{dh}^{\hat{r}} \\
        u_{qh}^{\hat{r}}
    \vphantom{\bigg)}}
    =
    \bracketMatrixstack{
        j\omega_h \left(L_{avg} + \frac{L_\Delta}{2}\cos(2\theta_\epsilon)\right) & j\omega_h \frac{L_\Delta}{2}\sin(2\theta_\epsilon) \\
        j\omega_h \left(L_{avg} + \frac{L_\Delta}{2}\cos(2\theta_\epsilon)\right) & j\omega_h \frac{L_\Delta}{2}\sin(2\theta_\epsilon) \\
        j\omega_h \frac{L_\Delta}{2}\sin(2\theta_\epsilon) & j\omega_h \left(L_{avg} - \frac{L_\Delta}{2}\cos(2\theta_\epsilon)\right)
    }
    \bracketVectorstack{\vphantom{\bigg(}
        i_{dsh}^{\hat{r}} \\
        i_{dsh}^{\hat{r}} \\
        i_{qsh}^{\hat{r}}
    \vphantom{\bigg)}}
\end{equation} % fix horiziontal alignment

\end{document}

enter image description here

  • Your solution worked, but as you predicted now I have problems with the brackets. How do I fix this using the \vphantom command? Also I forgot to mention that I downloaded my text structure from a pre-compiled list of templates. The template is latextemplates.com/template/lachaise-assignment this one. – NotSure Sep 25 '18 at 9:18
  • @NotSure Please see my edit. – Steven B. Segletes Sep 25 '18 at 9:58
2

The \left and \right provided brackets are too big. The first attempt uses them; the second one uses \bigl and \bigr instead, which are the best size in this case, but the output is too crowded; finally, the third approach mixes the two.

\documentclass[a4paper, 11pt]{article}
\usepackage{amsmath}

\begin{document}

\section{With \texttt{\string\arraystretch}}

\begin{equation*}
\renewcommand{\arraystretch}{1.5}
\begin{bmatrix}
  u_{dh}^{\hat{r}} \\
  u_{qh}^{\hat{r}}
\end{bmatrix}
=
\begin{bmatrix}
  j\omega_h \left((L_{\mathrm{avg}} + \frac{L_\Delta}{2}\cos(2\theta_\epsilon)\right) 
  &
  j\omega_h \frac{L_\Delta}{2}\sin(2\theta_\epsilon) \\
  j\omega_h \frac{L_\Delta}{2}\sin(2\theta_\epsilon)
  &
  j\omega_h \left(L_{\mathrm{avg}} - \frac{L_\Delta}{2}\cos(2\theta_\epsilon)\right)
\end{bmatrix}
\begin{bmatrix}
  i_{dsh}^{\hat{r}} \\
  i_{qsh}^{\hat{r}}
\end{bmatrix}
\end{equation*}

\section{With \texttt{\string\big}}

\begin{equation*}
\begin{bmatrix}
  u_{dh}^{\hat{r}} \\
  u_{qh}^{\hat{r}}
\end{bmatrix}
=
\begin{bmatrix}
  j\omega_h \bigl((L_{\mathrm{avg}} + \frac{L_\Delta}{2}\cos(2\theta_\epsilon)\bigr) 
  &
  j\omega_h \frac{L_\Delta}{2}\sin(2\theta_\epsilon) \\
  j\omega_h \frac{L_\Delta}{2}\sin(2\theta_\epsilon)
  &
  j\omega_h \bigl(L_{\mathrm{avg}} - \frac{L_\Delta}{2}\cos(2\theta_\epsilon)\bigr)
\end{bmatrix}
\begin{bmatrix}
  i_{dsh}^{\hat{r}} \\
  i_{qsh}^{\hat{r}}
\end{bmatrix}
\end{equation*}

\section{With \texttt{\string\big} \emph{and} \texttt{\string\arraystretch}}

\begin{equation*}
\renewcommand{\arraystretch}{1.2}
\begin{bmatrix}
  u_{dh}^{\hat{r}} \\
  u_{qh}^{\hat{r}}
\end{bmatrix}
=
\begin{bmatrix}
  j\omega_h \bigl((L_{\mathrm{avg}} + \frac{L_\Delta}{2}\cos(2\theta_\epsilon)\bigr) 
  &
  j\omega_h \frac{L_\Delta}{2}\sin(2\theta_\epsilon) \\
  j\omega_h \frac{L_\Delta}{2}\sin(2\theta_\epsilon)
  &
  j\omega_h \bigl(L_{\mathrm{avg}} - \frac{L_\Delta}{2}\cos(2\theta_\epsilon)\bigr)
\end{bmatrix}
\begin{bmatrix}
  i_{dsh}^{\hat{r}} \\
  i_{qsh}^{\hat{r}}
\end{bmatrix}
\end{equation*}

\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.