[OS X TeX] automatic superscript braces in TeXShop editor

Herbert Schulz herbs at wideopenwest.com
Thu Feb 9 14:03:24 CET 2012


On Feb 8, 2012, at 9:32 PM, Don Green Dragon wrote:

> Hi Herb,
> 
> On 04Feb2012, at 4:17 PM, Herbert Schulz wrote:
> 
> <<snip>>
>>> I went to (Source->Key Bindings->Edit Key Bindings File…) and had a look. Noticed that there was an entry for the empty set which can be created by simply typing \O (uppercase O not zero 0) and found that it works nicely in both text mode and math mode. Granted I get a warning that 
>>> 
>>> LaTeX Warning: Command \O invalid in math mode on input line 21.
>>> 
>>> when I use it in math mode, but the appropriate character appears in the preview. That's great, but how does one gets the appropriate character in 'Input' column of the Key Bindings Editor?
>>> 
>> 
>> Howdy,
>> 
>> If I type Ø (Shift-Opt-O --- Oh, not Zero --- on a US Keyboard layout) the Keybinding inserts \O in the text. Isn't that what you wish?
> 
> I did not know about Shift-Opt-O for example.
> ...
>> 
>> I don't understand? Again, \neq, which is inserted when you type ≠ (Opt-= on a US Keyboard Layout) the Keybindings insert \neq which TeX (not TeXShop) only interprets in math mode.
> 
> Did not know about Opt-= producing ≠ at least here in Mail.app.
> 

Howdy,

Now I'm beginning to understand that what you wanted to do was be able to type those characters on the keyboard so you could use the Key Binding.

You can see all the things you can type and how to type them by enabling the Keyboard & Character Viewer in the Menu Bar. In system Preferences go to Keyboard->Keyboard and check the Show Keyboard & Character Viewer in menu bar option. This will put a small keyboard icon in you menu bar. When you click on that you'll get a small image of your keyboard. Press the Opt key and the character produced in combination with the Opt key will be displayed. Press Shift-Opt and see those characters. You can slowly learn a few of these keys as you need them.

> 
>>> For example, I frequently use $\mathbb{N}$. I have a shortcut for that but .....  It would be very nice if I could just type \N, for example, in the source code and have the blackboard version of N appear on the preview page.
>>> 
>>> Don Green Dragon
>>> fergdc at Shaw.ca
>> 
>> 
>> What do you mean by ``shortcut'' above? Why don't you simply put
>> 
>> \newcommand{\N}{$\mathbb{N}$}
>> 
>> into your preamble then, whenever you need that simply write \N into your document.
> 
> 
> That's the shortcut I alluded to, although I also include \ensuremath so that \N  works well in text mode. However, I misjudged that the equivalent could be done with the Key Bindings Editor.
> 
> As always, thanks for you help.
> 
> 
> Don Green Dragon
> fergdc at Shaw.ca


I didn't use the \ensuremath version because I wanted to keep things simple and it wasn't what your example gave. But the \ensuremath version is definitely better.

Good Luck,

Herb Schulz
(herbs at wideopenwest dot com)






More information about the macostex-archives mailing list