Macro: Put Curly Brackets Around Word, for LaTeX and other Markdown

Simple but useful Macro to put curly brackets round a word you have just finished typing

This is a modification of an expansion I saw on Mac Power Users Discourse by an user called @Ferrers.
One can also trigger it if the cursor is put on a word. But for LaTeX and similar mark up programs where the use of these brackets are common, it can be triggered immediatly after one finishes typing the word. I find it is very time saving but I use curly brackets a lot. It is simple enough that I think an image will suffice. To my surprise I don't see a similar macro here, but I might just have missed one, the principle is probably embedded in some other macro here too but harder to find. I use a very simple trigger too. Again my heavy use of this means that is justifiable. If this is already been done here I trust one of the moderators will delete or move this as a modification of another Macro or whatever.

That's fine, but the general practice here is to upload both the macro file and image.

Thanks for sharing. :+1:

Don't worry about whether or not someone else has posted something similar. Always feel free to post your version.

Simple is good. :smile:
The only concern I would have about your trigger is that it does not allow for a word to end with "xc". That's probably unlikely, but it might happen.

That's why I have a typed string naming convention of:
so ๐– means ending with one SPACE character.

So the combination of a prefix of ";" and suffix of ๐– pretty much ensures that I would never want to have my trigger string as text in my document.

So, for example, I would use:

I use the "l." as a prefix for all of my LaTeX snippets, but if I used the curly brackets very often, I might also have a shorter trigger of just

That's just my naming convention that works for me. It may or may not work for you.

1 Like

gotcha, I see the reasoning. I will adapt something like that for ones I post. I posted it again with the actual macro as I can't work out how to get it into the original post. You can delete this one I guess? We put you to a lot of trouble sometimes! I took your suggestion re the trigger too.

1 Like

@JMichaelTX I took your advice with the trigger. I noticed soon after a word that would have triggered the old one. "exchange" :grinning:

1 Like