I write a snippet to insert a theorem environment into a latex document, based upon some snippets created by another project: https://github.com/madsdk/yasnippets-latex .
In the snippet below, the snippet is inserted and emacs prompts the user to input some information for the label. What I wanted to do was get a second prompt ${2}
that asks the use for the name of the theorem--which will go into the second marked item in the snippet.
# -*- mode: snippet -*-
# contributor: kb
# key: thrm
# group: math
# name: theorem
# --
\begin{thrm}[${2}]
\label{${1:"waiting for reftex-label call..."$(unless yas/modified-p (reftex-label nil 'dont-insert))}}
$0
\end{thrm}
I tried to emulate input for ${1}
in ${2}
, but the snippet failed to compile or execute. I suspect I just need a different function that takes an input instead of reftex-label
but I am not familiar enough with elisp to know which one.
Any suggestions?