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/// 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 auto c1 = new TCanvas("mathsymb","Mathematical Symbols",600,600);
20
21 TLatex l;
22 l.SetTextSize(0.03);
23
24 // Draw First Column
25 l.SetTextAlign(12);
26 float y, step, x1, x2;
27 y = 0.96; step = 0.0465; x1 = 0.02; x2 = x1+0.04;
28 l.DrawLatex(x1, y, "#club") ; l.DrawText(x2, y, "#club");
29 y -= step ; l.DrawLatex(x1, y, "#voidn") ; l.DrawText(x2, y, "#voidn");
30 y -= step ; l.DrawLatex(x1, y, "#leq") ; l.DrawText(x2, y, "#leq");
31 y -= step ; l.DrawLatex(x1, y, "#approx") ; l.DrawText(x2, y, "#approx");
32 y -= step ; l.DrawLatex(x1, y, "#in") ; l.DrawText(x2, y, "#in");
33 y -= step ; l.DrawLatex(x1, y, "#supset") ; l.DrawText(x2, y, "#supset");
34 y -= step ; l.DrawLatex(x1, y, "#cap") ; l.DrawText(x2, y, "#cap");
35 y -= step ; l.DrawLatex(x1, y, "#ocopyright") ; l.DrawText(x2, y, "#ocopyright");
36 y -= step ; l.DrawLatex(x1, y, "#trademark") ; l.DrawText(x2, y, "#trademark");
37 y -= step ; l.DrawLatex(x1, y, "#times") ; l.DrawText(x2, y, "#times");
38 y -= step ; l.DrawLatex(x1, y, "#bullet") ; l.DrawText(x2, y, "#bullet");
39 y -= step ; l.DrawLatex(x1, y, "#voidb") ; l.DrawText(x2, y, "#voidb");
40 y -= step ; l.DrawLatex(x1, y, "#doublequote") ; l.DrawText(x2, y, "#doublequote");
41 y -= step ; l.DrawLatex(x1, y, "#lbar") ; l.DrawText(x2, y, "#lbar");
42 y -= step ; l.DrawLatex(x1, y, "#arcbottom") ; l.DrawText(x2, y, "#arcbottom");
43 y -= step ; l.DrawLatex(x1, y, "#downarrow") ; l.DrawText(x2, y, "#downarrow");
44 y -= step ; l.DrawLatex(x1, y, "#leftrightarrow") ; l.DrawText(x2, y, "#leftrightarrow");
45 y -= step ; l.DrawLatex(x1, y, "#Downarrow") ; l.DrawText(x2, y, "#Downarrow");
46 y -= step ; l.DrawLatex(x1, y, "#Leftrightarrow") ; l.DrawText(x2, y, "#Leftrightarrow");
47 y -= step ; l.DrawLatex(x1, y, "#void8") ; l.DrawText(x2, y, "#void8");
48 y -= step ; l.DrawLatex(x1, y, "#hbar") ; l.DrawText(x2, y, "#hbar");
49
50 // Draw Second Column
51 y = 0.96; step = 0.0465; x1 = 0.27; x2 = x1+0.04;
52 l.DrawLatex(x1, y, "#diamond") ; l.DrawText(x2, y, "#diamond");
53 y -= step ; l.DrawLatex(x1, y, "#aleph") ; l.DrawText(x2, y, "#aleph");
54 y -= step ; l.DrawLatex(x1, y, "#geq") ; l.DrawText(x2, y, "#geq");
55 y -= step ; l.DrawLatex(x1, y, "#neq") ; l.DrawText(x2, y, "#neq");
56 y -= step ; l.DrawLatex(x1, y, "#notin") ; l.DrawText(x2, y, "#notin");
57 y -= step ; l.DrawLatex(x1, y, "#subseteq") ; l.DrawText(x2, y, "#subseteq");
58 y -= step ; l.DrawLatex(x1, y, "#cup") ; l.DrawText(x2, y, "#cup");
59 y -= step ; l.DrawLatex(x1, y, "#copyright") ; l.DrawText(x2, y, "#copyright");
60 y -= step ; l.DrawLatex(x1, y, "#void3") ; l.DrawText(x2, y, "#void3");
61 y -= step ; l.DrawLatex(x1, y, "#divide") ; l.DrawText(x2, y, "#divide");
62 y -= step ; l.DrawLatex(x1, y, "#circ") ; l.DrawText(x2, y, "#circ");
63 y -= step ; l.DrawLatex(x1, y, "#infty") ; l.DrawText(x2, y, "#infty");
64 y -= step ; l.DrawLatex(x1, y, "#angle") ; l.DrawText(x2, y, "#angle");
65 y -= step ; l.DrawLatex(x1, y, "#cbar") ; l.DrawText(x2, y, "#cbar");
66 y -= step ; l.DrawLatex(x1, y, "#arctop") ; l.DrawText(x2, y, "#arctop");
67 y -= step ; l.DrawLatex(x1, y, "#leftarrow") ; l.DrawText(x2, y, "#leftarrow");
68 y -= step ; l.DrawLatex(x1, y, "#otimes") ; l.DrawText(x2, y, "#otimes");
69 y -= step ; l.DrawLatex(x1, y, "#Leftarrow") ; l.DrawText(x2, y, "#Leftarrow");
70 y -= step ; l.DrawLatex(x1, y, "#prod") ; l.DrawText(x2, y, "#prod");
71 y -= step ; l.DrawLatex(x1, y, "#Box") ; l.DrawText(x2, y, "#Box");
72 y -= step ; l.DrawLatex(x1, y, "#parallel") ; l.DrawText(x2, y, "#parallel");
73
74 // Draw Third Column
75 y = 0.96; step = 0.0465; x1 = 0.52; x2 = x1+0.04;
76 l.DrawLatex(x1, y, "#heart") ; l.DrawText(x2, y, "#heart");
77 y -= step ; l.DrawLatex(x1, y, "#Jgothic") ; l.DrawText(x2, y, "#Jgothic");
78 y -= step ; l.DrawLatex(x1, y, "#LT") ; l.DrawText(x2, y, "#LT");
79 y -= step ; l.DrawLatex(x1, y, "#equiv") ; l.DrawText(x2, y, "#equiv");
80 y -= step ; l.DrawLatex(x1, y, "#subset") ; l.DrawText(x2, y, "#subset");
81 y -= step ; l.DrawLatex(x1, y, "#supseteq") ; l.DrawText(x2, y, "#supseteq");
82 y -= step ; l.DrawLatex(x1, y, "#wedge") ; l.DrawText(x2, y, "#wedge");
83 y -= step ; l.DrawLatex(x1, y, "#oright") ; l.DrawText(x2, y, "#oright");
84 y -= step ; l.DrawLatex(x1, y, "#AA") ; l.DrawText(x2, y, "#AA");
85 y -= step ; l.DrawLatex(x1, y, "#pm") ; l.DrawText(x2, y, "#pm");
86 y -= step ; l.DrawLatex(x1, y, "#3dots") ; l.DrawText(x2, y, "#3dots");
87 y -= step ; l.DrawLatex(x1, y, "#nabla") ; l.DrawText(x2, y, "#nabla");
88 y -= step ; l.DrawLatex(x1, y, "#downleftarrow") ; l.DrawText(x2, y, "#downleftarrow");
89 y -= step ; l.DrawLatex(x1, y, "#topbar") ; l.DrawText(x2, y, "#topbar");
90 y -= step ; l.DrawLatex(x1, y, "#arcbar") ; l.DrawText(x2, y, "#arcbar");
91 y -= step ; l.DrawLatex(x1, y, "#uparrow") ; l.DrawText(x2, y, "#uparrow");
92 y -= step ; l.DrawLatex(x1, y, "#oplus") ; l.DrawText(x2, y, "#oplus");
93 y -= step ; l.DrawLatex(x1, y, "#Uparrow") ; l.DrawText(x2, y, "#Uparrow");
94 y -= step ; l.DrawLatex(x1, y-0.01, "#sum") ; l.DrawText(x2, y, "#sum");
95 y -= step ; l.DrawLatex(x1, y, "#perp") ; l.DrawText(x2, y, "#perp");
96
97 // Draw Fourth Column
98 y = 0.96; step = 0.0465; x1 = 0.77; x2 = x1+0.04;
99 l.DrawLatex(x1, y, "#spade") ; l.DrawText(x2, y, "#spade");
100 y -= step ; l.DrawLatex(x1, y, "#Rgothic") ; l.DrawText(x2, y, "#Rgothic");
101 y -= step ; l.DrawLatex(x1, y, "#GT") ; l.DrawText(x2, y, "#GT");
102 y -= step ; l.DrawLatex(x1, y, "#propto") ; l.DrawText(x2, y, "#propto");
103 y -= step ; l.DrawLatex(x1, y, "#notsubset") ; l.DrawText(x2, y, "#notsubset");
104 y -= step ; l.DrawLatex(x1, y, "#oslash") ; l.DrawText(x2, y, "#oslash");
105 y -= step ; l.DrawLatex(x1, y, "#vee") ; l.DrawText(x2, y, "#vee");
106 y -= step ; l.DrawLatex(x1, y, "#void1") ; l.DrawText(x2, y, "#void1");
107 y -= step ; l.DrawLatex(x1, y, "#aa") ; l.DrawText(x2, y, "#aa");
108 y -= step ; l.DrawLatex(x1, y, "#/") ; l.DrawText(x2, y, "#/");
109 y -= step ; l.DrawLatex(x1, y, "#upoint") ; l.DrawText(x2, y, "#upoint");
110 y -= step ; l.DrawLatex(x1, y, "#partial") ; l.DrawText(x2, y, "#partial");
111 y -= step ; l.DrawLatex(x1, y, "#corner") ; l.DrawText(x2, y, "#corner");
112 y -= step ; l.DrawLatex(x1, y, "#ltbar") ; l.DrawText(x2, y, "#ltbar");
113 y -= step ; l.DrawLatex(x1, y, "#bottombar") ; l.DrawText(x2, y, "#bottombar");
114 y -= step ; l.DrawLatex(x1, y, "#rightarrow") ; l.DrawText(x2, y, "#rightarrow");
115 y -= step ; l.DrawLatex(x1, y, "#surd") ; l.DrawText(x2, y, "#surd");
116 y -= step ; l.DrawLatex(x1, y, "#Rightarrow") ; l.DrawText(x2, y, "#Rightarrow");
117 y -= step ; l.DrawLatex(x1, y-0.015, "#int") ; l.DrawText(x2, y, "#int");
118 y -= step ; l.DrawLatex(x1, y, "#odot") ; l.DrawText(x2, y, "#odot");
119
120 // Save the picture in various formats
121 c1->Print("mathsymb.ps");
122 c1->Print("mathsymb.png");
123 c1->Print("mathsymb.pdf");
124 c1->Print("mathsymb.svg");
125}
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