Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
latex5.C
Go to the documentation of this file.
1/// \file
2/// \ingroup tutorial_graphics
3/// \notebook
4/// \preview This draws the Mathematical Symbols letters as a table and save the result
5/// as GIF, PS, PDF and SVG files.
6///
7/// ### png output:
8/// \macro_image
9///
10/// ### pdf output:
11/// \macro_image (mathsymb.pdf)
12///
13/// ### svg output:
14/// \macro_image (mathsymb.svg)
15///
16/// \author Rene Brun
17
18void latex5()
19{
20 auto c1 = new TCanvas("mathsymb", "Mathematical Symbols", 600, 600);
21
22 TLatex l;
23 l.SetTextSize(0.03);
24
25 // Draw First Column
26 l.SetTextAlign(12);
27 float y, step, x1, x2;
28 y = 0.96;
29 step = 0.044;
30 x1 = 0.02;
31 x2 = x1 + 0.04;
32 l.DrawLatex(x1, y, "#club");
33 l.DrawText(x2, y, "#club");
34 y -= step;
35 l.DrawLatex(x1, y, "#voidn");
36 l.DrawText(x2, y, "#voidn");
37 y -= step;
38 l.DrawLatex(x1, y, "#leq");
39 l.DrawText(x2, y, "#leq");
40 y -= step;
41 l.DrawLatex(x1, y, "#approx");
42 l.DrawText(x2, y, "#approx");
43 y -= step;
44 l.DrawLatex(x1, y, "#in");
45 l.DrawText(x2, y, "#in");
46 y -= step;
47 l.DrawLatex(x1, y, "#supset");
48 l.DrawText(x2, y, "#supset");
49 y -= step;
50 l.DrawLatex(x1, y, "#cap");
51 l.DrawText(x2, y, "#cap");
52 y -= step;
53 l.DrawLatex(x1, y, "#ocopyright");
54 l.DrawText(x2, y, "#ocopyright");
55 y -= step;
56 l.DrawLatex(x1, y, "#trademark");
57 l.DrawText(x2, y, "#trademark");
58 y -= step;
59 l.DrawLatex(x1, y, "#times");
60 l.DrawText(x2, y, "#times");
61 y -= step;
62 l.DrawLatex(x1, y, "#bullet");
63 l.DrawText(x2, y, "#bullet");
64 y -= step;
65 l.DrawLatex(x1, y, "#voidb");
66 l.DrawText(x2, y, "#voidb");
67 y -= step;
68 l.DrawLatex(x1, y, "#doublequote");
69 l.DrawText(x2, y, "#doublequote");
70 y -= step;
71 l.DrawLatex(x1, y, "#lbar");
72 l.DrawText(x2, y, "#lbar");
73 y -= step;
74 l.DrawLatex(x1, y, "#arcbottom");
75 l.DrawText(x2, y, "#arcbottom");
76 y -= step;
77 l.DrawLatex(x1, y, "#downarrow");
78 l.DrawText(x2, y, "#downarrow");
79 y -= step;
80 l.DrawLatex(x1, y, "#leftrightarrow");
81 l.DrawText(x2, y, "#leftrightarrow");
82 y -= step;
83 l.DrawLatex(x1, y, "#Downarrow");
84 l.DrawText(x2, y, "#Downarrow");
85 y -= step;
86 l.DrawLatex(x1, y, "#Leftrightarrow");
87 l.DrawText(x2, y, "#Leftrightarrow");
88 y -= step;
89 l.DrawLatex(x1, y, "#void8");
90 l.DrawText(x2, y, "#void8");
91 y -= step;
92 l.DrawLatex(x1, y, "#hbar");
93 l.DrawText(x2, y, "#hbar");
94 y -= step;
95 l.DrawLatex(x1, y, "#forall");
96 l.DrawText(x2, y, "#forall");
97
98 // Draw Second Column
99 y = 0.96;
100 x1 = 0.27;
101 x2 = x1 + 0.04;
102 l.DrawLatex(x1, y, "#diamond");
103 l.DrawText(x2, y, "#diamond");
104 y -= step;
105 l.DrawLatex(x1, y, "#aleph");
106 l.DrawText(x2, y, "#aleph");
107 y -= step;
108 l.DrawLatex(x1, y, "#geq");
109 l.DrawText(x2, y, "#geq");
110 y -= step;
111 l.DrawLatex(x1, y, "#neq");
112 l.DrawText(x2, y, "#neq");
113 y -= step;
114 l.DrawLatex(x1, y, "#notin");
115 l.DrawText(x2, y, "#notin");
116 y -= step;
117 l.DrawLatex(x1, y, "#subseteq");
118 l.DrawText(x2, y, "#subseteq");
119 y -= step;
120 l.DrawLatex(x1, y, "#cup");
121 l.DrawText(x2, y, "#cup");
122 y -= step;
123 l.DrawLatex(x1, y, "#copyright");
124 l.DrawText(x2, y, "#copyright");
125 y -= step;
126 l.DrawLatex(x1, y, "#void3");
127 l.DrawText(x2, y, "#void3");
128 y -= step;
129 l.DrawLatex(x1, y, "#divide");
130 l.DrawText(x2, y, "#divide");
131 y -= step;
132 l.DrawLatex(x1, y, "#circ");
133 l.DrawText(x2, y, "#circ");
134 y -= step;
135 l.DrawLatex(x1, y, "#infty");
136 l.DrawText(x2, y, "#infty");
137 y -= step;
138 l.DrawLatex(x1, y, "#angle");
139 l.DrawText(x2, y, "#angle");
140 y -= step;
141 l.DrawLatex(x1, y, "#cbar");
142 l.DrawText(x2, y, "#cbar");
143 y -= step;
144 l.DrawLatex(x1, y, "#arctop");
145 l.DrawText(x2, y, "#arctop");
146 y -= step;
147 l.DrawLatex(x1, y, "#leftarrow");
148 l.DrawText(x2, y, "#leftarrow");
149 y -= step;
150 l.DrawLatex(x1, y, "#otimes");
151 l.DrawText(x2, y, "#otimes");
152 y -= step;
153 l.DrawLatex(x1, y, "#Leftarrow");
154 l.DrawText(x2, y, "#Leftarrow");
155 y -= step;
156 l.DrawLatex(x1, y, "#prod");
157 l.DrawText(x2, y, "#prod");
158 y -= step;
159 l.DrawLatex(x1, y, "#Box");
160 l.DrawText(x2, y, "#Box");
161 y -= step;
162 l.DrawLatex(x1, y, "#parallel");
163 l.DrawText(x2, y, "#parallel");
164 y -= step;
165 l.DrawLatex(x1, y, "#exists");
166 l.DrawText(x2, y, "#exists");
167
168 // Draw Third Column
169 y = 0.96;
170 x1 = 0.52;
171 x2 = x1 + 0.04;
172 l.DrawLatex(x1, y, "#heart");
173 l.DrawText(x2, y, "#heart");
174 y -= step;
175 l.DrawLatex(x1, y, "#Jgothic");
176 l.DrawText(x2, y, "#Jgothic");
177 y -= step;
178 l.DrawLatex(x1, y, "#LT");
179 l.DrawText(x2, y, "#LT");
180 y -= step;
181 l.DrawLatex(x1, y, "#equiv");
182 l.DrawText(x2, y, "#equiv");
183 y -= step;
184 l.DrawLatex(x1, y, "#subset");
185 l.DrawText(x2, y, "#subset");
186 y -= step;
187 l.DrawLatex(x1, y, "#supseteq");
188 l.DrawText(x2, y, "#supseteq");
189 y -= step;
190 l.DrawLatex(x1, y, "#wedge");
191 l.DrawText(x2, y, "#wedge");
192 y -= step;
193 l.DrawLatex(x1, y, "#oright");
194 l.DrawText(x2, y, "#oright");
195 y -= step;
196 l.DrawLatex(x1, y, "#AA");
197 l.DrawText(x2, y, "#AA");
198 y -= step;
199 l.DrawLatex(x1, y, "#pm");
200 l.DrawText(x2, y, "#pm");
201 y -= step;
202 l.DrawLatex(x1, y, "#3dots");
203 l.DrawText(x2, y, "#3dots");
204 y -= step;
205 l.DrawLatex(x1, y, "#nabla");
206 l.DrawText(x2, y, "#nabla");
207 y -= step;
208 l.DrawLatex(x1, y, "#downleftarrow");
209 l.DrawText(x2, y, "#downleftarrow");
210 y -= step;
211 l.DrawLatex(x1, y, "#topbar");
212 l.DrawText(x2, y, "#topbar");
213 y -= step;
214 l.DrawLatex(x1, y, "#arcbar");
215 l.DrawText(x2, y, "#arcbar");
216 y -= step;
217 l.DrawLatex(x1, y, "#uparrow");
218 l.DrawText(x2, y, "#uparrow");
219 y -= step;
220 l.DrawLatex(x1, y, "#oplus");
221 l.DrawText(x2, y, "#oplus");
222 y -= step;
223 l.DrawLatex(x1, y, "#Uparrow");
224 l.DrawText(x2, y, "#Uparrow");
225 y -= step;
226 l.DrawLatex(x1, y - 0.01, "#sum");
227 l.DrawText(x2, y, "#sum");
228 y -= step;
229 l.DrawLatex(x1, y, "#perp");
230 l.DrawText(x2, y, "#perp");
231 y -= step;
232 l.DrawLatex(x1, y, "#textendash");
233 l.DrawText(x2, y, "#textendash");
234
235 // Draw Fourth Column
236 y = 0.96;
237 x1 = 0.77;
238 x2 = x1 + 0.04;
239 l.DrawLatex(x1, y, "#spade");
240 l.DrawText(x2, y, "#spade");
241 y -= step;
242 l.DrawLatex(x1, y, "#Rgothic");
243 l.DrawText(x2, y, "#Rgothic");
244 y -= step;
245 l.DrawLatex(x1, y, "#GT");
246 l.DrawText(x2, y, "#GT");
247 y -= step;
248 l.DrawLatex(x1, y, "#propto");
249 l.DrawText(x2, y, "#propto");
250 y -= step;
251 l.DrawLatex(x1, y, "#notsubset");
252 l.DrawText(x2, y, "#notsubset");
253 y -= step;
254 l.DrawLatex(x1, y, "#oslash");
255 l.DrawText(x2, y, "#oslash");
256 y -= step;
257 l.DrawLatex(x1, y, "#vee");
258 l.DrawText(x2, y, "#vee");
259 y -= step;
260 l.DrawLatex(x1, y, "#void1");
261 l.DrawText(x2, y, "#void1");
262 y -= step;
263 l.DrawLatex(x1, y, "#aa");
264 l.DrawText(x2, y, "#aa");
265 y -= step;
266 l.DrawLatex(x1, y, "#/");
267 l.DrawText(x2, y, "#/");
268 y -= step;
269 l.DrawLatex(x1, y, "#upoint");
270 l.DrawText(x2, y, "#upoint");
271 y -= step;
272 l.DrawLatex(x1, y, "#partial");
273 l.DrawText(x2, y, "#partial");
274 y -= step;
275 l.DrawLatex(x1, y, "#corner");
276 l.DrawText(x2, y, "#corner");
277 y -= step;
278 l.DrawLatex(x1, y, "#ltbar");
279 l.DrawText(x2, y, "#ltbar");
280 y -= step;
281 l.DrawLatex(x1, y, "#bottombar");
282 l.DrawText(x2, y, "#bottombar");
283 y -= step;
284 l.DrawLatex(x1, y, "#rightarrow");
285 l.DrawText(x2, y, "#rightarrow");
286 y -= step;
287 l.DrawLatex(x1, y, "#surd");
288 l.DrawText(x2, y, "#surd");
289 y -= step;
290 l.DrawLatex(x1, y, "#Rightarrow");
291 l.DrawText(x2, y, "#Rightarrow");
292 y -= step;
293 l.DrawLatex(x1, y - 0.015, "#int");
294 l.DrawText(x2, y, "#int");
295 y -= step;
296 l.DrawLatex(x1, y, "#odot");
297 l.DrawText(x2, y, "#odot");
298 y -= step;
299 l.DrawLatex(x1, y, "#textemdash");
300 l.DrawText(x2, y, "#textemdash");
301
302 // Save the picture in various formats
303 c1->Print("mathsymb.ps");
304 c1->Print("mathsymb.png");
305 c1->Print("mathsymb.pdf");
306 c1->Print("mathsymb.svg");
307}
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
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:20
Double_t y[n]
Definition legend1.C:17
return c1
Definition legend1.C:41
TLine l
Definition textangle.C:4