Logo ROOT  
Reference Guide
 
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Loading...
Searching...
No Matches
latex3.C File Reference

Detailed Description

View in nbviewer Open in SWAN
Example illustrating a TPaveText with Latex inside.

void latex3() {
TCanvas *c1 = new TCanvas("c1");
TPaveText *pt = new TPaveText(.05,.1,.95,.8);
pt->AddText("#frac{2s}{#pi#alpha^{2}} #frac{d#sigma}{dcos#theta} "
"(e^{+}e^{-} #rightarrow f#bar{f} ) = #left| #frac{1}{1 - #Delta#alpha} "
"#right|^{2} (1+cos^{2}#theta)");
pt->AddText("+ 4 Re #left{ #frac{2}{1 - #Delta#alpha} #chi(s) "
"#[]{#hat{g}_{#nu}^{e}#hat{g}_{#nu}^{f} "
"(1 + cos^{2}#theta) + 2 #hat{g}_{a}^{e}#hat{g}_{a}^{f} cos#theta) } #right}");
pt->AddText("+ 16#left|#chi(s)#right|^{2} "
"#left[(#hat{g}_{a}^{e}^{2} + #hat{g}_{v}^{e}^{2})"
"(#hat{g}_{a}^{f}^{2} + #hat{g}_{v}^{f}^{2})(1+cos^{2}#theta)"
"+ 8 #hat{g}_{a}^{e} #hat{g}_{a}^{f} #hat{g}_{v}^{e}"
"#hat{g}_{v}^{f}cos#theta#right] ");
pt->SetLabel("Born equation");
pt->Draw();
}
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
The Canvas class.
Definition TCanvas.h:23
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.
virtual void SetLabel(const char *label)
Definition TPaveText.h:61
void Draw(Option_t *option="") override
Draw this pavetext with its current attributes.
TPaveText * pt
return c1
Definition legend1.C:41
Author
Rene Brun

Definition in file latex3.C.