Fixing Latex Math in Textmate August 2
In addition to the cost I usually find closed source text editors and similar utilities to be lacking in features and insufficently extensible. Textmate for OS X, however, is a glaring exception. It is well worth the cost and I’m constantly surprised by the many useful bundles and customizations available (for instance convienient remote editing with Cyber Duck or easy blog posting using the MetaWeblog API). So when Texmaker started slowing down on large complex files1 I resolved to switch over to using textmate to write up my mathematics in LaTeX.
However, textmate’s prompt syntax highlight combined with the depreciated use of ‘$$’ to start displaymath mode was really annoying. Each time I would start to add inline mathematics by typing ‘$’ textmate would automatically provide the closing ‘$’ leaving me a line like this:
every $g \fungeq f$ that is ‘close’ to $f$ can compute $$
Of course textmate now interprets the remainder of my file as part of a displaymath block started by the ‘$$’ consequently changing the syntax highlighting. Since writing up theorems involves lots of inline mathematics this quickly became very annoying.
Anyway in case anyone else runs into the same problem let me share the quick fix I used. Go into your bundle editor and in the Latex bundle edit the language TeX. Find the following section
name = 'string.other.math.block.tex';
begin = '\$\$';
end = '\$\$;
and change it to:
name = 'string.other.math.block.tex';
begin = '\[';
end = '\]';
Of course this is something of a dirty hack since it disables the correct syntax highlighting for the ‘$$’ abbreviation. But since that is depreciated you always use ‘[' and ']‘ right?
If anyone knows the ‘right’ way to do this I’d love to hear.
-
I still heartily recommend Texmaker for begining latex users as it has a handy side panel showing commonly used symbols and greek characters as they appear. Quite possibly they have fixed the slowdown I’m experiencing in a latter version and it didn’t bother me except on this one file. ↩
LaTeX in TextMate:
- Fixing Latex Math in Textmate
- More Tips For LaTeX in TextMate
Have you considered using kile, if you are using a Linux system? I don’t know how it compares to textmate, but it is a rich-featured LaTeX IDE.
Actually I’m using OS X (a powerbook) but it will probably run kile anyway so i will give it a chance.
I think you mean
end = ‘]’;
instead of
end = ‘[’;
Yup, thanks!
This is a good write-up, I was wondering if I could use this blog on my website, I will link it back to your website though. If this is a problem please let me know and I will take it down right away.