Logo ROOT  
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
11void 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}
The Canvas class.
Definition: TCanvas.h:23
To draw Mathematical Formula.
Definition: TLatex.h:18
return c1
Definition: legend1.C:41
TLine l
Definition: textangle.C:4