# Block matrix with vectors

I'm trying to typeset matrices composed of row vectors like this:

It uses a bar to represent row vectors. I'd also like vertical bars to represent column vectors. What is the best way to achieve this?

Thanks to @Przemysław's answer. Here is also how to typeset the original matrices (with dots):

$\mathrm{d}\left[ \begin{array}{c@{\,}c@{\,}c} & \vdots & \\[3pt] \raisebox{3pt}{\rule{5mm}{0.2pt}} & \rule{0mm}{10pt} cR & \raisebox{3pt}{\rule{5mm}{0.2pt}}\\[3pt] & \vdots & \end{array} \right]=c\mathrm{d}\left[ \begin{array}{c@{\,}c@{\,}c} & \vdots & \\[3pt] \raisebox{3pt}{\rule{5mm}{0.2pt}} & \rule{0mm}{10pt} R & \raisebox{3pt}{\rule{5mm}{0.2pt}}\\[3pt] & \vdots & \end{array} \right]$


Changing \vdots to \vline produces the column vectors.

An example of tle left-hand side (exact parameters to be chosen):

\documentclass{article}
\begin{document}

$\mathrm{d}\left[ \begin{array}{c@{\,}c@{\,}c} & \vline & \\[3pt] \raisebox{3pt}{\rule{5mm}{0.2pt}} & \rule{0mm}{10pt} cR & \raisebox{3pt}{\rule{5mm}{0.2pt}}\\[3pt] & \vline & \end{array} \right]$

\end{document}


• Why not write \rule[3pt]{5mm}{0.2pt} instead of using \raisebox{...}{...}? – A.Ellett Oct 19 '13 at 19:54
• @A.Ellett In case when one wants to use, e.g., \hrule. – Przemysław Scherwentke Oct 19 '13 at 20:11

This solution uses rules, as well, but puts it all together with a stack.

\documentclass{article}
\usepackage[usestackEOL]{stackengine}[2013-10-15]
\def\vbr{\rule[-\dp\strutbox]{.7pt}{\ht\strutbox+\dp\strutbox}}
\def\hbr{\rule[.5\ht\strutbox-.5\dp\strutbox]{2.2em}{.7pt}}
\begin{document}
$\mathrm{d}\bracketVectorstack{\vbr\\\vbr\\\hbr\mathop{cR}\hbr\\\vbr\\\vbr}= c\,\mathrm{d}\bracketVectorstack{\vbr\\\vbr\\\hbr\mathop{R}\hbr\\\vbr\\\vbr}$
\end{document}


• Thank you for your help, but it says ! Undefined control sequence. \@readMANYrows ...ROWcellindex@}{0}\whileboolexpr{test {\nottoggle {@doneRO... l.7 ...vbr\\\vbr\\\hbr\mathop{cR}\hbr\\\vbr\\\vbr}. I'm using the stackengine.sty from ctan.mackichan.com/macros/latex/contrib/stackengine/…. – Yang Oct 20 '13 at 1:30
• @Yang Is it possible that your etoolbox` package is out of date? – Steven B. Segletes Oct 20 '13 at 1:47