Logo ROOT   6.07/09
Reference Guide
latex.C
Go to the documentation of this file.
1 /// \file
2 /// \ingroup tutorial_graphics
3 /// \notebook
4 /// This macro draws 5 Latex-style formula in a canvas and prints the canvas as a Postscript file.
5 ///
6 /// \macro_image
7 /// \macro_code
8 ///
9 /// \author Rene Brun
10 
11 void latex() {
12  TCanvas *c1 = new TCanvas("c1","test",600,700);
13  // write formulas
14  TLatex l;
15  l.SetTextAlign(12);
16  l.SetTextSize(0.04);
17  l.DrawLatex(0.1,0.9,"1) C(x) = d #sqrt{#frac{2}{#lambdaD}}\
18  #int^{x}_{0}cos(#frac{#pi}{2}t^{2})dt");
19  l.DrawLatex(0.1,0.7,"2) C(x) = d #sqrt{#frac{2}{#lambdaD}}\
20  #int^{x}cos(#frac{#pi}{2}t^{2})dt");
21  l.DrawLatex(0.1,0.5,"3) R = |A|^{2} = #frac{1}{2}#left(#[]{#frac{1}{2}+\
22  C(V)}^{2}+#[]{#frac{1}{2}+S(V)}^{2}#right)");
23  l.DrawLatex(0.1,0.3,
24  "4) F(t) = #sum_{i=-#infty}^{#infty}A(i)cos#[]{#frac{i}{t+i}}");
25  l.DrawLatex(0.1,0.1,"5) {}_{3}^{7}Li");
26  c1->Print("latex.ps");
27 }
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
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
virtual void SetTextSize(Float_t tsize=1)
Set the text size.
Definition: TAttText.h:52