1

I understand that environments are very nice where the content is complex. But for simple cases, the \begin and \end and duplication of the environment name gets quite wordy and dominates the actual content.

Is there a non-environment command to create a matrix, like exists for \frac?

Compare:

\begin{bmatrix}
      \chi_2 \\
      \chi_3
\end{bmatrix} = \chi_1 + \begin{bmatrix}
                             t_2 - t_1 & 0 \\
                             t_3 - t_1 & t_3 - t_2
                         \end{bmatrix} \begin{bmatrix}
                                            \nu_1 \\
                                            \nu_2
                                       \end{bmatrix}

to a hypothetical

\bcolvec{\chi_2}{\chi_3}
       = \chi_1 + \inbmatrix{t_2 - t_1 & 0}{t_3 - t_2 & t_2 - t_1} \bcolvec{\nu_2}{\nu_3}
Ben Voigt
  • 593
  • 1
    You can define it: \newcommand*\bcolvec[2]{\begin{bmatrix}#1\\#2\end{matrix}}. – Manuel Feb 02 '14 at 21:01
  • @Manuel: Any way to have a variable number of rows? (whether auto-detected or I have to supply the row count as an argument) If you can write a command to do that it would be an answer. – Ben Voigt Feb 02 '14 at 21:05
  • 3
    @BenVoigt if you want multiple rows just define \newcommand*\bcolvec[1]{\begin{bmatrix}#1\end{matrix}} and use \bcolvec{a\\b\\c\\d} – David Carlisle Feb 02 '14 at 21:06
  • @DavidCarlisle -- better make that \end{bmatrix} instead of just matrix. – barbara beeton Feb 02 '14 at 21:46
  • 3
    There are a few questions and answers that deal with column vectors: http://tex.stackexchange.com/questions/2705/typesetting-column-vector and http://tex.stackexchange.com/questions/39051/typesetting-a-row-vector – egreg Feb 02 '14 at 21:53
  • thanks @egreg. I think I may just go with the simple \newcommand*\bmtx[1]{\begin{bmatrix}#1\end{bmatrix}} – Ben Voigt Feb 02 '14 at 22:06

0 Answers0