TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to set up a snippet for building a set with appropriate spacing. I want the snippet to generate the following markup when I type "set" + TAB:

\{ \, content here \, \}

I have the following snippet:

\{\, ${1} \,\}

However, this produces the following:

{\,  \,}

It's escaping the first backslash and the last one. Any ideas on how to prevent this?

share|improve this question
Can you provide some additional information like which editor you are using etc? – Stefan Waldmann Mar 2 '13 at 9:37
Sublime Text 2 on OS X. – ohBoy Mar 2 '13 at 9:45
I don't know which language uses, but usually you need \\{\, ${1} \,\\} to avoid escaping the backslash. Try an look if it works. (In TextMate, for example, it works that way.) – Manuel Mar 2 '13 at 10:52
Bingo, that works. If you'd like to submit that as the answer, I'll mark it. – ohBoy Mar 2 '13 at 12:43
@Manuel Can you turn your comment into an answer, please? – egreg May 4 '13 at 21:15
up vote 1 down vote accepted

Note: I turned this into an answer following @egreg 's suggestion. This is not a very clear/correct answer (I let anyone to edit and correct it), but based (only) on my experience in TextMate.

You need to avoid escaping the backslash, which is “usually” done with \\{\, ${1} \,\\}.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.