[Tioga-users] formatting for numeric label
Taro Sato
nomo17k at gmail.com
Mon Jul 9 15:30:15 EDT 2007
On 7/9/07, Vincent Fourmond <fourmond at gmail.com> wrote:
> Taro Sato wrote:
> > I think it would be relatively easy to implement, to let a user
> > specify the precise format, maybe using C string formatter, so
> >
> > "%+.1f"
> >
> > would give both control over the forcing sign to be present even for >
> > 0 numbers. (this will then be processed by xaxis_numeric_label_tex).
>
> I also wanted to modify this at some point, but I think the format
> string is also way too restrictive (though, admittedly, more powerful
> than what we currently have). I'm fine with implementing that right now,
> but the best solution would be to be able to pass a 'block' to the
> function -- that is (at least in Ruby's terms) an anonymous Ruby/Python
> that would take the float as an argument and handle the formatting,
> returning a string. I'm sure this is doable in Python, I know it is in
> Ruby, but I'm not sure it will be easy to keep both interfaces matching...
>
> As for the rest, you can do anything with TeX, it just takes ten times
> more processing time and a good hundred times more programming time to
> make real string processing -- think about docstrip !
>
> Cheers,
>
> Vincent
>
> PS: I did CC you as I was too lazy to check you are in tioga-users; if
> that's the case, just mention it next time ;-). Anyway, with gmail,
> you're unlikely to get double messages...
Vince -- I'm on the list already, so don't worry about cc'ing me!
Yeah, I generally agree with your approach of allowing really finer
control for those who want! However, I think it also make sense to
allow a simpler alternative.
Actually we could do both, right? We can check the input and if it's
a function object, we do what you outlined. If that's a string, then
we can do C-like formatting.
I like C-like formating because it's rather standard and don't confuse
those who are not a real programmer. I like finer controls, but to
attract a large user base, we should have very simple alternatives as
well. (I tend to think about trying to make your thesis advisor learn
to use the program --- is it easy enough?? that sort of thing...)
Taro
More information about the Tioga-users
mailing list