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?
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It only takes a minute to sign up.
Sign up to join this communityI 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?
Go to Macros -> Edit Macros ...
and add a new entry:
Notes:
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
cursor.deleteChar()
editor.write("\\left(")
to delete the additionally inserted )
You can add a similar macro one for ))
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
cursor.deleteChar()
editor.write("\\left\( \\right\)")
cursor.movePosition(8,cursorEnums.Left)
will put the cursor between \left
and \right
.