[OS X TeX] TeXShop syntax highlighting for expl3

Herbert Schulz herbs2 at mac.com
Sun Jan 28 15:52:41 EST 2024



> On Jan 28, 2024, at 2:10 PM, Murray Eisenberg <murrayeisenberg at gmail.com> wrote:
> 
> One snag with expl3 code handling in TeXShop is the editor's handling of the underscore, that character being pervasive in expl3code: When I type _ in the editor it assumes the input is a subscript and automatically inserts a pair of braces {} after the _ and positions the cursor within the braces. That is, it replaces the underscore with _{#SEL##INS#}.
> 
> I find that replacement in both the list of keybindings and in TeXShop's autocompletion.plist file.
> 
> I realize that one can toggle keybindings off from the Source menu, but then that toggles off all the other keybindings too.
> 
> Given, on the one hand, the implausibility of the LaTeX3 team replacing the underscore with some other, innocuous, character at this late date, and on the other hand the utter convenience of the keybinding for _ when typing math, I wonder whether there might be some other approach to the underscore issue within TeXShop.
> 
> P.S. Is the autocompletion.plist file the source of the key bindings? (I don't find any file having a name "keybindings" within either the TeXShop.app contents or the ~/Library/TeXShop tree.)

Howdy,

The ~/Library/TeXShop/Keyboard/autocompletion.plist file does, indeed, store the keybindings so any changes you make using the Keybindings Editor show up in that file.

One thing you may try, but you may find it distracting, is to create a keybinding with wome other (related?) character that just inserts a _ character; e.g., if you don't need Shft-Opt-- (hyphen_ to give an m-dash (---) replace that with Shft-Opt-- giving _; similarly for using an n-dash (--) with Opt--. I assume you need the simply typing _ to give _{#SEL##INS#} much more than the use for expl3code.

Good Luck,

Herb Schulz
herbs2 at mac.com




More information about the MacOSX-TeX mailing list