# How can I write a emacs command that inserts a text with a variable string at the current cursor position? – Super User

The best answers to the question “How can I write a emacs command that inserts a text with a variable string at the current cursor position?” in the category Super User.

QUESTION:

I would like to write an elisp emacs command that inserts a fixed string that contains a variable part at the current cursor position:

\label{$STRING} \index{\nameref{$STRING}}