Using TextExpander to input special characters
Next week, I will start teaching a course on type systems. As I will give it in English to Italian students, I thought it would be better to use some slides instead of just writing on the white board. So I have been working on these slides, basing them on Benjamin Pierce's great book on type systems.
I did not dive immediately in the slides, I first tried to get an idea of how I would start the course. To do so, I searched for some course notes online, did some lists of concepts I wanted to convey, and dropped all this in a Curio idea space. I then crafted a more detailed list of this first course outline, which I then transferred to Keynote.
Why Keynote you may ask (maybe wondering when I'll get to the point of this post)? Well, I have grown fond of it, and it prevents me from writing slides that are too technical (or too much like a copy and paste of a research paper). I really like LaTeX, and I cannot imagine using something else to write papers, but I am less sure about slides.
In any case, having chosen Keynote, there was still some technical content to typeset, as type systems are all about things like "Γ ⊢ λx:T. t : T → T'". One solution would be to use LaTeXiT, a great small free utility to produce PDF images out of LaTeX, which when combined to its LinkBack support makes it play great with Keynote. I however see several drawbacks with this approach:
- one would have to work hard to make sure the text fonts in Keynote and the generated fonts by pdflatex for the mathematical symbols are close enough for the result not to be ugly;
- if some mathematical symbol occur inline some text, then either all of it has to be done in LaTeX, or editing the text becomes a bit painful (as images have fixed positions and cannot be anchored at some point in the text);
- similarly, if coloring needs to be done, it has to be done and edited in LaTeXiT;
- LinkBack works great, but I've found that going back and forth between LaTeXiT and Keynote to tweak things takes some time.
So I searched for an alternative solution. As Keynote is using Unicode fonts by default, there are many many characters available. And by many I mean this

This palette is accessible in many applications, using the Edit → Special Characters... menu. However, I quickly found tiring to go to this menu, double-click on the wanted character (which I usually put in the "Favorite" tab using the gears menu on the bottom left), and going back to editing. Even assigning a shortcut to invoke this palette would not speed things enough. Which is when I thought of using TextExpander.
TextExpander is a preference pane that lets you assign things (that can be text, but also images or even the result of some AppleScript) to abbreviations. When the abbreviation is typed, it is immediately replaced by the corresponding text. I use it for fairly mundane things, like salutations at the end of an email: when I type cdt, I get
Cordialement,
Alan
I have many of these abbreviations defined, for website addresses I often go to, for my phone numbers, for salutations, for the current date in ISO format... and now for special characters

Creating these abbreviations was very easy: just create a new snippet, and in the text field simply use the Special Characters palette to enter the character wanted. And this is how I now easily enter these strange Γ and λ without leaving the comfort of the current application, be it TextMate (as of right now), Mail, or Keynote.
0 TrackBacks
Listed below are links to blogs that reference this entry: Using TextExpander to input special characters.
TrackBack URL for this entry: http://alan.petitepomme.net/cgi-bin/mt/mt-tb.cgi/119
Great post. I love TextExpander. I also use TacoWidgets 'CharacterPal'. It's a nice little Dashboard widget that can also be used on the desktop for quick, unobtrusive reference.
Thanks. I've used CharacterPal, but for some reason I don't find myself using Dashboard that much. It's great for converting dollars to euros, checking the weather, and doing quick computations. But beside this, I guess I still have to be converted.
Actually, I don't use Dashboard much either. I only use it to start up MAMP (my test platform for my blog). Since I have it started up for MAMP, I often open it up for CharacterPal. By the way, CharacterPal can be used as a stand-alone desktop app too.