Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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:

<snippet>
<content><![CDATA[
\{\, ${1} \,\}
]]></content>
<tabTrigger>set</tabTrigger>
</snippet>

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

1 Answer 1

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

 
discard

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.