Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
latex_url.cxx
Go to the documentation of this file.
1/// \file
2/// \ingroup tutorial_webcanv
3/// \notebook -js
4/// Use of interactive URL links inside TLatex.
5///
6/// JSROOT now supports '#url[link]{label}' syntax
7/// It can be combined with any other latex commands like color ot font.
8/// While TLatex used in many places, one can add external links to histogram title,
9/// axis title, legend entry and so on.
10///
11/// Functionality available only in web-based graphics
12///
13/// \macro_image (tcanvas_js)
14/// \macro_code
15///
16/// \author Sergey Linev
17
18void latex_url()
19{
20 auto c1 = new TCanvas("c1", "Use of #url in TLatex", 1200, 800);
21
22 if (!gROOT->IsBatch() && !c1->IsWeb())
23 ::Warning("latex_url.cxx", "macro may not work without enabling web-based canvas");
24
25 auto latex = new TLatex(0.5, 0.5, "Link on #color[4]{#url[https://root.cern]{root.cern}} web site");
26 latex->SetTextSize(0.1);
27 latex->SetTextAlign(22);
28 c1->Add(latex);
29}
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
void Warning(const char *location, const char *msgfmt,...)
Use this function in warning situations.
Definition TError.cxx:229
#define gROOT
Definition TROOT.h:406
The Canvas class.
Definition TCanvas.h:23
To draw Mathematical Formula.
Definition TLatex.h:18
return c1
Definition legend1.C:41