Logo ROOT   6.07/09
Reference Guide
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 /// \macro_image
8 ///
9 /// \author Rene Brun
10 
11 void latex5() {
12  TCanvas *c1 = new TCanvas("mathsymb","Mathematical Symbols",600,600);
13 
14  TLatex l;
15  l.SetTextSize(0.03);
16 
17  // Draw First Column
18  l.SetTextAlign(12);
19  float y, step, x1, x2;
20  y = 0.96; step = 0.0465; x1 = 0.02; x2 = x1+0.04;
21  l.DrawLatex(x1, y, "#club") ; l.DrawText(x2, y, "#club");
22  y -= step ; l.DrawLatex(x1, y, "#voidn") ; l.DrawText(x2, y, "#voidn");
23  y -= step ; l.DrawLatex(x1, y, "#leq") ; l.DrawText(x2, y, "#leq");
24  y -= step ; l.DrawLatex(x1, y, "#approx") ; l.DrawText(x2, y, "#approx");
25  y -= step ; l.DrawLatex(x1, y, "#in") ; l.DrawText(x2, y, "#in");
26  y -= step ; l.DrawLatex(x1, y, "#supset") ; l.DrawText(x2, y, "#supset");
27  y -= step ; l.DrawLatex(x1, y, "#cap") ; l.DrawText(x2, y, "#cap");
28  y -= step ; l.DrawLatex(x1, y, "#ocopyright") ; l.DrawText(x2, y, "#ocopyright");
29  y -= step ; l.DrawLatex(x1, y, "#trademark") ; l.DrawText(x2, y, "#trademark");
30  y -= step ; l.DrawLatex(x1, y, "#times") ; l.DrawText(x2, y, "#times");
31  y -= step ; l.DrawLatex(x1, y, "#bullet") ; l.DrawText(x2, y, "#bullet");
32  y -= step ; l.DrawLatex(x1, y, "#voidb") ; l.DrawText(x2, y, "#voidb");
33  y -= step ; l.DrawLatex(x1, y, "#doublequote") ; l.DrawText(x2, y, "#doublequote");
34  y -= step ; l.DrawLatex(x1, y, "#lbar") ; l.DrawText(x2, y, "#lbar");
35  y -= step ; l.DrawLatex(x1, y, "#arcbottom") ; l.DrawText(x2, y, "#arcbottom");
36  y -= step ; l.DrawLatex(x1, y, "#downarrow") ; l.DrawText(x2, y, "#downarrow");
37  y -= step ; l.DrawLatex(x1, y, "#leftrightarrow") ; l.DrawText(x2, y, "#leftrightarrow");
38  y -= step ; l.DrawLatex(x1, y, "#Downarrow") ; l.DrawText(x2, y, "#Downarrow");
39  y -= step ; l.DrawLatex(x1, y, "#Leftrightarrow") ; l.DrawText(x2, y, "#Leftrightarrow");
40  y -= step ; l.DrawLatex(x1, y, "#void8") ; l.DrawText(x2, y, "#void8");
41  y -= step ; l.DrawLatex(x1, y, "#hbar") ; l.DrawText(x2, y, "#hbar");
42 
43  // Draw Second Column
44  y = 0.96; step = 0.0465; x1 = 0.27; x2 = x1+0.04;
45  l.DrawLatex(x1, y, "#diamond") ; l.DrawText(x2, y, "#diamond");
46  y -= step ; l.DrawLatex(x1, y, "#aleph") ; l.DrawText(x2, y, "#aleph");
47  y -= step ; l.DrawLatex(x1, y, "#geq") ; l.DrawText(x2, y, "#geq");
48  y -= step ; l.DrawLatex(x1, y, "#neq") ; l.DrawText(x2, y, "#neq");
49  y -= step ; l.DrawLatex(x1, y, "#notin") ; l.DrawText(x2, y, "#notin");
50  y -= step ; l.DrawLatex(x1, y, "#subseteq") ; l.DrawText(x2, y, "#subseteq");
51  y -= step ; l.DrawLatex(x1, y, "#cup") ; l.DrawText(x2, y, "#cup");
52  y -= step ; l.DrawLatex(x1, y, "#copyright") ; l.DrawText(x2, y, "#copyright");
53  y -= step ; l.DrawLatex(x1, y, "#void3") ; l.DrawText(x2, y, "#void3");
54  y -= step ; l.DrawLatex(x1, y, "#divide") ; l.DrawText(x2, y, "#divide");
55  y -= step ; l.DrawLatex(x1, y, "#circ") ; l.DrawText(x2, y, "#circ");
56  y -= step ; l.DrawLatex(x1, y, "#infty") ; l.DrawText(x2, y, "#infty");
57  y -= step ; l.DrawLatex(x1, y, "#angle") ; l.DrawText(x2, y, "#angle");
58  y -= step ; l.DrawLatex(x1, y, "#cbar") ; l.DrawText(x2, y, "#cbar");
59  y -= step ; l.DrawLatex(x1, y, "#arctop") ; l.DrawText(x2, y, "#arctop");
60  y -= step ; l.DrawLatex(x1, y, "#leftarrow") ; l.DrawText(x2, y, "#leftarrow");
61  y -= step ; l.DrawLatex(x1, y, "#otimes") ; l.DrawText(x2, y, "#otimes");
62  y -= step ; l.DrawLatex(x1, y, "#Leftarrow") ; l.DrawText(x2, y, "#Leftarrow");
63  y -= step ; l.DrawLatex(x1, y, "#prod") ; l.DrawText(x2, y, "#prod");
64  y -= step ; l.DrawLatex(x1, y, "#Box") ; l.DrawText(x2, y, "#Box");
65  y -= step ; l.DrawLatex(x1, y, "#parallel") ; l.DrawText(x2, y, "#parallel");
66 
67  // Draw Third Column
68  y = 0.96; step = 0.0465; x1 = 0.52; x2 = x1+0.04;
69  l.DrawLatex(x1, y, "#heart") ; l.DrawText(x2, y, "#heart");
70  y -= step ; l.DrawLatex(x1, y, "#Jgothic") ; l.DrawText(x2, y, "#Jgothic");
71  y -= step ; l.DrawLatex(x1, y, "#LT") ; l.DrawText(x2, y, "#LT");
72  y -= step ; l.DrawLatex(x1, y, "#equiv") ; l.DrawText(x2, y, "#equiv");
73  y -= step ; l.DrawLatex(x1, y, "#subset") ; l.DrawText(x2, y, "#subset");
74  y -= step ; l.DrawLatex(x1, y, "#supseteq") ; l.DrawText(x2, y, "#supseteq");
75  y -= step ; l.DrawLatex(x1, y, "#wedge") ; l.DrawText(x2, y, "#wedge");
76  y -= step ; l.DrawLatex(x1, y, "#oright") ; l.DrawText(x2, y, "#oright");
77  y -= step ; l.DrawLatex(x1, y, "#AA") ; l.DrawText(x2, y, "#AA");
78  y -= step ; l.DrawLatex(x1, y, "#pm") ; l.DrawText(x2, y, "#pm");
79  y -= step ; l.DrawLatex(x1, y, "#3dots") ; l.DrawText(x2, y, "#3dots");
80  y -= step ; l.DrawLatex(x1, y, "#nabla") ; l.DrawText(x2, y, "#nabla");
81  y -= step ; l.DrawLatex(x1, y, "#downleftarrow") ; l.DrawText(x2, y, "#downleftarrow");
82  y -= step ; l.DrawLatex(x1, y, "#topbar") ; l.DrawText(x2, y, "#topbar");
83  y -= step ; l.DrawLatex(x1, y, "#arcbar") ; l.DrawText(x2, y, "#arcbar");
84  y -= step ; l.DrawLatex(x1, y, "#uparrow") ; l.DrawText(x2, y, "#uparrow");
85  y -= step ; l.DrawLatex(x1, y, "#oplus") ; l.DrawText(x2, y, "#oplus");
86  y -= step ; l.DrawLatex(x1, y, "#Uparrow") ; l.DrawText(x2, y, "#Uparrow");
87  y -= step ; l.DrawLatex(x1, y-0.01, "#sum") ; l.DrawText(x2, y, "#sum");
88  y -= step ; l.DrawLatex(x1, y, "#perp") ; l.DrawText(x2, y, "#perp");
89 
90  // Draw Fourth Column
91  y = 0.96; step = 0.0465; x1 = 0.77; x2 = x1+0.04;
92  l.DrawLatex(x1, y, "#spade") ; l.DrawText(x2, y, "#spade");
93  y -= step ; l.DrawLatex(x1, y, "#Rgothic") ; l.DrawText(x2, y, "#Rgothic");
94  y -= step ; l.DrawLatex(x1, y, "#GT") ; l.DrawText(x2, y, "#GT");
95  y -= step ; l.DrawLatex(x1, y, "#propto") ; l.DrawText(x2, y, "#propto");
96  y -= step ; l.DrawLatex(x1, y, "#notsubset") ; l.DrawText(x2, y, "#notsubset");
97  y -= step ; l.DrawLatex(x1, y, "#oslash") ; l.DrawText(x2, y, "#oslash");
98  y -= step ; l.DrawLatex(x1, y, "#vee") ; l.DrawText(x2, y, "#vee");
99  y -= step ; l.DrawLatex(x1, y, "#void1") ; l.DrawText(x2, y, "#void1");
100  y -= step ; l.DrawLatex(x1, y, "#aa") ; l.DrawText(x2, y, "#aa");
101  y -= step ; l.DrawLatex(x1, y, "#/") ; l.DrawText(x2, y, "#/");
102  y -= step ; l.DrawLatex(x1, y, "#upoint") ; l.DrawText(x2, y, "#upoint");
103  y -= step ; l.DrawLatex(x1, y, "#partial") ; l.DrawText(x2, y, "#partial");
104  y -= step ; l.DrawLatex(x1, y, "#corner") ; l.DrawText(x2, y, "#corner");
105  y -= step ; l.DrawLatex(x1, y, "#ltbar") ; l.DrawText(x2, y, "#ltbar");
106  y -= step ; l.DrawLatex(x1, y, "#bottombar") ; l.DrawText(x2, y, "#bottombar");
107  y -= step ; l.DrawLatex(x1, y, "#rightarrow") ; l.DrawText(x2, y, "#rightarrow");
108  y -= step ; l.DrawLatex(x1, y, "#surd") ; l.DrawText(x2, y, "#surd");
109  y -= step ; l.DrawLatex(x1, y, "#Rightarrow") ; l.DrawText(x2, y, "#Rightarrow");
110  y -= step ; l.DrawLatex(x1, y-0.015, "#int") ; l.DrawText(x2, y, "#int");
111  y -= step ; l.DrawLatex(x1, y, "#odot") ; l.DrawText(x2, y, "#odot");
112 
113  // Save the picture in various formats
114  c1->Print("mathsymb.ps");
115  c1->Print("mathsymb.gif");
116  c1->Print("mathsymb.pdf");
117  c1->Print("mathsymb.svg");
118 }
return c1
Definition: legend1.C:41
virtual void Print(const char *filename="") const
Save Pad contents in a file in one of various formats.
Definition: TPad.cxx:4160
static const double x2[5]
To draw Mathematical Formula.
Definition: TLatex.h:25
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:1914
virtual void SetTextAlign(Short_t align=11)
Set the text alignment.
Definition: TAttText.h:47
TLine * l
Definition: textangle.C:4
The Canvas class.
Definition: TCanvas.h:41
static const double x1[5]
Double_t y[n]
Definition: legend1.C:17
virtual TText * DrawText(Double_t x, Double_t y, const char *text)
Draw this text with new coordinates.
Definition: TText.cxx:175
virtual void SetTextSize(Float_t tsize=1)
Set the text size.
Definition: TAttText.h:52