6

I want to typeset one-element vectors like so:

enter image description here

In this example, v and ware vectors. In the first line I used pmatrix, but the expression c(v) could easily be mistaken to mean "function c of v" because the brackets are regular size. So even if the vectors contain only one element, I would like them to look like in the second line. However, if they contain more elements the brackets should grow in size.

Ideally, I would like to be able to say

\begin{pmatrix}[min=\bigg]
\end{pmatrix}

MWE:

\documentclass{article}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage{scrpage2, setspace, geometry}
\usepackage{textcomp, relsize, url}
\usepackage{xcolor, minitoc, tocloft}
\usepackage{amsmath, amsthm, amssymb, bbold, stmaryrd, latexsym}
\usepackage{array, booktabs, dcolumn, colortbl, longtable, multirow, bigdelim}


\begin{document}
$$x = c\begin{pmatrix}v\end{pmatrix} + d\begin{pmatrix}w\end{pmatrix}$$
$$x = c\bigg(\begin{matrix}v\end{matrix}\bigg) + d\bigg(\begin{matrix}w\end{matrix}\bigg)$$
\end{document}
  • Parentheses being overloaded is one of the reasons why I prefer brackets for column vectors and matrices. – egreg Sep 15 '16 at 11:00
  • For me, it's one of the reasons to always indicate multiplication with a $\cdot$, and not write function application with unnecessary parentheses. $f\:x$ is just as good as $f(x)$, and $c\cdot \vec{v}$ is certainly a lot clearer than any $c\Bigl( v\Bigr)$ hocus pocus. – leftaroundabout Sep 15 '16 at 15:51
7

You can define your own environment:

\documentclass{article}
\usepackage{amsmath}

\newenvironment{vect}
 {\left(\vphantom{\bigg|}\begin{matrix}}
 {\end{matrix}\right)}

\begin{document}

\[
x = c\begin{vect}v\end{vect} + d\begin{vect}w\end{vect}
\]

\[
\begin{vect}
a
\end{vect}
\quad
\begin{vect}
a \\ b
\end{vect}
\quad
\begin{vect}
a \\ b \\ c
\end{vect}
\]

\end{document}

Never use $$ with LaTeX.

enter image description here

Frankly, this doesn't really sound like a nice idea.

  • Why don't you like it? – alexraasch Sep 15 '16 at 11:19
  • 3
    @alexraasch (IMHO) Relying on the size of parentheses as the only indicator of something is poor typography, the ambiguity isn't removed by this completly, for example I will now be curious why are your parentheses so stupidly large, but I wouldn't think that it's because you want to indicate a 1-dimensional vector this way. – yo' Sep 15 '16 at 11:26
  • @yo': Ok, I agree. However, I'm not at liberty to change to, e.g., square brackets at the moment, as I am not the principal author of the article I'm writing. – alexraasch Sep 15 '16 at 11:38
  • @alexraasch Having your own environment allows you to change the final format as you like without modifying the input file, except for the definition of vect. – egreg Sep 15 '16 at 11:47

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.