How to insert \left(
\right)
by simply typing e.g. 'cmd+m' on Texshop.
As an example:
write 2+2
and then 'cmd+m' and the output is:
\left(2+2\right)
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 communityAlthough, the left
and right
are not needed in this specific example, I was looking for a way to create my own macro and this was the first question the popped up. Now that I have figured it out, here is how you would create such a macro in TexShop:
In TeXShop go to Macros/Open Macro Editor
and a window
Select:
Chose a name and in the Content:
section type
\left(#SEL#\right)#INS#
and select your shortcut key as b
(m
is used to minimize the window):
Select:
Optional: Next time you go back into the Macro Editor you will see your custom macro listed and selecting it will show you the contents:
Now if you highlight the 2+2
:
hit ⌘b you obtain the desired results:
#sel#
portion is represents the selected text and the #INS#
defines where the cursor should be after the macro completes. You can select other commands and see how they are coded if you desire to define a more elaborate macro.
\left
and\right
next to the parentheses.