The syntax highlighting for LaTeX math mode is very good. I have noticed, however, a discrepancy in the way the highlighting and the automatic delimiters are treated. I mean, normally typing a $ will automatically generate a second one (after the cursor) to end the math mode. However, I have found that this fails when a command in math mode spans multiple lines. That is, if there is a hard return in math mode, then the delimiters behave incorrectly eventhough the syntax highlighting is correct.
Here's an example: $math stuff that spans two lines$ when I put a $ here it thinks I'm closing the math mode from the first dollar sign on this line of code rather than thinking I'm starting a new math mode.
Keith Penrod
On Aug 22, 2008, at 1:07 PM, Keith Penrod wrote:
The syntax highlighting for LaTeX math mode is very good. I have noticed, however, a discrepancy in the way the highlighting and the automatic delimiters are treated. I mean, normally typing a $ will automatically generate a second one (after the cursor) to end the math mode. However, I have found that this fails when a command in math mode spans multiple lines. That is, if there is a hard return in math mode, then the delimiters behave incorrectly eventhough the syntax highlighting is correct.
Here's an example: $math stuff that spans two lines$ when I put a $ here it thinks I'm closing the math mode from the first dollar sign on this line of code rather than thinking I'm starting a new math mode.
Interesting, I hadn't noticed it before. I have no idea why this might be happening, Allan might have some insights. It's not something we can really control from the bundle. Of course, a simple solution is to use ( ... ) instead, which is quite unambiguous about where it starts and where it ends.
Keith Penrod
Haris Skiadas Department of Mathematics and Computer Science Hanover College
On 22 Aug 2008, at 19:07, Keith Penrod wrote:
[...] Here's an example: $math stuff that spans two lines$ when I put a $ here it thinks I'm closing the math mode from the first dollar sign on this line of code rather than thinking I'm starting a new math mode.
If I paste in those lines, I get the proper behavior.
Try http://wiki.macromates.com/Troubleshooting/RevertToDefaultBundles
When you say "I get the proper behavior" what do you mean? If you copy and paste the text into TextMate you won't notice the misbehavior. The text highlighting is correct. The problem is when you type the example I wrote in. In that case, when you type the second $ on the second line of the example TextMate does not put a second $ immediately following because it thinks that you've just closed up the first $ delimiter that's on that line, eventhough that $ isn't starting a math mode, it's ending it. So the behavior problem won't be noticed if you just copy and paste the text in TextMate.
Even upon reloading the bundles as you suggest the incorrect behavior that I have described remains.
Keith
Allan Odgaard-4 wrote:
On 22 Aug 2008, at 19:07, Keith Penrod wrote:
[...] Here's an example: $math stuff that spans two lines$ when I put a $ here it thinks I'm closing the math mode from the first dollar sign on this line of code rather than thinking I'm starting a new math mode.
If I paste in those lines, I get the proper behavior.
Try http://wiki.macromates.com/Troubleshooting/RevertToDefaultBundles
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
On 29 Aug 2008, at 18:51, gandalfxviv wrote:
When you say "I get the proper behavior" what do you mean? [...]
Sorry, thought it was related to syntax highlight (I skimmed it too fast).
There is no workaround for the problem of identical start/stop markers spread over multiple lines.