[OS X TeX] Checking pairs (parentheses, brackets etc) in TeXShop, a feature request

Herbert Schulz herbs at wideopenwest.com
Fri May 26 06:58:27 EDT 2017


> On May 26, 2017, at 4:47 AM, Robert Blackstone <blackstone.robert at gmail.com> wrote:
> 
> Good morning,
> My question is in fact directed primarily at the maker of TeXShop, but it might be relevant to know if there are other Mac OSX TeX-users on his list with the same wish. 
> 
> Since about a year TeXShop has also become my preferred editor for LilyPond (as for all TeX-things ). 
> One of its best features for this type of work is its marvelous system of checking pairs, of brackets, braces and parentheses, by displaying this yellow field when one enters the area between the pair from one side or the other. 
> 
> I wonder if it would be possible to add this feature to < > and << >> , essential pairs in LilyPond code.
> 
> I realize that I could use a trick by entering, for example, [*<<   >>*] instead of << >> and later find and replace all [*<<  and >>*]'s by <<  and >> respectively.
> Or I could type or paste the code section with << >> pairs in, for example, Smultron or Frescobaldi for a match-check, but this does not work in these editors when the opening and the closing half of the pair are far apart.
> 
> So it would be wonderful to have this match-check also for < >  as a native feature in TeXShop. 
> 
> Thanks in advance for any help or advice.
> 
> Best regards,
> 
> Robert Blackstone

Howdy,

The < > pair highlighting is a setting in the `Parens Targets & Highlight Color' section of the Source tab in TeXShop->Preferences. But, as Bruno pointed out, there are possible problems. The problem doesn't exist with things like 
\left\{...\right\vert because the search is smart enough to not count the { if it is preceeded by the \.

Of course if you match < > you will also match << >> but each individual enclosed pair. 

It might be worth you while to create Macros that insert matched pairs setting the insertion point between the pairs so you are more or less guaranteed to match them up to begin with.

Good Luck,

Herb Schulz
(herbs at wideopenwest dot com)




More information about the MacOSX-TeX mailing list