On Fri, Dec 12, 2008 at 3:55 PM, Michael Droettboom <md...@stsci.edu> wrote:

> <snip>
>
> Darren Dale wrote:
>
>>
>> And I forgot that because mathtext used to be an all-or-nothing
>> enterprise, there was no reason to escape the $ in regular text. Once you
>> made it possible to embed mathtext in a regular string, I think it would
>> have been better in the long run to require \$, but the powerful financial
>> interests and their fat-cat lobbyists won the day.
>>
> lol ... I'm ready for my payout now... :)
>
>>
>> What I would prefer is to raise a deprecation warning when an odd number
>> of dollar signs are encountered, giving people time to learn to escape their
>> $ and modify their code. I wonder how disruptive this would be to people
>> using mpl for finance? If that is unacceptable, I guess the best solution is
>> as you propose, but maybe usetex should issue a warning that it has modified
>> the string rather than strictly interpret it.
>>
> That sounds like a good solution going forward.
>
>>
>> Do you know if there are any other inconsistencies between the
>> text/mathtext markup and latex?
>>
>>  Doh!  That's actually a very illuminating question...  One which, had I
> thought of it earlier, I might have never thought of dealing with $ at
> all... ;)
>
> Basically anything that is meaningful markup in TeX would have to be
> escaped for usetex, but not for regular text.  In that sense, $ is just one
> of many.  Think of "{brackets}", for instance.  You get "{brackets}" with
> regular text, and "brackets" with usetex.  I'm sure the list of these things
> is fairly long.


What else is there that is likely to cause problems going from mpltext to
usetex? math: \( \). displaymath (which is not supported in mathtext and
strongly discouraged in usetex): \[ \], $$ $$ . \( \) are probably so rarely
used in regular text that they could be made to mean the same thing in
mathtext as they do in usetex. displaymath could raise an error in both
usetex and mathtext. ^ and _ render in regular text but raises an error
outside of mathmode with usetex (my installation of texlive actually
attempts to do the right thing and insert the missing mathmode characters in
the case of ^ and _.) %. ~ (nonbreaking space). #. Unicode? Ugh.


> We don't want to start implicitly escaping those for usetex.  All this
> supports the theory that perhaps the gap between regular text and usetex is
> too wide to reasonably bridge.
>
> While originally this morning thought "let's just fix the inconsistencies",
> I'm now leaning to just adding a note to the docs that "regular text and
> usetex is fundamentally incompatible in a lot of ways" and leaving it at
> that.
>


I think it would be worth stating in the docs that # $ % & ~ _ ^ \ { } \( \)
\[ \] have special meaning in latex but not in regular mpl text, so buyer
beware. It might be nice if mpl regular text rendered the escaped version of
all these characters the same way latex does, that would make it easier to
go from text to usetex.

Speaking of implicitly doing the right thing, last night I was in the middle
of working through a difficult bug when Windows Vista *kicked me out without
asking or issuing a warning*, installed updates, and rebooted. I'm still
mumbling under my breath about it. Friggin jerks.
------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel

Reply via email to