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

> Darren Dale wrote:
>
>  On Fri, Dec 12, 2008 at 9:46 AM, Michael Droettboom <md...@stsci.edu<mailto:
>> md...@stsci.edu>> wrote:
>>
>>    Manuel Metz wrote:
>>    > Michael Droettboom wrote:
>>    >
>>    >> There was a discussion on this list around a year ago about
>>    this.  The
>>    >> concern was that not rendering $ as $ would break (matplotlib)
>>    backward
>>    >> compatibility with scripts that don't care about math at all
>>    but use a
>>    >> lot of dollar signs (e.g. financial plots).  This is one of the few
>>    >> places where we deliberately broke usetex compatibility in
>>    favour of
>>    >> matplotlib compatibility.
>>    >>
>>    >> That said, it's probably a bug that the escaped dollar sign in
>>    non-math
>>    >> context is not rendered as a dollar sign.
>>    >>
>>    >> As a workaround "$\$%1.2f$" works with usetex on or off, with the
>>    >> proviso that it uses math- rather than text-rendering for the
>>    numbers.
>>    >>
>>    >> Mike
>>    >>
>>    >
>>    > In that case I suggest to note this somewhere in the docs (and User
>>    > Guide) with three exclamation marks (or is it ???).
>>    >
>>    So there's really two sub-bugs here:
>>
>>    1) '\$8' gives '\$8' in mathtext (well, actually it gets sent verbatim
>>    to the non-math text renderer, which is a bug).  This, IMHO, is a
>>    "must-fix".
>>
>>    2) '$8' gives '$8' in mathtext and an error in usetex.  This could be
>>    solved in two ways:
>>
>>    a) document the difference
>>    b) make '$8' give '$8' in usetex as well
>>
>>    I realise b) is technically making usetex accept a string that is not
>>    normally valid TeX -- but it's not like a user would ever enter
>>    '$8' and
>>    *want* to get a TeX error back.  And usetex strings aren't
>>    perfectly TeX
>>    anyway.
>>
>>    Personally, I'm leaning toward b), because it requires less mental
>>    effort for the user turning usetex on/off.  And it doesn't force us to
>>    backtrack on the idea of supporting "$100.00" easily.
>>
>>    But before I commit -- any feedback?
>>
>>  I opposed to b). If we go that route, we can look forward to advertising
>> usetex as "a latex backend, with familiar, standard latex markup, except
>> when it isnt."
>>
> It's not as bad as that.  '\$8' will still work as in LaTeX as it always
> has and as a LaTeX expert would expect it to.  All I'm proposing is that
> '$8', which is currently a LaTeX syntax error, will behave as it does when
> usetex is turned off.  So it's not breaking anything that's already valid.
>
> It's a question of which pain is worse, I guess.
>
> The deeper question is -- should usetex even strive to have any
> compatibility with standard text?  If not, then I can see your point.
>

http://matplotlib.sourceforge.net/users/mathtext.html advertises \$ as
markup for $. I think it was unwise to accept $ for $ in mathtext in the
first place, since mathtext uses tex markup anyway.

If we went with b), how sure are you that you can identify when a dollar
sign is intended and when mathmode is intended? Does "$A-$100+B*$200$" mean
$(A-100+200B) or A-100+200 or ..., I know this is an unlikely example, I'm
just trying to think of the unintended consequences of circumventing one of
the least buggy pieces of software in existence (I mean tex, not latex).
------------------------------------------------------------------------------
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