Logo ROOT   6.16/01
Reference Guide
latex3.C
Go to the documentation of this file.
1/// \file
2/// \ingroup tutorial_graphics
3/// \notebook
4/// Example illustrating a TPaveText with Latex inside.
5///
6/// \macro_image
7/// \macro_code
8///
9/// \author Rene Brun
10
11void latex3() {
12
13 TCanvas *c1 = new TCanvas("c1");
14 TPaveText *pt = new TPaveText(.05,.1,.95,.8);
15
16 pt->AddText("#frac{2s}{#pi#alpha^{2}} #frac{d#sigma}{dcos#theta} \
17 (e^{+}e^{-} #rightarrow f#bar{f} ) = #left| #frac{1}{1 - #Delta#alpha} \
18 #right|^{2} (1+cos^{2}#theta)");
19
20 pt->AddText("+ 4 Re #left{ #frac{2}{1 - #Delta#alpha} #chi(s) \
21 #[]{#hat{g}_{#nu}^{e}#hat{g}_{#nu}^{f} \
22(1 + cos^{2}#theta) + 2 #hat{g}_{a}^{e}#hat{g}_{a}^{f} cos#theta) } #right}");
23
24 pt->AddText("+ 16#left|#chi(s)#right|^{2}\
25 #left[(#hat{g}_{a}^{e}^{2} + #hat{g}_{v}^{e}^{2})\
26 (#hat{g}_{a}^{f}^{2} + #hat{g}_{v}^{f}^{2})(1+cos^{2}#theta)\
27 + 8 #hat{g}_{a}^{e} #hat{g}_{a}^{f} #hat{g}_{v}^{e} \
28 #hat{g}_{v}^{f}cos#theta#right] ");
29
30 pt->SetLabel("Born equation");
31 pt->Draw();
32}
The Canvas class.
Definition: TCanvas.h:31
A Pave (see TPave) with text, lines or/and boxes inside.
Definition: TPaveText.h:21
virtual TText * AddText(Double_t x1, Double_t y1, const char *label)
Add a new Text line to this pavetext at given coordinates.
Definition: TPaveText.cxx:182
virtual void Draw(Option_t *option="")
Draw this pavetext with its current attributes.
Definition: TPaveText.cxx:233
virtual void SetLabel(const char *label)
Definition: TPaveText.h:62
TPaveText * pt
return c1
Definition: legend1.C:41