ROOT
6.07/01
Reference Guide
ROOT Home Page
Main Page
Tutorials
User's Classes
Namespaces
All Classes
Files
Release Notes
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
tutorials
graphics
latex4.C
Go to the documentation of this file.
1
/// \file
2
/// \ingroup tutorial_graphics
3
/// Draw the Greek letters as a table and save the result as GIF, PS, PDF
4
/// and SVG files.
5
/// Lowercase Greek letters are obtained by adding a # to the name of the letter.
6
/// For an uppercase Greek letter, just capitalize the first letter of the
7
/// command name. Some letter have two representations. The name of the
8
/// second one (the "variation") starts with "var".
9
///
10
/// \macro_image
11
///
12
/// \author Rene Brun
13
14
void
latex4() {
15
TCanvas
*c1 =
new
TCanvas
(
"greek"
,
"greek"
,600,700);
16
17
TLatex
l
;
18
l.
SetTextSize
(0.03);
19
20
// Draw the columns titles
21
l.
SetTextAlign
(22);
22
l.
DrawLatex
(0.165, 0.95,
"Lower case"
);
23
l.
DrawLatex
(0.495, 0.95,
"Upper case"
);
24
l.
DrawLatex
(0.825, 0.95,
"Variations"
);
25
26
// Draw the lower case letters
27
l.
SetTextAlign
(12);
28
float
y
,
x1
,
x2
;
29
y = 0.90; x1 = 0.07; x2 = x1+0.2;
30
l.
DrawLatex
(x1, y,
"alpha : "
) ; l.
DrawLatex
(x2, y,
"#alpha"
);
31
y -= 0.0375 ; l.
DrawLatex
(x1, y,
"beta : "
) ; l.
DrawLatex
(x2, y,
"#beta"
);
32
y -= 0.0375 ; l.
DrawLatex
(x1, y,
"gamma : "
) ; l.
DrawLatex
(x2, y,
"#gamma"
);
33
y -= 0.0375 ; l.
DrawLatex
(x1, y,
"delta : "
) ; l.
DrawLatex
(x2, y,
"#delta"
);
34
y -= 0.0375 ; l.
DrawLatex
(x1, y,
"epsilon : "
) ; l.
DrawLatex
(x2, y,
"#epsilon"
);
35
y -= 0.0375 ; l.
DrawLatex
(x1, y,
"zeta : "
) ; l.
DrawLatex
(x2, y,
"#zeta"
);
36
y -= 0.0375 ; l.
DrawLatex
(x1, y,
"eta : "
) ; l.
DrawLatex
(x2, y,
"#eta"
);
37
y -= 0.0375 ; l.
DrawLatex
(x1, y,
"theta : "
) ; l.
DrawLatex
(x2, y,
"#theta"
);
38
y -= 0.0375 ; l.
DrawLatex
(x1, y,
"iota : "
) ; l.
DrawLatex
(x2, y,
"#iota"
);
39
y -= 0.0375 ; l.
DrawLatex
(x1, y,
"kappa : "
) ; l.
DrawLatex
(x2, y,
"#kappa"
);
40
y -= 0.0375 ; l.
DrawLatex
(x1, y,
"lambda : "
) ; l.
DrawLatex
(x2, y,
"#lambda"
);
41
y -= 0.0375 ; l.
DrawLatex
(x1, y,
"mu : "
) ; l.
DrawLatex
(x2, y,
"#mu"
);
42
y -= 0.0375 ; l.
DrawLatex
(x1, y,
"nu : "
) ; l.
DrawLatex
(x2, y,
"#nu"
);
43
y -= 0.0375 ; l.
DrawLatex
(x1, y,
"xi : "
) ; l.
DrawLatex
(x2, y,
"#xi"
);
44
y -= 0.0375 ; l.
DrawLatex
(x1, y,
"omicron : "
) ; l.
DrawLatex
(x2, y,
"#omicron"
);
45
y -= 0.0375 ; l.
DrawLatex
(x1, y,
"pi : "
) ; l.
DrawLatex
(x2, y,
"#pi"
);
46
y -= 0.0375 ; l.
DrawLatex
(x1, y,
"rho : "
) ; l.
DrawLatex
(x2, y,
"#rho"
);
47
y -= 0.0375 ; l.
DrawLatex
(x1, y,
"sigma : "
) ; l.
DrawLatex
(x2, y,
"#sigma"
);
48
y -= 0.0375 ; l.
DrawLatex
(x1, y,
"tau : "
) ; l.
DrawLatex
(x2, y,
"#tau"
);
49
y -= 0.0375 ; l.
DrawLatex
(x1, y,
"upsilon : "
) ; l.
DrawLatex
(x2, y,
"#upsilon"
);
50
y -= 0.0375 ; l.
DrawLatex
(x1, y,
"phi : "
) ; l.
DrawLatex
(x2, y,
"#phi"
);
51
y -= 0.0375 ; l.
DrawLatex
(x1, y,
"chi : "
) ; l.
DrawLatex
(x2, y,
"#chi"
);
52
y -= 0.0375 ; l.
DrawLatex
(x1, y,
"psi : "
) ; l.
DrawLatex
(x2, y,
"#psi"
);
53
y -= 0.0375 ; l.
DrawLatex
(x1, y,
"omega : "
) ; l.
DrawLatex
(x2, y,
"#omega"
);
54
55
// Draw the upper case letters
56
y = 0.90; x1 = 0.40; x2 = x1+0.2;
57
l.
DrawLatex
(x1, y,
"Alpha : "
) ; l.
DrawLatex
(x2, y,
"#Alpha"
);
58
y -= 0.0375 ; l.
DrawLatex
(x1, y,
"Beta : "
) ; l.
DrawLatex
(x2, y,
"#Beta"
);
59
y -= 0.0375 ; l.
DrawLatex
(x1, y,
"Gamma : "
) ; l.
DrawLatex
(x2, y,
"#Gamma"
);
60
y -= 0.0375 ; l.
DrawLatex
(x1, y,
"Delta : "
) ; l.
DrawLatex
(x2, y,
"#Delta"
);
61
y -= 0.0375 ; l.
DrawLatex
(x1, y,
"Epsilon : "
) ; l.
DrawLatex
(x2, y,
"#Epsilon"
);
62
y -= 0.0375 ; l.
DrawLatex
(x1, y,
"Zeta : "
) ; l.
DrawLatex
(x2, y,
"#Zeta"
);
63
y -= 0.0375 ; l.
DrawLatex
(x1, y,
"Eta : "
) ; l.
DrawLatex
(x2, y,
"#Eta"
);
64
y -= 0.0375 ; l.
DrawLatex
(x1, y,
"Theta : "
) ; l.
DrawLatex
(x2, y,
"#Theta"
);
65
y -= 0.0375 ; l.
DrawLatex
(x1, y,
"Iota : "
) ; l.
DrawLatex
(x2, y,
"#Iota"
);
66
y -= 0.0375 ; l.
DrawLatex
(x1, y,
"Kappa : "
) ; l.
DrawLatex
(x2, y,
"#Kappa"
);
67
y -= 0.0375 ; l.
DrawLatex
(x1, y,
"Lambda : "
) ; l.
DrawLatex
(x2, y,
"#Lambda"
);
68
y -= 0.0375 ; l.
DrawLatex
(x1, y,
"Mu : "
) ; l.
DrawLatex
(x2, y,
"#Mu"
);
69
y -= 0.0375 ; l.
DrawLatex
(x1, y,
"Nu : "
) ; l.
DrawLatex
(x2, y,
"#Nu"
);
70
y -= 0.0375 ; l.
DrawLatex
(x1, y,
"Xi : "
) ; l.
DrawLatex
(x2, y,
"#Xi"
);
71
y -= 0.0375 ; l.
DrawLatex
(x1, y,
"Omicron : "
) ; l.
DrawLatex
(x2, y,
"#Omicron"
);
72
y -= 0.0375 ; l.
DrawLatex
(x1, y,
"Pi : "
) ; l.
DrawLatex
(x2, y,
"#Pi"
);
73
y -= 0.0375 ; l.
DrawLatex
(x1, y,
"Rho : "
) ; l.
DrawLatex
(x2, y,
"#Rho"
);
74
y -= 0.0375 ; l.
DrawLatex
(x1, y,
"Sigma : "
) ; l.
DrawLatex
(x2, y,
"#Sigma"
);
75
y -= 0.0375 ; l.
DrawLatex
(x1, y,
"Tau : "
) ; l.
DrawLatex
(x2, y,
"#Tau"
);
76
y -= 0.0375 ; l.
DrawLatex
(x1, y,
"Upsilon : "
) ; l.
DrawLatex
(x2, y,
"#Upsilon"
);
77
y -= 0.0375 ; l.
DrawLatex
(x1, y,
"Phi : "
) ; l.
DrawLatex
(x2, y,
"#Phi"
);
78
y -= 0.0375 ; l.
DrawLatex
(x1, y,
"Chi : "
) ; l.
DrawLatex
(x2, y,
"#Chi"
);
79
y -= 0.0375 ; l.
DrawLatex
(x1, y,
"Psi : "
) ; l.
DrawLatex
(x2, y,
"#Psi"
);
80
y -= 0.0375 ; l.
DrawLatex
(x1, y,
"Omega : "
) ; l.
DrawLatex
(x2, y,
"#Omega"
);
81
82
// Draw the variations
83
x1 = 0.73; x2 = x1+0.2;
84
y = 0.7500 ; l.
DrawLatex
(x1, y,
"varepsilon : "
) ; l.
DrawLatex
(x2, y,
"#varepsilon"
);
85
y = 0.6375 ; l.
DrawLatex
(x1, y,
"vartheta : "
) ; l.
DrawLatex
(x2, y,
"#vartheta"
);
86
y = 0.2625 ; l.
DrawLatex
(x1, y,
"varsigma : "
) ; l.
DrawLatex
(x2, y,
"#varsigma"
);
87
y = 0.1875 ; l.
DrawLatex
(x1, y,
"varUpsilon : "
) ; l.
DrawLatex
(x2, y,
"#varUpsilon"
);
88
y = 0.1500 ; l.
DrawLatex
(x1, y,
"varphi : "
) ; l.
DrawLatex
(x2, y,
"#varphi"
);
89
y = 0.0375 ; l.
DrawLatex
(x1, y,
"varomega : "
) ; l.
DrawLatex
(x2, y,
"#varomega"
);
90
91
// Save the picture in various formats
92
c1->
Print
(
"greek.ps"
);
93
c1->
Print
(
"greek.gif"
);
94
c1->
Print
(
"greek.pdf"
);
95
c1->
Print
(
"greek.svg"
);
96
}
TPad::Print
virtual void Print(const char *filename="") const
Save Pad contents in a file in one of various formats.
Definition:
TPad.cxx:4134
x2
static const double x2[5]
Definition:
RooGaussKronrodIntegrator1D.cxx:345
TLatex
To draw Mathematical Formula.
Definition:
TLatex.h:33
TLatex::DrawLatex
TLatex * DrawLatex(Double_t x, Double_t y, const char *text)
Make a copy of this object with the new parameters And copy object attributes.
Definition:
TLatex.cxx:1901
TAttText::SetTextAlign
virtual void SetTextAlign(Short_t align=11)
Definition:
TAttText.h:55
l
TLine * l
Definition:
textangle.C:4
TCanvas
The Canvas class.
Definition:
TCanvas.h:48
x1
static const double x1[5]
Definition:
RooGaussKronrodIntegrator1D.cxx:327
y
Double_t y[n]
Definition:
legend1.C:17
TAttText::SetTextSize
virtual void SetTextSize(Float_t tsize=1)
Definition:
TAttText.h:60