Logo ROOT  
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
22void latex4()
23{
24 auto c1 = new TCanvas("greek", "greek", 600, 700);
25
26 TLatex l;
27 l.SetTextSize(0.03);
28
29 // Draw the columns titles
30 l.SetTextAlign(22);
31 l.DrawLatex(0.165, 0.95, "Lower case");
32 l.DrawLatex(0.495, 0.95, "Upper case");
33 l.DrawLatex(0.825, 0.95, "Variations");
34
35 // Draw the lower case letters
36 l.SetTextAlign(12);
37 float y, x1, x2;
38 y = 0.90;
39 x1 = 0.07;
40 x2 = x1 + 0.2;
41 l.DrawLatex(x1, y, "alpha : ");
42 l.DrawLatex(x2, y, "#alpha");
43 y -= 0.0375;
44 l.DrawLatex(x1, y, "beta : ");
45 l.DrawLatex(x2, y, "#beta");
46 y -= 0.0375;
47 l.DrawLatex(x1, y, "gamma : ");
48 l.DrawLatex(x2, y, "#gamma");
49 y -= 0.0375;
50 l.DrawLatex(x1, y, "delta : ");
51 l.DrawLatex(x2, y, "#delta");
52 y -= 0.0375;
53 l.DrawLatex(x1, y, "epsilon : ");
54 l.DrawLatex(x2, y, "#epsilon");
55 y -= 0.0375;
56 l.DrawLatex(x1, y, "zeta : ");
57 l.DrawLatex(x2, y, "#zeta");
58 y -= 0.0375;
59 l.DrawLatex(x1, y, "eta : ");
60 l.DrawLatex(x2, y, "#eta");
61 y -= 0.0375;
62 l.DrawLatex(x1, y, "theta : ");
63 l.DrawLatex(x2, y, "#theta");
64 y -= 0.0375;
65 l.DrawLatex(x1, y, "iota : ");
66 l.DrawLatex(x2, y, "#iota");
67 y -= 0.0375;
68 l.DrawLatex(x1, y, "kappa : ");
69 l.DrawLatex(x2, y, "#kappa");
70 y -= 0.0375;
71 l.DrawLatex(x1, y, "lambda : ");
72 l.DrawLatex(x2, y, "#lambda");
73 y -= 0.0375;
74 l.DrawLatex(x1, y, "mu : ");
75 l.DrawLatex(x2, y, "#mu");
76 y -= 0.0375;
77 l.DrawLatex(x1, y, "nu : ");
78 l.DrawLatex(x2, y, "#nu");
79 y -= 0.0375;
80 l.DrawLatex(x1, y, "xi : ");
81 l.DrawLatex(x2, y, "#xi");
82 y -= 0.0375;
83 l.DrawLatex(x1, y, "omicron : ");
84 l.DrawLatex(x2, y, "#omicron");
85 y -= 0.0375;
86 l.DrawLatex(x1, y, "pi : ");
87 l.DrawLatex(x2, y, "#pi");
88 y -= 0.0375;
89 l.DrawLatex(x1, y, "rho : ");
90 l.DrawLatex(x2, y, "#rho");
91 y -= 0.0375;
92 l.DrawLatex(x1, y, "sigma : ");
93 l.DrawLatex(x2, y, "#sigma");
94 y -= 0.0375;
95 l.DrawLatex(x1, y, "tau : ");
96 l.DrawLatex(x2, y, "#tau");
97 y -= 0.0375;
98 l.DrawLatex(x1, y, "upsilon : ");
99 l.DrawLatex(x2, y, "#upsilon");
100 y -= 0.0375;
101 l.DrawLatex(x1, y, "phi : ");
102 l.DrawLatex(x2, y, "#phi");
103 y -= 0.0375;
104 l.DrawLatex(x1, y, "chi : ");
105 l.DrawLatex(x2, y, "#chi");
106 y -= 0.0375;
107 l.DrawLatex(x1, y, "psi : ");
108 l.DrawLatex(x2, y, "#psi");
109 y -= 0.0375;
110 l.DrawLatex(x1, y, "omega : ");
111 l.DrawLatex(x2, y, "#omega");
112
113 // Draw the upper case letters
114 y = 0.90;
115 x1 = 0.40;
116 x2 = x1 + 0.2;
117 l.DrawLatex(x1, y, "Alpha : ");
118 l.DrawLatex(x2, y, "#Alpha");
119 y -= 0.0375;
120 l.DrawLatex(x1, y, "Beta : ");
121 l.DrawLatex(x2, y, "#Beta");
122 y -= 0.0375;
123 l.DrawLatex(x1, y, "Gamma : ");
124 l.DrawLatex(x2, y, "#Gamma");
125 y -= 0.0375;
126 l.DrawLatex(x1, y, "Delta : ");
127 l.DrawLatex(x2, y, "#Delta");
128 y -= 0.0375;
129 l.DrawLatex(x1, y, "Epsilon : ");
130 l.DrawLatex(x2, y, "#Epsilon");
131 y -= 0.0375;
132 l.DrawLatex(x1, y, "Zeta : ");
133 l.DrawLatex(x2, y, "#Zeta");
134 y -= 0.0375;
135 l.DrawLatex(x1, y, "Eta : ");
136 l.DrawLatex(x2, y, "#Eta");
137 y -= 0.0375;
138 l.DrawLatex(x1, y, "Theta : ");
139 l.DrawLatex(x2, y, "#Theta");
140 y -= 0.0375;
141 l.DrawLatex(x1, y, "Iota : ");
142 l.DrawLatex(x2, y, "#Iota");
143 y -= 0.0375;
144 l.DrawLatex(x1, y, "Kappa : ");
145 l.DrawLatex(x2, y, "#Kappa");
146 y -= 0.0375;
147 l.DrawLatex(x1, y, "Lambda : ");
148 l.DrawLatex(x2, y, "#Lambda");
149 y -= 0.0375;
150 l.DrawLatex(x1, y, "Mu : ");
151 l.DrawLatex(x2, y, "#Mu");
152 y -= 0.0375;
153 l.DrawLatex(x1, y, "Nu : ");
154 l.DrawLatex(x2, y, "#Nu");
155 y -= 0.0375;
156 l.DrawLatex(x1, y, "Xi : ");
157 l.DrawLatex(x2, y, "#Xi");
158 y -= 0.0375;
159 l.DrawLatex(x1, y, "Omicron : ");
160 l.DrawLatex(x2, y, "#Omicron");
161 y -= 0.0375;
162 l.DrawLatex(x1, y, "Pi : ");
163 l.DrawLatex(x2, y, "#Pi");
164 y -= 0.0375;
165 l.DrawLatex(x1, y, "Rho : ");
166 l.DrawLatex(x2, y, "#Rho");
167 y -= 0.0375;
168 l.DrawLatex(x1, y, "Sigma : ");
169 l.DrawLatex(x2, y, "#Sigma");
170 y -= 0.0375;
171 l.DrawLatex(x1, y, "Tau : ");
172 l.DrawLatex(x2, y, "#Tau");
173 y -= 0.0375;
174 l.DrawLatex(x1, y, "Upsilon : ");
175 l.DrawLatex(x2, y, "#Upsilon");
176 y -= 0.0375;
177 l.DrawLatex(x1, y, "Phi : ");
178 l.DrawLatex(x2, y, "#Phi");
179 y -= 0.0375;
180 l.DrawLatex(x1, y, "Chi : ");
181 l.DrawLatex(x2, y, "#Chi");
182 y -= 0.0375;
183 l.DrawLatex(x1, y, "Psi : ");
184 l.DrawLatex(x2, y, "#Psi");
185 y -= 0.0375;
186 l.DrawLatex(x1, y, "Omega : ");
187 l.DrawLatex(x2, y, "#Omega");
188
189 // Draw the variations
190 x1 = 0.73;
191 x2 = x1 + 0.2;
192 y = 0.7500;
193 l.DrawLatex(x1, y, "varepsilon : ");
194 l.DrawLatex(x2, y, "#varepsilon");
195 y = 0.6375;
196 l.DrawLatex(x1, y, "vartheta : ");
197 l.DrawLatex(x2, y, "#vartheta");
198 y = 0.2625;
199 l.DrawLatex(x1, y, "varsigma : ");
200 l.DrawLatex(x2, y, "#varsigma");
201 y = 0.1875;
202 l.DrawLatex(x1, y, "varUpsilon : ");
203 l.DrawLatex(x2, y, "#varUpsilon");
204 y = 0.1500;
205 l.DrawLatex(x1, y, "varphi : ");
206 l.DrawLatex(x2, y, "#varphi");
207 y = 0.0375;
208 l.DrawLatex(x1, y, "varomega : ");
209 l.DrawLatex(x2, y, "#varomega");
210
211 // Save the picture in various formats
212 c1->Print("greek.ps");
213 c1->Print("greek.png");
214 c1->Print("greek.pdf");
215 c1->Print("greek.svg");
216}
Option_t Option_t TPoint TPoint const char x2
Option_t Option_t TPoint TPoint const char x1
The Canvas class.
Definition TCanvas.h:23
To draw Mathematical Formula.
Definition TLatex.h:18
void Print(Option_t *option="") const override
Dump this line with its attributes.
Definition TLine.cxx:419
Double_t y[n]
Definition legend1.C:17
return c1
Definition legend1.C:41
TLine l
Definition textangle.C:4