please look at the following example:

```
\documentclass{book}

\usepackage{xparse}
\usepackage{amsmath}

\makeatletter

\NewDocumentCommand{\vv}{ s > { \SplitList { ; } } m }%
 {\begin{pmatrix}%
\ProcessList{#2}{\@vv}%
  \end{pmatrix}%
  \@firstitemtrue}

\newif\if@firstitem
\@firstitemtrue
\NewDocumentCommand{\@vv}{ m }%
 {\if@firstitem%
    \@firstitemfalse%
  \else%
 \\%
  \fi%
  #1}

\makeatother

\begin{document}

The vector is printend wrong:
\begin{equation}
  \vv{a;b;c;d;e;f;g}
\end{equation}

It should look like:
\begin{equation}
  \begin{pmatrix}
 a \\ b \\ c \\ d \\ e \\ f \\ g
  \end{pmatrix}
\end{equation}

\end{document}

```

I tried to define a macro to typeset vectors comfortably. But something went wrong as you can see on the picture.

[![enter image description here](https://i.stack.imgur.com/W0apw.png)](https://i.stack.imgur.com/W0apw.png)

Any ideas how to solve the problem?