empty mathtext "$$" in labels generates an exception

I was able to fix this without too much trouble, so I have committed it on the trunk.

Cheers,
Mike

J�rgen Stenarson wrote:

···

Michael Droettboom skrev:

I see that this isn't a LaTeX error, but I think Tony's comment is still somewhat valid. Since mathtext's parser is a direct subset of LaTeX's, and since $$ is a syntax error in LaTeX, it also is in mathtext. (This is really a side effect of make such a direct copy of the parser, rather than a deliberate choice). We can probably add a workaround to the parser, but I personally don't have a problem with it raising an exception. It doesn't seem to be a very useful thing to be able to do. What's your use case?

There is an exception for $ $ which is valid LaTeX. I have no particular usecase, I was just surprised by the exception. However I imagine that there could be instances when you want to interpolate an expression into a string but sometimes leave it empty, not that compelling perhaps.

/J�rgen

--
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA