[OS X TeX] TeXShop 2.09a

Ross Moore ross at ics.mq.edu.au
Tue Feb 7 03:58:21 CET 2006


Hi Herb, Claus, and others

On 07/02/2006, at 12:28 PM, Herbert Schulz wrote:
> On Feb 6, 2006, at 7:06 PM, Claus Gerhardt wrote:
>
>> If you place in BBEdit the cursor before the starting $ sign, then  
>> the search command (using grep)
>> \$((.|\r)+?[^\\$])\$
>> will find (and highlight) anything between the starting $ sign and  
>> the next forward positioned $ sign (including the $ signs), and  
>> not get irritated by an escaped \$.

> As long as you assume that the first $ to the right is the START of  
> the equation it becomes simpler; you just search to the right. What  
> happens if you try to simply get a match and can't ASSUME it's a  
> start of an equation?

Also, beware to avoid matching a $ on the wrong side of a comment % .
I've seen syntax-coloring editors get this wrong.
Beware that the starting and ending $s don't need to be on the same
physical line, so keeping track of arbitrary junk in-between can be
really hard.

For this, and a bit more, the Perl subroutine  sub wrap_math_environment
in LaTeX2HTML is 120 lines long (including comments).
And this is *after* %-commented portions have already been removed from
the processing stream.

Here's part of the initial comments:

     # This wraps math-type environments
     # The trick here is that the opening brace is the same as the  
close,
     # but they *can* still nest, in cases like this:
     #
     # $ outer stuff ... \hbox{ ... $ inner stuff $ ... } ... $
     #
     # Note that the inner pair of $'s is nested within a group.  So, to
     # handle these cases correctly, we need to make sure that the outer
     # brace-level is the same as the inner. --- rst



>
> Good Luck,

This is really quite a tricky problem.

Cheers,

	Ross

>
> Herb Schulz
> (herbs at wideopenwest.com)



------------------------------------------------------------------------
Ross Moore                                         ross at maths.mq.edu.au
Mathematics Department                             office: E7A-419
Macquarie University                               tel: +61 +2 9850 8955
Sydney, Australia  2109                            fax: +61 +2 9850 8114
------------------------------------------------------------------------


------------------------- Info --------------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
          & FAQ: http://latex.yauh.de/faq/
TeX FAQ: http://www.tex.ac.uk/faq
List Archive: http://tug.org/pipermail/macostex-archives/




More information about the macostex-archives mailing list