# Horizontal line representing row vector in matrix

I would like to produce a graphical representation of a matrix as stack of row vectors. Because I will be publishing the math on a website, I have access to the amsmath package but no others. I find that I can produce a representation of a matrix as a stack of column vectors using the following code

\left(
\begin{array}{ccc}
\vline & \vline & \vline \\
\vline & \vline & \vline \\
\vline & \vline & \vline \\
\end{array}
\right)


What I would like is a transpose of this.

This question is similar to How do I typeset vertical and horizontal lines inside a matrix? and Long dashes for denoting omitted columns of a matrix, but when I apply the approaches found in those posts, I do not obtain a continuous horizontal line.

-
Not great, but try \left(\begin{array}{ccc} & & \\ \hline & & \\ \hline & & \\ \hline & & \end{array} \right) – Vivi Jun 12 '12 at 19:02
Welcome to TeX.SX! Just use one column and say \rule[2.2pt]{4em}{0.4pt} in each row. Here 4em is the width, adjust to suit. – egreg Jun 12 '12 at 19:03
In essence, what @egreg says is the same as what the accepted answer to the first linked question proposes. Can you say more precisely what your problems with this approach are? – Hendrik Vogt Jun 12 '12 at 19:09
@egreg Thanks! That would seem to do the trick. – dsmith Jun 13 '12 at 21:14
@Hendrik Yes, I agree now. I think I didn't understand the answer well enough at the time I posted. – dsmith Jun 13 '12 at 21:16

Saying simply \vline is not the best method, in my opinion. Try

\documentclass{article}
\usepackage{amsmath}

\begin{document}
$\begin{pmatrix} \kern.6em\vline & \kern.2em\vline\kern.2em & \vline\kern.6em \\ \kern.6em\vline & \kern.2em\vline\kern.2em & \vline\kern.6em \\ \kern.6em\vline & \kern.2em\vline\kern.2em & \vline\kern.6em \\ \end{pmatrix} \begin{pmatrix} \rule[.5ex]{3.5em}{0.4pt}\\ \rule[.5ex]{3.5em}{0.4pt}\\ \rule[.5ex]{3.5em}{0.4pt} \end{pmatrix}$
\end{document}


-

Here is a mild mockup of two different approaches that doesn't require amsmath. The second requires graphicx though. It duplicates your existing column representation, just horizontally:

\documentclass{article}
\usepackage{graphicx}% http://ctan.org/pkg/graphicx
\begin{document}
$\left( \begin{array}{ccc} \vline & \vline & \vline \\ \vline & \vline & \vline \\ \vline & \vline & \vline \end{array} \right) \quad \left( \begin{array}{p{3em}} \raisebox{.5ex}{\rule{3em}{.4pt}} \\[\dimexpr-2\normalbaselineskip+2\tabcolsep] \raisebox{.5ex}{\rule{3em}{.4pt}} \\[\dimexpr-2\normalbaselineskip+2\tabcolsep] \raisebox{.5ex}{\rule{3em}{.4pt}} \end{array} \right)$
$\left( \begin{array}{ccc} \vline & \vline & \vline \\ \vline & \vline & \vline \\ \vline & \vline & \vline \end{array} \right) \quad \left( \begin{array}{c} \rotatebox{90}{ \begin{array}{ccc} \vline & \vline & \vline \\ \vline & \vline & \vline \\ \vline & \vline & \vline \end{array}} \end{array} \right)$
\end{document}

-