Take the 2-minute tour ×
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.

This question already has an answer here:

Ok, so I am trying to find a way to make this matrix shown here, in LaTeX:

enter image description here

I tried to search for this type, but I frankly do not know what one would call this, so I had to draw a picture shown here to illustrate what I mean. So basically, I want a matrix, but I need to make lines as rows as shown here, with the respective $$x_i^T$$ shown as well.

Would appreciate any help, thanks.

share|improve this question

marked as duplicate by Count Zero, David Carlisle, diabonas, mafp, egreg Apr 10 '13 at 21:33

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

3  
Hello! I had this question a little while ago: tex.stackexchange.com/q/57411/10679. Hope this helps! –  kan Apr 10 '13 at 20:14
    
@kan Never mind it works! Question - how to change to make it vertical lines? Thanks!! –  TyranaSaur Apr 10 '13 at 20:36
1  
Oh, I think the code in question shows how there is an easy code for vertical lines using \bigg|. There is no such easy solution for the horizontal lines, which motivated the question. –  kan Apr 10 '13 at 20:51
    
@kan Thanks again! I have a second part to this question here. –  TyranaSaur Apr 10 '13 at 20:57
add comment

1 Answer

I'm not sure the following is the best of doing it, but here goes:

enter image description here

\documentclass{article}

\usepackage{amsmath}

\newcommand\myrule[1]{%
    \raisebox{.5ex}{\rule{3em}{.7pt}}
    \, #1 \,
    \raisebox{.5ex}{\rule{3em}{.7pt}}
}

\begin{document}
 \begin{equation}
    X =
    \begin{bmatrix}
     \myrule{x_1^T} \\[1ex]
     \myrule{x_2^T} \\[1ex]
     \myrule{x_3^T}
    \end{bmatrix}
     \end{equation}     
\end{document}
share|improve this answer
    
Interesting Jubobs. I have tried it and it seems to work. Expanding on this, how would I be able to make something as shown here? Thanks. –  TyranaSaur Apr 10 '13 at 21:12
add comment

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