[Tex/LaTex] representation of vector and matrix in latex

matricesvector

i'm working on my latex thesis and i want to represent this equation, matrix is upperCase letter with 2 lines under it, and vector just one line below, see the picture attached enter image description here

can someone help me out with a way to represent it

Best Answer

The immediate problem can be solved with an array, with a local setting of \arraystretch for reducing the gap between the two rows.

\documentclass{article}
\usepackage{amsmath,bm}

% old fashioned notation for the old fashioned supervisor
\newcommand{\vect}[1]{\underline{#1}}
\newcommand{\matr}[1]{\underline{\underline{#1}}}

% better for typesetting
%\newcommand{\vect}[1]{\mathbf{#1}} % or \bm
%\newcommand{\matr}[1]{\mathbf{#1}} % or \bm

\begin{document}

Here $\vect{Q}$ and $\vect{w}$ are column vectors and $\matr{A}$ is a matrix
\[
\renewcommand{\arraystretch}{0.7}
\begin{array}{@{} c @{} c @{} c @{\;} c @{}}
\vect{Q} & {}={} & \matr{A} & \vect{w} \\
\scriptscriptstyle m\times 1 &&
\scriptscriptstyle m\times n &
\scriptscriptstyle n\times 1
\end{array}
\]

\end{document}

enter image description here

I strongly advise to use macros for inputting matrices and vectors. When your supervisor will realize that the old-fashioned notation is also very ugly in print (it was used in the typewriter times), you can simply change the definitions. If you switch the comments in the code above, the result will be

enter image description here

without changing the code in the document body.

Related Question