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 noticed in this post, when the user hits (( what actually generates in the editor is \left( \right), where the cursor is positioned between the first parenthesis and before \right.

How does one do this with TeXStudio?

share|improve this question
up vote 2 down vote accepted

Go to Macros -> Edit Macros ... and add a new entry:

enter image description here


  • The slashes in the trigger are necessary, because it's a regexp.
  • You may want to disable Configure -> Advanced Editor -> Special Options -> Auto Complete Parentheses. Otherwise, you'll have an additional ) from the auto completion of the first (. Alternatively, you could switch the type from Normal to Script, and use


    to delete the additionally inserted )

  • You can add a similar macro one for ))

share|improve this answer
You should probably move the cursor back after editor.write... – Bach May 28 at 8:39

Just to add to Tim's answer, using script may be advantageous because it still allows auto completion of single parenthesis. Do typing (( using the following

editor.write("\\left\(  \\right\)")

will put the cursor between \left and \right.

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.