ROOT
v6-24
Reference Guide
Loading...
Searching...
No Matches
latex4.C
Go to the documentation of this file.
1
/// \file
2
/// \ingroup tutorial_graphics
3
/// \notebook
4
/// Draw the Greek letters as a table and save the result as GIF, PS, PDF
5
/// and SVG files.
6
/// Lowercase Greek letters are obtained by adding a # to the name of the letter.
7
/// For an uppercase Greek letter, just capitalize the first letter of the
8
/// command name. Some letter have two representations. The name of the
9
/// second one (the "variation") starts with "var".
10
///
11
/// ### png output:
12
/// \macro_image
13
///
14
/// ### pdf output:
15
/// \macro_image (greek.pdf)
16
///
17
/// ### svg output:
18
/// \macro_image (greek.svg)
19
///
20
/// \author Rene Brun
21
22
void
latex4() {
23
TCanvas
*
c1
=
new
TCanvas
(
"greek"
,
"greek"
,600,700);
24
25
TLatex
l
;
26
l
.
SetTextSize
(0.03);
27
28
// Draw the columns titles
29
l
.SetTextAlign(22);
30
l
.DrawLatex(0.165, 0.95,
"Lower case"
);
31
l
.DrawLatex(0.495, 0.95,
"Upper case"
);
32
l
.DrawLatex(0.825, 0.95,
"Variations"
);
33
34
// Draw the lower case letters
35
l
.SetTextAlign(12);
36
float
y
,
x1
,
x2
;
37
y
= 0.90;
x1
= 0.07;
x2
=
x1
+0.2;
38
l
.DrawLatex(
x1
,
y
,
"alpha : "
) ;
l
.DrawLatex(
x2
,
y
,
"#alpha"
);
39
y
-= 0.0375 ;
l
.DrawLatex(
x1
,
y
,
"beta : "
) ;
l
.DrawLatex(
x2
,
y
,
"#beta"
);
40
y
-= 0.0375 ;
l
.DrawLatex(
x1
,
y
,
"gamma : "
) ;
l
.DrawLatex(
x2
,
y
,
"#gamma"
);
41
y
-= 0.0375 ;
l
.DrawLatex(
x1
,
y
,
"delta : "
) ;
l
.DrawLatex(
x2
,
y
,
"#delta"
);
42
y
-= 0.0375 ;
l
.DrawLatex(
x1
,
y
,
"epsilon : "
) ;
l
.DrawLatex(
x2
,
y
,
"#epsilon"
);
43
y
-= 0.0375 ;
l
.DrawLatex(
x1
,
y
,
"zeta : "
) ;
l
.DrawLatex(
x2
,
y
,
"#zeta"
);
44
y
-= 0.0375 ;
l
.DrawLatex(
x1
,
y
,
"eta : "
) ;
l
.DrawLatex(
x2
,
y
,
"#eta"
);
45
y
-= 0.0375 ;
l
.DrawLatex(
x1
,
y
,
"theta : "
) ;
l
.DrawLatex(
x2
,
y
,
"#theta"
);
46
y
-= 0.0375 ;
l
.DrawLatex(
x1
,
y
,
"iota : "
) ;
l
.DrawLatex(
x2
,
y
,
"#iota"
);
47
y
-= 0.0375 ;
l
.DrawLatex(
x1
,
y
,
"kappa : "
) ;
l
.DrawLatex(
x2
,
y
,
"#kappa"
);
48
y
-= 0.0375 ;
l
.DrawLatex(
x1
,
y
,
"lambda : "
) ;
l
.DrawLatex(
x2
,
y
,
"#lambda"
);
49
y
-= 0.0375 ;
l
.DrawLatex(
x1
,
y
,
"mu : "
) ;
l
.DrawLatex(
x2
,
y
,
"#mu"
);
50
y
-= 0.0375 ;
l
.DrawLatex(
x1
,
y
,
"nu : "
) ;
l
.DrawLatex(
x2
,
y
,
"#nu"
);
51
y
-= 0.0375 ;
l
.DrawLatex(
x1
,
y
,
"xi : "
) ;
l
.DrawLatex(
x2
,
y
,
"#xi"
);
52
y
-= 0.0375 ;
l
.DrawLatex(
x1
,
y
,
"omicron : "
) ;
l
.DrawLatex(
x2
,
y
,
"#omicron"
);
53
y
-= 0.0375 ;
l
.DrawLatex(
x1
,
y
,
"pi : "
) ;
l
.DrawLatex(
x2
,
y
,
"#pi"
);
54
y
-= 0.0375 ;
l
.DrawLatex(
x1
,
y
,
"rho : "
) ;
l
.DrawLatex(
x2
,
y
,
"#rho"
);
55
y
-= 0.0375 ;
l
.DrawLatex(
x1
,
y
,
"sigma : "
) ;
l
.DrawLatex(
x2
,
y
,
"#sigma"
);
56
y
-= 0.0375 ;
l
.DrawLatex(
x1
,
y
,
"tau : "
) ;
l
.DrawLatex(
x2
,
y
,
"#tau"
);
57
y
-= 0.0375 ;
l
.DrawLatex(
x1
,
y
,
"upsilon : "
) ;
l
.DrawLatex(
x2
,
y
,
"#upsilon"
);
58
y
-= 0.0375 ;
l
.DrawLatex(
x1
,
y
,
"phi : "
) ;
l
.DrawLatex(
x2
,
y
,
"#phi"
);
59
y
-= 0.0375 ;
l
.DrawLatex(
x1
,
y
,
"chi : "
) ;
l
.DrawLatex(
x2
,
y
,
"#chi"
);
60
y
-= 0.0375 ;
l
.DrawLatex(
x1
,
y
,
"psi : "
) ;
l
.DrawLatex(
x2
,
y
,
"#psi"
);
61
y
-= 0.0375 ;
l
.DrawLatex(
x1
,
y
,
"omega : "
) ;
l
.DrawLatex(
x2
,
y
,
"#omega"
);
62
63
// Draw the upper case letters
64
y
= 0.90;
x1
= 0.40;
x2
=
x1
+0.2;
65
l
.DrawLatex(
x1
,
y
,
"Alpha : "
) ;
l
.DrawLatex(
x2
,
y
,
"#Alpha"
);
66
y
-= 0.0375 ;
l
.DrawLatex(
x1
,
y
,
"Beta : "
) ;
l
.DrawLatex(
x2
,
y
,
"#Beta"
);
67
y
-= 0.0375 ;
l
.DrawLatex(
x1
,
y
,
"Gamma : "
) ;
l
.DrawLatex(
x2
,
y
,
"#Gamma"
);
68
y
-= 0.0375 ;
l
.DrawLatex(
x1
,
y
,
"Delta : "
) ;
l
.DrawLatex(
x2
,
y
,
"#Delta"
);
69
y
-= 0.0375 ;
l
.DrawLatex(
x1
,
y
,
"Epsilon : "
) ;
l
.DrawLatex(
x2
,
y
,
"#Epsilon"
);
70
y
-= 0.0375 ;
l
.DrawLatex(
x1
,
y
,
"Zeta : "
) ;
l
.DrawLatex(
x2
,
y
,
"#Zeta"
);
71
y
-= 0.0375 ;
l
.DrawLatex(
x1
,
y
,
"Eta : "
) ;
l
.DrawLatex(
x2
,
y
,
"#Eta"
);
72
y
-= 0.0375 ;
l
.DrawLatex(
x1
,
y
,
"Theta : "
) ;
l
.DrawLatex(
x2
,
y
,
"#Theta"
);
73
y
-= 0.0375 ;
l
.DrawLatex(
x1
,
y
,
"Iota : "
) ;
l
.DrawLatex(
x2
,
y
,
"#Iota"
);
74
y
-= 0.0375 ;
l
.DrawLatex(
x1
,
y
,
"Kappa : "
) ;
l
.DrawLatex(
x2
,
y
,
"#Kappa"
);
75
y
-= 0.0375 ;
l
.DrawLatex(
x1
,
y
,
"Lambda : "
) ;
l
.DrawLatex(
x2
,
y
,
"#Lambda"
);
76
y
-= 0.0375 ;
l
.DrawLatex(
x1
,
y
,
"Mu : "
) ;
l
.DrawLatex(
x2
,
y
,
"#Mu"
);
77
y
-= 0.0375 ;
l
.DrawLatex(
x1
,
y
,
"Nu : "
) ;
l
.DrawLatex(
x2
,
y
,
"#Nu"
);
78
y
-= 0.0375 ;
l
.DrawLatex(
x1
,
y
,
"Xi : "
) ;
l
.DrawLatex(
x2
,
y
,
"#Xi"
);
79
y
-= 0.0375 ;
l
.DrawLatex(
x1
,
y
,
"Omicron : "
) ;
l
.DrawLatex(
x2
,
y
,
"#Omicron"
);
80
y
-= 0.0375 ;
l
.DrawLatex(
x1
,
y
,
"Pi : "
) ;
l
.DrawLatex(
x2
,
y
,
"#Pi"
);
81
y
-= 0.0375 ;
l
.DrawLatex(
x1
,
y
,
"Rho : "
) ;
l
.DrawLatex(
x2
,
y
,
"#Rho"
);
82
y
-= 0.0375 ;
l
.DrawLatex(
x1
,
y
,
"Sigma : "
) ;
l
.DrawLatex(
x2
,
y
,
"#Sigma"
);
83
y
-= 0.0375 ;
l
.DrawLatex(
x1
,
y
,
"Tau : "
) ;
l
.DrawLatex(
x2
,
y
,
"#Tau"
);
84
y
-= 0.0375 ;
l
.DrawLatex(
x1
,
y
,
"Upsilon : "
) ;
l
.DrawLatex(
x2
,
y
,
"#Upsilon"
);
85
y
-= 0.0375 ;
l
.DrawLatex(
x1
,
y
,
"Phi : "
) ;
l
.DrawLatex(
x2
,
y
,
"#Phi"
);
86
y
-= 0.0375 ;
l
.DrawLatex(
x1
,
y
,
"Chi : "
) ;
l
.DrawLatex(
x2
,
y
,
"#Chi"
);
87
y
-= 0.0375 ;
l
.DrawLatex(
x1
,
y
,
"Psi : "
) ;
l
.DrawLatex(
x2
,
y
,
"#Psi"
);
88
y
-= 0.0375 ;
l
.DrawLatex(
x1
,
y
,
"Omega : "
) ;
l
.DrawLatex(
x2
,
y
,
"#Omega"
);
89
90
// Draw the variations
91
x1
= 0.73;
x2
=
x1
+0.2;
92
y
= 0.7500 ;
l
.DrawLatex(
x1
,
y
,
"varepsilon : "
) ;
l
.DrawLatex(
x2
,
y
,
"#varepsilon"
);
93
y
= 0.6375 ;
l
.DrawLatex(
x1
,
y
,
"vartheta : "
) ;
l
.DrawLatex(
x2
,
y
,
"#vartheta"
);
94
y
= 0.2625 ;
l
.DrawLatex(
x1
,
y
,
"varsigma : "
) ;
l
.DrawLatex(
x2
,
y
,
"#varsigma"
);
95
y
= 0.1875 ;
l
.DrawLatex(
x1
,
y
,
"varUpsilon : "
) ;
l
.DrawLatex(
x2
,
y
,
"#varUpsilon"
);
96
y
= 0.1500 ;
l
.DrawLatex(
x1
,
y
,
"varphi : "
) ;
l
.DrawLatex(
x2
,
y
,
"#varphi"
);
97
y
= 0.0375 ;
l
.DrawLatex(
x1
,
y
,
"varomega : "
) ;
l
.DrawLatex(
x2
,
y
,
"#varomega"
);
98
99
// Save the picture in various formats
100
c1
->Print(
"greek.ps"
);
101
c1
->Print(
"greek.gif"
);
102
c1
->Print(
"greek.pdf"
);
103
c1
->Print(
"greek.svg"
);
104
}
x2
static const double x2[5]
Definition
RooGaussKronrodIntegrator1D.cxx:364
x1
static const double x1[5]
Definition
RooGaussKronrodIntegrator1D.cxx:346
TAttText::SetTextSize
virtual void SetTextSize(Float_t tsize=1)
Set the text size.
Definition
TAttText.h:46
TCanvas
The Canvas class.
Definition
TCanvas.h:23
TLatex
To draw Mathematical Formula.
Definition
TLatex.h:18
c1
return c1
Definition
legend1.C:41
y
Double_t y[n]
Definition
legend1.C:17
l
auto * l
Definition
textangle.C:4
tutorials
graphics
latex4.C
ROOT v6-24 - Reference Guide Generated on Tue Aug 22 2023 03:06:58 (GVA Time) using Doxygen 1.9.8