Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[ROOT] Simple TLatex line \Delta{E}

679 views
Skip to first unread message

Patois Yannick

unread,
Jul 14, 2000, 3:00:00 AM7/14/00
to

Hi,

I used TLatex to label an axis and I'm surprised by the result.
I wanted to display {\Delta}E.

I tried :
"#Delta E" -> Gives \Delta~E (there is a space)
"{#Delta}E" -> Gives \{\Delta\}E (brackets are draw)
"#Delta{E}" -> Gives \Delta\{E} (brackets are draw)
"#DeltaE" -> Gives the good result, but in latex, \DeltaE wouldnt
compile

If the goal is (as it seems) to mimic as much as possible LaTeX syntax,
this could be enhanced on this point.

Yannick

--
_/ Yannick Patois _________________ Address (home) __________________
| irc(undernet): Garp on #france25+ | La Villa des Sciences |
| email : pat...@ganil.fr | 12, avenue de Cambridge |
| http://garp.feelingsurfer.net/ | 14200 Herouville-Saint-Clair |
| Tel/Fax-home:+33 (0)2 31 94 50 32 | FRANCE |


Rene Brun

unread,
Jul 14, 2000, 3:00:00 AM7/14/00
to

HI Yannick,
In the current implementation of TLatex, the greek symbols are directly
replaced by their graphical representation. You can perfectly give #DeltaE
and not #Delta{E}. Greek letters are not considered to be operators with
an argument. Since this would be an important change in the class, I would
appreciate getting more feedback on this subject. May be somebody should
cross-check the latex compatibility for all functions of TLatex.

Rene Brun

Nick van Eijndhoven

unread,
Jul 14, 2000, 3:00:00 AM7/14/00
to

Hi Rene,
The problem probably is that in Latex one types $\Delta E$ which
gives a Delta followed by an E without spaces in between.
In ROOT it seems to me that #Delta E is interpreted as $\Delta$ E
where there is a space in between the Delta and the E.
A solution could be to adopt also the $..$ notation in ROOT to
switch to 'formula mode'. This would mean in the above case
entering the text as $#Delta E$ would give a Delta followed by
an E without a space in between.
As far as I can see this would mean no change to the ROOT functionality
but only an extension to the TLatex class.

Cheers,
Nick.

Rene Brun

unread,
Jul 14, 2000, 3:00:00 AM7/14/00
to

Hi Nick,

With the current implementation, if you just want to get a Delta followed by an
E without a white space, you simply give the string #DeltaE
I do not agree with your proposal with the $. I am waiting more comments
on this TLatex topic.

Rene Brun

Stephen Bailey

unread,
Jul 14, 2000, 3:00:00 AM7/14/00
to

Hi Rene et. al.

I would prefer TLatex to mimic LaTeX as closely as possible,
thus I support Nick's suggestion of $..$ notation. It would
also be really nice to have equivalents of LaTeX's \. \, \;
and \! to be able to fine tune the spacing of formulas.

As an additional feature to be able to produce TLatex output
more similar to real LaTeX, it would also be nice to have an
italic Greek font so that the labels in our plots look more
similar to the LaTeX text that surrounds them in our papers.
I don't know how technically difficult it would be to add a
Greek italic font though.

My two cents,

Stephen


Rene Brun

unread,
Jul 14, 2000, 3:00:00 AM7/14/00
to

Hi Stephen,

Stephen Bailey wrote:
>
> Hi Rene et. al.
>
> I would prefer TLatex to mimic LaTeX as closely as possible,
> thus I support Nick's suggestion of $..$ notation. It would
> also be really nice to have equivalents of LaTeX's \. \, \;
> and \! to be able to fine tune the spacing of formulas.
>

Let me understand your (and Nick) proposal with the $$.
Are you proposing that all TLatex strings systematically should be surrounded
by $ ?
if yes, this cannot be backward compatible. I am not sure that the majority
will agree.
if no, how to you switch between the two states ?

Since \ is unpractical with C++, would you be happy with #. #, #; #! ?
I did not look yet at possible side-effects.


> As an additional feature to be able to produce TLatex output
> more similar to real LaTeX, it would also be nice to have an
> italic Greek font so that the labels in our plots look more
> similar to the LaTeX text that surrounds them in our papers.
> I don't know how technically difficult it would be to add a
> Greek italic font though.
>

I have to investigate this. I had already similar requests. The difficulty
is in finding the right fonts that are OK on the screen (Unix, NT)
and with PostScript.

Rene Brun

Nick van Eijndhoven

unread,
Jul 14, 2000, 3:00:00 AM7/14/00
to

Hi Rene,
For me it's not a major issue. As long as people are aware of it
it is no problem at all. However, #DeltaE is not consistent with
the standard Latex syntax.

Stephen Bailey

unread,
Jul 14, 2000, 3:00:00 AM7/14/00
to

Hi.

I agree that just requiring all TLatex strings to be wrapped
in $..$ is a bit silly and not backwards compatible. I also
understand that backwards compatibility is very important.
So this is what I personally would really like to see:

In LaTeX, I might plausibly want to label a plot axis with

$K_S \to \pi^+ \pi^-$ mass

In this case, the K_S and pi symbols are in math italic and the word
"mass" is in the default font. There is no space between the two
pi symbols but there is a space between them and the word "mass".
I would like to be able to translate this as directly as possible
into TLatex. Since C++ has a different use for the backslash character
it has to be replaced with #, but otherwise I would be quite happy if

TLatex testLatex;
testLatex.DrawLatex(1, 1, "$K_S #to #pi^+ #pi^-$ mass")

would produce output as similar to the true LaTeX output as
possible, including italics vs. regular font, etc. If I
decided I wanted to adjust the spacing a little,
#! (small negative space) and #. #, #; (increasing
amounts of positive space) would be useful:

testLatex.DrawLatex(1, 1, "$K_S #; #to #; #pi^+ #pi^-$ mass")

I don't know if this is quite what Nick intended with his
suggestion, but it what I would prefer.

Stephen

Patois Yannick

unread,
Jul 14, 2000, 3:00:00 AM7/14/00
to

Hi,

If I had only one comment to add on this subject, the thing that I found
the most surprising with the current implementation, is that the bracket
'{ is displayed when one write {#Delta}E.
The goal of the brackets here are only to delimit the action of the
interpretor, and in latex, one *has to* write \{ to get a real bracket.

On this point TLatex is somewhat incoherent, because when writing U_{n}
the bracket are (of course) not displayed.

I undetstand that for the interpretor _ is a function with arguments in
brackets. But in latex the brackets have both attributes : delimites
arguments and area, like in {\bf something}

But I wont insist on any modifications : once I found how to write it
right, that's OK...

Yannick


Rene Brun

unread,
Jul 15, 2000, 3:00:00 AM7/15/00
to

Hi Stephen, Nick, Yannick,
Thanks for your feedback and suggestions. I have to see if this easy
to implement.

Rene Brun

Tim Welters

unread,
Jul 17, 2000, 3:00:00 AM7/17/00
to

Hi rooters,

let me give some suggestions from the users point of view:

For me it's not important wether I put a "#" or "\" in front of LaTeX
commands, or if there is full LaTeX compatibility, as long as I know
how to get a specific result.
The only thing I'm interested in is the axis label or title I want.
And for this I will optimize every new TLatex string and look at
the resulting postscript output.
But there often occurs one of my main problems with the TLatex class.
The spacing I see in my postscript files is often not that what I wanted,
and in many cases it differs from the TLatex screen output. Normally the
deviation from my expected result is small (no full spaces), but these
little mistakes do not look nice.
Then I start inserting and deleting spaces. For this, the existence of
operators like "\!", "\,", ... would be very convenient.
Another problem is the missing "\not" operator. It's not very nice to use
something like "p_{miss}" in an axis label when I use "\not{p}" in my text.
In addition I agree that the obligatory use of "{}" for sub- or superscripts is sometimes
annoying. Maybe one can use something like "\_" or "#_" in normal text and
implement the standard LaTeX behaviour for math scripts ?

Tim

p.s. I think for the purist this class should be namend TLaTeX ;-)

------------------------------------------------------------------------
Tim Welters, III.Physikalisches Institut at the RWTH Aachen, Lehrstuhl B
Room: H.116 Tel.: +49(241)80-6355 Fax: +49(241)8888-244
Postal Address: Physikzentrum, RWTH Aachen, D-52056 Aachen
e-mail: wel...@physik.rwth-aachen.de or Tim.W...@cern.ch
------------------------------------------------------------------------

Marco van Leeuwen

unread,
Jul 17, 2000, 3:00:00 AM7/17/00
to

Hi all,

I would like support the following:

Tim Welters wrote:
>
> Hi rooters,
>
> let me give some suggestions from the users point of view:
>
> For me it's not important wether I put a "#" or "\" in front of LaTeX
> commands, or if there is full LaTeX compatibility, as long as I know
> how to get a specific result.
> The only thing I'm interested in is the axis label or title I want.
> And for this I will optimize every new TLatex string and look at
> the resulting postscript output.
> But there often occurs one of my main problems with the TLatex class.
> The spacing I see in my postscript files is often not that what I wanted,
> and in many cases it differs from the TLatex screen output. Normally the
> deviation from my expected result is small (no full spaces), but these
> little mistakes do not look nice.

Up till now I accepted this as 'glitches', but if some new effort is put
into TLatex, it would be nice if the spacing/alignment issues could be
revisited... I often use TLatex syntax in axis titles, and I find that
super- and/or subscripts are somtimes badly placed. It seems to be a
rather subtle effect, but the follwing might shed some light on the
issues involved:

Try:

TCanvas *c1=new TCanvas("c1","Canvas #1",500,500)
tmpH=gPad->DrawFrame(0,0,1,10)
TPaveText *P=new TPaveText(0.1,4.5,0.95,8)
P->AddText("10.0 < |P| < 100.0")
P->AddText("1.0 < |P_{t}| < 10.0")
P->Draw()
P->SetTextFont(132)
P->Draw()

On my screen, the space between the P and the subscript t is very large.
Now, if I rescale the TPavetext (by mouse), it becomes clear that the
placing of the subscript depends on the size of the text. This probably
has a good reason, but if it can be changed, it might be worthwhile...


Best regards,

Marco van Leeuwen.

Rene Brun

unread,
Jul 17, 2000, 3:00:00 AM7/17/00
to

Hi Marco,

You get what you describe if you do not use the True Type Fonts. Using TTF, I do
not see a problem with your simple example. Could you send me your canvas.gif
file?

Check that you use the TTF, eg, do
root > gEnv->Print()

I am well aware that TLatex has still a lot of imperfections. It must be very
clear, however, that TLatex is not intended to be an alternative to lateX.
TLatex strings are supposed to process the most frequent cases of the lateX
math mode and nothing else.
There are still several problems with the current implementation of TTF.
These fonts are not perfectly scalable. Depending on the text size, you may get
subscripts/superscrits at different relative positions.
We have tried to optimize the Postscript output, Postscript fonts being
perfectly scalable.

Rene Brun

0 new messages