3

I would like to use Yasnippet to insert the template for a latex inline equation: \( \)

The snippet is defined:

 # -*- Mode: snippet -*- # name: inline equation # key: ineq # -- \( \) 

But Yasnippet inserts only the parentheses ( ) without the backslashes. Any suggestions?

1
  • 1
    You need to escape the backslash with another backslash Commented Apr 15, 2017 at 1:46

1 Answer 1

4

The backslash is used in regular expressions to escape individual characters:

For the most part, \ followed by any character matches only that character.

So \( gives you ( in your output. To get the backslash in the output, escape it:

\\( \\) 
1

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.