I've been trying to create a function to write a bmatrix in which I pass as argument 1: initial vector position; 2: final vector position.
\def\writeV#1#2{{
\begin{pmatrix}
\foreach \i in {#1,...,#2}{
1\\2
}
\end{pmatrix}
}}
This is a simplification. Since there is a third argument where I have some values stored, and therefore I would access such data by using the variable \i. But for the purpose of the question with 1\2 should be enough.
The problem as far as I read is about "\\" and because \foreach is not expandable... I am not an expert in LaTex so I apreciate if someone can break it down simply. I read that it might work with the package "xparse".
Finally, this is my first post so any editions of the thread are welcome!