7

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

enter image description here

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]
\]

enter image description here

Changing \vdots to \vline produces the column vectors.

2 Answers 2

7

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}

enter image description here

2
  • 1
    Why not write \rule[3pt]{5mm}{0.2pt} instead of using \raisebox{...}{...}`?
    – A.Ellett
    Commented Oct 19, 2013 at 19:54
  • @A.Ellett In case when one wants to use, e.g., \hrule. Commented Oct 19, 2013 at 20:11
3

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}

enter image description here

2
  • 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
    Commented Oct 20, 2013 at 1:30
  • @Yang Is it possible that your etoolbox package is out of date? Commented Oct 20, 2013 at 1:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .