Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
latex_url.cxx File Reference

Detailed Description

View in nbviewer Open in SWAN
Use of interactive URL links inside TLatex.

JSROOT now supports '#url[link]{label}' syntax It can be combined with any other latex commands like color ot font. While TLatex used in many places, one can add external links to histogram title, axis title, legend entry and so on.

Functionality available only in web-based graphics

void latex_url()
{
auto c1 = new TCanvas("c1", "Use of #url in TLatex", 1200, 800);
if (!gROOT->IsBatch() && !c1->IsWeb())
::Warning("latex_url.cxx", "macro may not work without enabling web-based canvas");
auto latex = new TLatex(0.5, 0.5, "Link on #color[4]{#url[https://root.cern]{root.cern}} web site");
latex->SetTextSize(0.1);
latex->SetTextAlign(22);
c1->Add(latex);
}
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
Author
Sergey Linev

Definition in file latex_url.cxx.