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.

Is there a way to have a pmatrix environment from amsmath use non-whitespace delimiters such as a comma? I am mainly asking, because I would like to make a row vector this way. I take it, there are essentially two ways of doing something like that:

\documentclass{standalone}
\usepackage{mathtools}

\begin{document}
\begin{gather*}
    a = \left(1,2,3\right) \\
    b = \begin{pmatrix} 1, & 2, & 3 \end{pmatrix}
\end{gather*}
\end{document}

Now, especially the second part does not look too pretty: enter image description here

share|improve this question
1  
Possible Duplicate: Typesetting coordinates –  Peter Grill May 16 '12 at 19:12
    
Answer is given by: tex.stackexchange.com/a/53961/6993 –  mSSM May 16 '12 at 19:14
    
That actually reminds me: An even more elegant solution would be using the following from mathtools: \DeclarePairedDelimiter{\Vector}{\lparen}{\rparen}. –  mSSM May 16 '12 at 19:17
    
Isn't that the same question I linked to? –  Peter Grill May 16 '12 at 19:31
    
Yeah, I just wanted to point out the actual answer from that link. :) –  mSSM May 16 '12 at 22:15
add comment

1 Answer

up vote 1 down vote accepted

http://tex.stackexchange.com/a/53961/6993 provides one solution. It also reminded me of \DeclarePairedDelimiter from mathtools:

\documentclass{standalone}
\usepackage{mathtools}
\DeclarePairedDelimiter{\Vector}{\lparen}{\rparen}

\begin{document}
\begin{gather*}
    a = \left(1,2,3\right) \\
    b = \begin{pmatrix} 1, & 2, & 3 \end{pmatrix}
    c = \Vector{1,2,3}
\end{gather*}
\end{document}

A starred version \Vector* would precede \lparen and \rparen by \left and \right, respectively.

enter image description here

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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