[OS X TeX] Feature Request Math Bracket

Charilaos Skiadas cskiadas at gmail.com
Sat Mar 15 12:24:51 CET 2008


On Mar 14, 2008, at 10:53 PM, Richard Seguin wrote:

> Thanks for the advice!
>
> The autocompletion might work for me for $ ... $ strings because I  
> don't use  $$ ... $$ (I generally use \begin{equation*} \tag{} ...  
> \end{equation*}). On the other hand, at the moment I"m writing in- 
> line math strings at a high density, and if I used the  
> autocompletion I would have to right-arrow out of every single one  
> of them when I"m done.

The way I have solved this in TextMate is to record a macro that is  
triggered only when inside a math environment, and is bound to the $  
key. This macro uses a simple search to move the caret outside the  
math environment. So with this addition, whenever I want to start a  
math environment I press $ (and \( ... \) is inserted), and whenever  
I want to get out of any kind of math environment, I press $ again.  
(And of course the interior of math environments is colored different  
from everything else, in user-defined colors).

Would something similar be possible in TeXShop?

For the $$ stuff, I have another command that, when ctrl-[ is  
pressed, inserts:

\[
     [caret here]
\]

and another single keystroke converts any such equation to:

\begin{equation}
	[the equation stuff]
	\label{eqn:[caret here]}
\end{equation}

> Richard Séguin

Haris Skiadas
Department of Mathematics and Computer Science
Hanover College


> On Mar 14, 2008, at 11:46 AM, Ryan Clary wrote:
>
>> Better than a shortcut, you can define an autocompletion (not  
>> command completion) which will do the same thing as the shortcut  
>> ($#INS#SEL$) but will enter the second $ after typing the first  
>> $.  I used this for all of my (, {, $, and [.
>>
>> Ryan Clary
>>
>> On Mar 14, 2008, at 12:31 PM, Herbert Schulz wrote:
>>
>>>
>>> On Mar 13, 2008, at 9:56 PM, Richard Seguin wrote:
>>>
>>>> Bracket matching has never been a problem for me. My biggest  
>>>> source of errors are unclosed $ ... $ strings. Up until recently  
>>>> I was using BBEdit which has an option that colors all  
>>>> characters between the $ delimiters in green. This makes it very  
>>>> easy to spot the problems, and I made very few of that type of  
>>>> error. I switched to the TeXShop editor a couple of weeks ago  
>>>> because a bug in the BBEdit syntax coloring having to do with  
>>>> equation environments was driving me crazy. (This has been  
>>>> reported to the developers who can reproduce it.) Now I'm once  
>>>> again making quite a few errors having to do with the closing  
>>>> the $ ... $ strings. I've wished for a long time that TeXShop  
>>>> could do the same sort of coloring as BBEdit. ...
>>>
>>> Howdy,
>>>
>>> You might try to define a macro that inserts $$ and places the  
>>> cursor between them: $#SEL##INS#$. Assign that to a convenient  
>>> keyboard shortcut. That way you can't get missing pairs. I tend  
>>> to use \(...\) most of the time (there are times when that will  
>>> give rise to errors---e.g., maths in section headers) and have  
>>> assigned that to Cmd-9.
>>>
>>> Good Luck,
>>>
>>> Herb Schulz
>>> (herbs at wideopenwest.com)
>>>







More information about the macostex-archives mailing list