It seems possible to have ultisnips produce a dynamically sized array as specified here:
https://github.com/SirVer/ultisnips/blob/master/doc/examples/tabstop-generation/README.md
The array environment created however comes prespecified with l
eft alignment on each of the columns as indicated in the example here. The snippet code that produces this is:
post_jump "create_matrix_placeholders(snip)"
snippet 'arr(\d+),(\d+)' "LaTeX array" br
\begin{array}{`!p
orient = ""
for _ in range(0, int(match.group(1))): orient += "l"
snip.rv = orient`}
`!p
snip.rv = create_matrix(match.group(1), match.group(2), "&", "\t", "\\\\\\\\\n")
`$0
\end{array}
endsnippet
Is it possible to modify this snippet so that we only have \begin{array}{|}
where |
is the first placeholder stop $1
so that the user can specify whether one needs l
eft or c
enter or r
ight alignment for each column?