Sign up ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Mathematicians would often to like to think of a row of a m by n matrix with entries from a , say, field, as a vector in the n-dimensional vector space over the field.

Though I am not a mathematician yet, I am stuck with a situation where my proof becomes significantly simpler if I did not care about the entries of the row but just think of it as a vector.

For instance, I'd like my rows to look like how the columns look here. The code for one of the matrices there:

\biggl |& \biggl|&\biggl|\\
x_1&x_2 &x_3\\

I'd be grateful if some one helped me.

share|improve this question

2 Answers 2

up vote 8 down vote accepted

Here's a way, inspired by \rightarrofill:



\llongdash & x_{1}   & \rlongdash \    \llongdash & x_{2}+y & \rlongdash \    \llongdash & x_{n}   & \rlongdash

I use \llongdash and \rlongdash to back up slightly and so to ensure the correct alignment of the dashes.

enter image description here

If dots are needed for denoting omitted rows, one can use \hdotsfor:

\llongdash & x_{1}   & \rlongdash \\
\llongdash & x_{2}+y & \rlongdash \\
\hdotsfor{3} \\
\llongdash & x_{n}   & \rlongdash

instead of the code above will produce

enter image description here

Alternatively, one can use only one column

\longdash\hfill x_{1} \hfill \longdash \    \longdash\hfill x_{2} + y \hfill \longdash \    \longdash\hfill x_{n} \hfill \longdash \    \end{bmatrix}

and get

enter image description here

share|improve this answer
Thank you very much. – kan May 26 '12 at 13:09

Here is a solution based on TikZ:


% possible to customize here the dash aspect

\matrix(m)[matrix of math nodes,left delimiter=(,right delimiter=),ampersand replacement=\&]
\mydash \&   y_1 \&   \mydash   \\
\mydash \&   y_2+z_2 \&  \mydash    \\
\mydash \&   y_3 \&   \mydash \\


which gives:

enter image description here

share|improve this answer
Thank you very much. I am not good with Tikz yet. But, I thank you for posting a solution. :) – kan May 26 '12 at 13:11

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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