2

To indicate that a vector represents a column of a matrix, we can write

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[paper=letterpaper,margin=1.5in]{geometry}
\usepackage{amsmath, amssymb, amsthm}
\begin{document}

\[
\begin{bmatrix}
    \vert & \vert \\
    \vec{u} & \vec{v} \\
    \vert & \vert
\end{bmatrix}
\]

\end{document}

To achieve Vertical indicator

How can I do the same to indicate a vector represents a row (looks like Horizontal Indicator)?

Detexify doesn't return anything that looks like what I want (it thinks I'm drawing an underscore).

  • 1
    welcome to tex.se! please always provide complete small document beginning with \documentclass and \end{document} on the end. see, if [-\; \vec{v}\; - ] gives what you looking for (so far i didn't see such notations for vectors ...) – Zarko Oct 10 '18 at 15:26
  • 2
    Even without \vert it makes complete sense that a vertical (or horizontal) vector would span multiple columns. – Werner Oct 10 '18 at 15:34
  • I added images for reference. @Zarko, what you suggested works for me, but do you know if there's a command similar to \vert but generates a horizontal line so I don't have to add the extra semicolons? As an analogy, I'm looking for a command that is to \vert like what \hdots is to \vdots. – lynshi Oct 11 '18 at 1:42
  • no, i don't know. but probably it can be composed from some elements or drawn, for example with use of the package nicematrix. however, your notation is strange. for similar purposes are usually use \dots, \vdots, \ddots etc. – Zarko Oct 11 '18 at 1:57
2

You can rotate a \vert, so you get the same thickness.

\documentclass{article}
\usepackage{amsmath}
\usepackage{graphicx}

\newcommand{\brows}[1]{%
  \begin{bmatrix}
  \begin{array}{@{\protect\rotvert\;}c@{\;\protect\rotvert}}
  #1
  \end{array}
  \end{bmatrix}
}
\newcommand{\rotvert}{\rotatebox[origin=c]{90}{$\vert$}}
\newcommand{\rowsvdots}{\multicolumn{1}{@{}c@{}}{\vdots}}

\begin{document}

\[
\begin{bmatrix}
    \vert & \vert \\
    \vec{u} & \vec{v} \\
    \vert & \vert
\end{bmatrix}
+
\brows{a_1^T \\ a_2^T \\ \rowsvdots \\ a_n^T}
\]

\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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