I have to create something that looks like this:
\begin{frame}[fragile]{frame title}
lorem ipsum ...
\end{frame}
Note that the portion [fragile]
is optional. That is, if I enter some text in the $1
placeholder, it should include the brackets. If I don't enter text in the $1
placeholder, I don't want the brackets at all.
I'm not sure how to make the $1
placeholder optional. So far I've created this snippet, which does everything except the optional part.
snippet frame "frame environment" b
\begin{frame}[$1]{${2:frame title}}
${0:${VISUAL}}
\end{frame}
endsnippet
How can I make an optional placeholder that disappears when no text is given?