diff --git a/documentation/doxygen/converttonotebook.py b/documentation/doxygen/converttonotebook.py
index df0a7e3934ff53b8c4966973da98a192facbf2c2..33d49fc347cd8e06e19802b71ca3c134259c6964 100644
--- a/documentation/doxygen/converttonotebook.py
+++ b/documentation/doxygen/converttonotebook.py
@@ -196,7 +196,7 @@ def split(text):
     """
     #p = re.compile(r'^void\s\w*?\s?\([\w\n=,*\_ ]*\)\s*\{.*?^\}|^int\s\w*?\s?\([\w\n=,*\_ ]*\)\s*\{.*?^\}|^string\s\w*?\s?\([\w\n=,*\_ ]*\)\s*\{.*?^\}|^double\s\w*?\s?\([\w\n=,*\_ ]*\)\s*\{.*?^\}|^float\s\w*?\s?\([\w\n=,*\_ ]*\)\s*\{.*?^\}|^char\s\w*?\s?\([\w\n=,*\_ ]*\)\s*\{.*?^\}|^TCanvas\s\*\w*\(.*?\).*?\{.*?^\}|^TString\s\w*?\s?\([\w\n=,*\_ ]*\)\s*\{.*?^\}|^Double_t\s\w*?\s?\([\w\n=,*\_ ]*\)\s*\{.*?^\}', flags = re.DOTALL | re.MULTILINE)
 
-    p = re.compile(r'(^void|^int|^Int_t|^TF1|^string|^bool|^double|^float|^char|^TCanvas|^TString|^Double_t)\s?\*?\s?\w*?\s?\([^\)]*\)\s*\{.*?^\}', flags = re.DOTALL | re.MULTILINE)
+    p = re.compile(r'(^void|^int|^Int_t|^TF1|^string|^bool|^double|^float|^char|^TCanvas|^TString|^TSeqCollection|^Double_t|^TFile)\s?\*?\s?\w*?\s?\([^\)]*\)\s*\{.*?^\}', flags = re.DOTALL | re.MULTILINE)
     matches = p.finditer(text)
     helpers=[]
     main = ""
@@ -232,7 +232,6 @@ def split(text):
     
 
     rest = rest.rstrip() #remove newlines at the end of string
-    print  "MAIN \n\n\n" , main, "\n\n HELPERS\n\n\n", newhelpers, "\n\nREST\n\n\n",rest
     return main, newhelpers, rest
 
 def processmain(text):
@@ -246,15 +245,13 @@ def processmain(text):
     
     regex = re.compile(r'(?<=\().*?(?=\))',flags = re.DOTALL | re.MULTILINE)
     arguments = regex.search(text)
-    print "\n\nTEXT\n\n" , text , "ENDTEXT"
     if text: 
         if text.startswith("TCanvas") or len(arguments.group())>3: 
             keepfunction = True
-            p = re.compile(r'(?<=(?<=int)|(?<=void)|(?<=TF1)|(?<=Int_t)|(?<=string)|(?<=double)|(?<=float)|(?<=char)|(?<=TString)|(?<=bool)|(?<=TCanvas))\s?\*?\s?[^\s]*?(?=\s?\()',flags = re.DOTALL | re.MULTILINE)
+            p = re.compile(r'(?<=(?<=int)|(?<=void)|(?<=TF1)|(?<=Int_t)|(?<=string)|(?<=double)|(?<=float)|(?<=char)|(?<=TString)|(?<=bool)|(?<=TSeqCollection)|(?<=TCanvas)|(?<=TFile))\s?\*?\s?[^\s]*?(?=\s?\()',flags = re.DOTALL | re.MULTILINE)
 
             match = p.search(text)
             functionname=match.group().strip(" *")
-            print "FUCNITONNAME", functionname
             addition = "\n# <markdowncell> \n# Call the main function \n# <codecell>\n%s();" %functionname
         
     return text, addition, keepfunction 
@@ -419,7 +416,7 @@ def mainfunction(text):
     #subprocess.call(["jupyter", "nbconvert","--ExecutePreprocessor.timeout=60", "--to=html", "--execute",  outdir+outname])
     r = subprocess.call(["jupyter", "nbconvert","--ExecutePreprocessor.timeout=90",  "--to=notebook", "--execute",  outdir+outname])
     if r != 0:
-         sys.stderr.write( "ERROR: Nbconvert failed for notebook %s \n" % outname)
+         sys.stderr.write( "WARNING: Nbconvert failed for notebook %s \n" % outname)
     if jsroot:
         subprocess.call(["jupyter", "trust",  outdir+outnameconverted])
     os.remove(outdir+outname)
diff --git a/tutorials/fit/ConfidenceIntervals.C b/tutorials/fit/ConfidenceIntervals.C
index 95fb9d17643edd7cc248eec16b1b375461d3726a..b3fca2012a8a689ab4b2f7b7c8cfbbfbe2005b3c 100644
--- a/tutorials/fit/ConfidenceIntervals.C
+++ b/tutorials/fit/ConfidenceIntervals.C
@@ -1,5 +1,6 @@
 /// \file
 /// \ingroup tutorial_fit
+/// \notebook
 /// Illustrates TVirtualFitter::GetConfidenceIntervals
 /// This method computes confidence intervals for the fitted function
 ///
diff --git a/tutorials/fit/ErrorIntegral.C b/tutorials/fit/ErrorIntegral.C
index 869487d0736ae82c0f9a92626d16dd5b4cef7e98..c79013d1eb50cefd53d656814acc388040a5bb61 100644
--- a/tutorials/fit/ErrorIntegral.C
+++ b/tutorials/fit/ErrorIntegral.C
@@ -1,5 +1,6 @@
 /// \file
 /// \ingroup tutorial_fit
+/// \notebook
 /// Estimate the error in the integral of a fitted function
 /// taking into account the errors in the parameters resulting from the fit.
 /// The error is estimated also using the correlations values obtained from
diff --git a/tutorials/fit/fit2dHist.C b/tutorials/fit/fit2dHist.C
index a1ffa5bc26073e64c2d2395ae26d6a83706b07bf..686a3669ac30b7399ebf71dbec40525cc87ca801 100644
--- a/tutorials/fit/fit2dHist.C
+++ b/tutorials/fit/fit2dHist.C
@@ -1,6 +1,6 @@
 /// \file
 /// \ingroup tutorial_fit
-/// \notebook -js
+/// \notebook
 ///
 /// Example to fit two histograms at the same time via TVirtualFitter
 ///
diff --git a/tutorials/fit/fitLinear2.C b/tutorials/fit/fitLinear2.C
index a4b89f151537f81900aed3d7f5530de0a861e455..114f3f8998c0119500f82c78b827fd82d86a3276 100644
--- a/tutorials/fit/fitLinear2.C
+++ b/tutorials/fit/fitLinear2.C
@@ -14,13 +14,13 @@
 
 #include "TLinearFitter.h"
 #include "TF1.h"
-#include "TRandom.h"
+#include "Trandom.h"
 
 void fitLinear2()
 {
    Int_t n=100;
    Int_t i;
-   TRandom rand;
+   TRandom rand1;
    TLinearFitter *lf=new TLinearFitter(5);
 
    //The predefined "hypN" functions are the fastest to fit
@@ -32,13 +32,13 @@ void fitLinear2()
 
    //Create the points and put them into the fitter
    for (i=0; i<n; i++){
-      x[0 + i*5] = rand.Uniform(-10, 10);
-      x[1 + i*5] = rand.Uniform(-10, 10);
-      x[2 + i*5] = rand.Uniform(-10, 10);
-      x[3 + i*5] = rand.Uniform(-10, 10);
-      x[4 + i*5] = rand.Uniform(-10, 10);
+      x[0 + i*5] = rand1.Uniform(-10, 10);
+      x[1 + i*5] = rand1.Uniform(-10, 10);
+      x[2 + i*5] = rand1.Uniform(-10, 10);
+      x[3 + i*5] = rand1.Uniform(-10, 10);
+      x[4 + i*5] = rand1.Uniform(-10, 10);
       e[i] = 0.01;
-      y[i] = 4*x[0+i*5] + x[1+i*5] + 2*x[2+i*5] + 3*x[3+i*5] + 0.2*x[4+i*5]  + rand.Gaus()*e[i];
+      y[i] = 4*x[0+i*5] + x[1+i*5] + 2*x[2+i*5] + 3*x[3+i*5] + 0.2*x[4+i*5]  + rand1.Gaus()*e[i];
    }
 
    //To avoid copying the data into the fitter, the following function can be used:
@@ -61,13 +61,13 @@ void fitLinear2()
 
    //Now suppose you want to add some more points and see if the parameters will change
    for (i=n; i<n*2; i++) {
-      x[0+i*5] = rand.Uniform(-10, 10);
-      x[1+i*5] = rand.Uniform(-10, 10);
-      x[2+i*5] = rand.Uniform(-10, 10);
-      x[3+i*5] = rand.Uniform(-10, 10);
-      x[4+i*5] = rand.Uniform(-10, 10);
+      x[0+i*5] = rand1.Uniform(-10, 10);
+      x[1+i*5] = rand1.Uniform(-10, 10);
+      x[2+i*5] = rand1.Uniform(-10, 10);
+      x[3+i*5] = rand1.Uniform(-10, 10);
+      x[4+i*5] = rand1.Uniform(-10, 10);
       e[i] = 0.01;
-      y[i] = 4*x[0+i*5] + x[1+i*5] + 2*x[2+i*5] + 3*x[3+i*5] + 0.2*x[4+i*5]  + rand.Gaus()*e[i];
+      y[i] = 4*x[0+i*5] + x[1+i*5] + 2*x[2+i*5] + 3*x[3+i*5] + 0.2*x[4+i*5]  + rand1.Gaus()*e[i];
    }
 
    //Assign the data the same way as before
diff --git a/tutorials/fit/fitMultiGraph.C b/tutorials/fit/fitMultiGraph.C
index 7c7cdabd04c59739afebc215f33eb5bf41c90d4b..01add4146355b2e948b704b196ac53f4cc667751 100644
--- a/tutorials/fit/fitMultiGraph.C
+++ b/tutorials/fit/fitMultiGraph.C
@@ -20,35 +20,35 @@
 void fitMultiGraph()
 {
    Int_t n = 30;
-   Double_t *x1 = new Double_t[n];
-   Double_t *x2 = new Double_t[n];
-   Double_t *x3 = new Double_t[n];
-   Double_t *y1 = new Double_t[n];
-   Double_t *y2 = new Double_t[n];
-   Double_t *y3 = new Double_t[n];
-   Double_t *e1 = new Double_t[n];
-   Double_t *e2 = new Double_t[n];
-   Double_t *e3 = new Double_t[n];
+   Double_t *xvalues1 = new Double_t[n];
+   Double_t *xvalues2 = new Double_t[n];
+   Double_t *xvalues3 = new Double_t[n];
+   Double_t *yvalues1 = new Double_t[n];
+   Double_t *yvalues2 = new Double_t[n];
+   Double_t *yvalues3 = new Double_t[n];
+   Double_t *evalues1 = new Double_t[n];
+   Double_t *evalues2 = new Double_t[n];
+   Double_t *evalues3 = new Double_t[n];
 
    //generate the data for the graphs
    TRandom r;
    Int_t i;
    for (i=0; i<n; i++) {
-      x1[i] = r.Uniform(0.1, 5);
-      x2[i] = r.Uniform(3, 8);
-      x3[i] = r.Uniform(9, 15);
-      y1[i] = 3 + 2*x1[i] + x1[i]*x1[i] + r.Gaus();
-      y2[i] = 3 + 2*x2[i] + x2[i]*x2[i] + r.Gaus()*10;
-      e1[i] = 1;
-      e2[i] = 10;
-      e3[i] = 20;
-      y3[i] = 3 + 2*x3[i] + x3[i]*x3[i] + r.Gaus()*20;
+      xvalues1[i] = r.Uniform(0.1, 5);
+      xvalues2[i] = r.Uniform(3, 8);
+      xvalues3[i] = r.Uniform(9, 15);
+      yvalues1[i] = 3 + 2*xvalues1[i] + xvalues1[i]*xvalues1[i] + r.Gaus();
+      yvalues2[i] = 3 + 2*xvalues2[i] + xvalues2[i]*xvalues2[i] + r.Gaus()*10;
+      evalues1[i] = 1;
+      evalues2[i] = 10;
+      evalues3[i] = 20;
+      yvalues3[i] = 3 + 2*xvalues3[i] + xvalues3[i]*xvalues3[i] + r.Gaus()*20;
    }
 
    //create the graphs and set their drawing options
-   TGraphErrors *gr1 = new TGraphErrors(n, x1, y1, 0, e1);
-   TGraphErrors *gr2 = new TGraphErrors(n, x2, y2, 0, e2);
-   TGraphErrors *gr3 = new TGraphErrors(n, x3, y3, 0, e3);
+   TGraphErrors *gr1 = new TGraphErrors(n, xvalues1, yvalues1, 0, evalues1);
+   TGraphErrors *gr2 = new TGraphErrors(n, xvalues2, yvalues2, 0, evalues2);
+   TGraphErrors *gr3 = new TGraphErrors(n, xvalues3, yvalues3, 0, evalues3);
    gr1->SetLineColor(kRed);
    gr2->SetLineColor(kBlue);
    gr2->SetMarkerStyle(24);
@@ -83,15 +83,15 @@ void fitMultiGraph()
 void fitminuit()
 {
    Int_t n = 30;
-   Double_t *x1 = new Double_t[n];
-   Double_t *x2 = new Double_t[n];
-   Double_t *x3 = new Double_t[n];
-   Double_t *y1 = new Double_t[n];
-   Double_t *y2 = new Double_t[n];
-   Double_t *y3 = new Double_t[n];
-   Double_t *e1 = new Double_t[n];
-   Double_t *e2 = new Double_t[n];
-   Double_t *e3 = new Double_t[n];
+   Double_t *xvalues1 = new Double_t[n];
+   Double_t *xvalues2 = new Double_t[n];
+   Double_t *xvalues3 = new Double_t[n];
+   Double_t *yvalues1 = new Double_t[n];
+   Double_t *yvalues2 = new Double_t[n];
+   Double_t *yvalues3 = new Double_t[n];
+   Double_t *evalues1 = new Double_t[n];
+   Double_t *evalues2 = new Double_t[n];
+   Double_t *evalues3 = new Double_t[n];
    Double_t *xtotal = new Double_t[n*3];
    Double_t *ytotal = new Double_t[n*3];
    Double_t *etotal = new Double_t[n*3];
@@ -99,27 +99,27 @@ void fitminuit()
    TRandom r;
    Int_t i;
    for (i=0; i<n; i++) {
-      x1[i] = r.Uniform(-3, -1);
-      x2[i] = r.Uniform(-1, 1);
-      x3[i] = r.Uniform(1, 3);
-      y1[i] = TMath::Gaus(x1[i], 0, 1);
-      y2[i] = TMath::Gaus(x2[i], 0, 1);
-      e1[i] = 0.00001;
-      e2[i] = 0.00001;
-      e3[i] = 0.00001;
-      y3[i] = TMath::Gaus(x3[i], 0, 1);
+      xvalues1[i] = r.Uniform(-3, -1);
+      xvalues2[i] = r.Uniform(-1, 1);
+      xvalues3[i] = r.Uniform(1, 3);
+      yvalues1[i] = TMath::Gaus(xvalues1[i], 0, 1);
+      yvalues2[i] = TMath::Gaus(xvalues2[i], 0, 1);
+      evalues1[i] = 0.00001;
+      evalues2[i] = 0.00001;
+      evalues3[i] = 0.00001;
+      yvalues3[i] = TMath::Gaus(xvalues3[i], 0, 1);
    }
    for (i=0; i<n; i++)
-      {xtotal[i]=x1[i]; ytotal[i]=y1[i]; etotal[i]=0.00001;}
+      {xtotal[i]=xvalues1[i]; ytotal[i]=yvalues1[i]; etotal[i]=0.00001;}
    for (i=n; i<2*n; i++)
-      {xtotal[i] = x2[i-n]; ytotal[i]=y2[i-n]; etotal[i]=0.00001;}
+      {xtotal[i] = xvalues2[i-n]; ytotal[i]=yvalues2[i-n]; etotal[i]=0.00001;}
    for (i=2*n; i<3*n; i++)
-      {xtotal[i] = x3[i-2*n]; ytotal[i]=y3[i-2*n]; etotal[i]=0.00001;}
+      {xtotal[i] = xvalues3[i-2*n]; ytotal[i]=yvalues3[i-2*n]; etotal[i]=0.00001;}
 
    //create the graphs and set their drawing options
-   TGraphErrors *gr1 = new TGraphErrors(n, x1, y1, 0, e1);
-   TGraphErrors *gr2 = new TGraphErrors(n, x2, y2, 0, e2);
-   TGraphErrors *gr3 = new TGraphErrors(n, x3, y3, 0, e3);
+   TGraphErrors *gr1 = new TGraphErrors(n, xvalues1, yvalues1, 0, evalues1);
+   TGraphErrors *gr2 = new TGraphErrors(n, xvalues2, yvalues2, 0, evalues2);
+   TGraphErrors *gr3 = new TGraphErrors(n, xvalues3, yvalues3, 0, evalues3);
    TGraphErrors *grtotal = new TGraphErrors(n*3, xtotal, ytotal, 0, etotal);
    TMultiGraph *mg=new TMultiGraph("mg", "TMultiGraph of 3 TGraphErrors");
    mg->Add(gr1);
diff --git a/tutorials/fit/fitcont.C b/tutorials/fit/fitcont.C
index 4332be96ce8b0b1199503f9ed2ee1677bbe4afda..0a1eeb2842e424e8ca1f8eb1032eecb28e6001bb 100644
--- a/tutorials/fit/fitcont.C
+++ b/tutorials/fit/fitcont.C
@@ -1,5 +1,6 @@
 /// \file
 /// \ingroup tutorial_fit
+/// \notebook
 /// Example illustrating how to draw the n-sigma contour of a Minuit fit.
 /// To get the n-sigma contour the ERRDEF parameter in Minuit has to set
 /// to n^2. The fcn function has to be set before the routine is called.
diff --git a/tutorials/fit/fitslicesy.C b/tutorials/fit/fitslicesy.C
index 4c39b36d5260daceede33d149d9063d93f434d9b..2c71d91b9a06b280d3102bf3bbf2a02b40ba4859 100644
--- a/tutorials/fit/fitslicesy.C
+++ b/tutorials/fit/fitslicesy.C
@@ -23,8 +23,8 @@ void fitslicesy() {
    gStyle->SetTitleH(0.1);
 
 // Connect the input file and get the 2-d histogram in memory
-   TString dir = gROOT.GetTutorialsDir()
-   dir.Append("/hsimple.C")
+   TString dir = gROOT->GetTutorialsDir();
+   dir.Append("/hsimple.C");
    dir.ReplaceAll("/./","/");
    if (!gInterpreter->IsLoaded(dir.Data())) gInterpreter->LoadMacro(dir.Data());
    TFile *hsimple = (TFile*)gROOT->ProcessLineFast("hsimple(1)");
diff --git a/tutorials/fit/langaus.C b/tutorials/fit/langaus.C
index 72d4cccb69b80880d5ecfaba68d688bbc9807601..297b7804387e3c39fe0af1823ffb6993ce466bc4 100644
--- a/tutorials/fit/langaus.C
+++ b/tutorials/fit/langaus.C
@@ -8,15 +8,15 @@
 ///
 ///  to execute this example, do:
 ///
-/// ~~~ {.cpp}
+/// ```cpp
 ///  root > .x langaus.C
-/// ~~~
+/// ```
 ///
 /// or
 ///
-/// ~~~ {.cpp}
+/// ```cpp
 ///  root > .x langaus.C++
-/// ~~~
+/// ```
 ///
 /// \macro_image
 /// \macro_output
diff --git a/tutorials/fit/line3Dfit.C b/tutorials/fit/line3Dfit.C
index f75305c3182781191c09bc70cca6255daa3f8677..99deed32c6d5b465312623b61caf8d29d4f961c2 100644
--- a/tutorials/fit/line3Dfit.C
+++ b/tutorials/fit/line3Dfit.C
@@ -1,5 +1,6 @@
 /// \file
 /// \ingroup tutorial_fit
+/// \notebook
 /// Fitting of a TGraph2D with a 3D straight line
 ///
 /// run this macro by doing:
@@ -98,8 +99,8 @@ Int_t line3Dfit()
    Int_t nd = 10000;
 
 
-//    double xmin = 0; double ymin = 0;
-//    double xmax = 10; double ymax = 10;
+   // double xmin = 0; double ymin = 0;
+   // double xmax = 10; double ymax = 10;
 
    TGraph2D * gr = new TGraph2D();
 
@@ -129,7 +130,9 @@ Int_t line3Dfit()
    SumDistance2 sdist(gr);
 #ifdef __CINT__
    ROOT::Math::Functor fcn(&sdist,4,"SumDistance2");
+   cout << "CINT" << endl;
 #else
+   cout << "NOT CINT" << endl;
    ROOT::Math::Functor fcn(sdist,4);
 #endif
    // set the function and the initial parameter values
diff --git a/tutorials/fit/myfit.C b/tutorials/fit/myfit.C
index e292b6d004414b6b6bc9ce97ab041aa33a41163e..20c693970c174187007b576a49e24bd21a249bb4 100644
--- a/tutorials/fit/myfit.C
+++ b/tutorials/fit/myfit.C
@@ -25,8 +25,8 @@ Double_t fitf(Double_t *x, Double_t *par)
 }
 void myfit()
 {
-   TString dir = gROOT.GetTutorialsDir()
-   dir.Append("/hsimple.C")
+   TString dir = gROOT->GetTutorialsDir();
+   dir.Append("/hsimple.C");
    dir.ReplaceAll("/./","/");
    if (!gInterpreter->IsLoaded(dir.Data())) gInterpreter->LoadMacro(dir.Data());
    TFile *hsimple = (TFile*)gROOT->ProcessLineFast("hsimple(1)");
diff --git a/tutorials/graphics/anim.C b/tutorials/graphics/anim.C
index 8208fcdd2a964bfd2014d55673aaa98900df93f6..efdaaedb81b449b6412ec8888e159ffc2b8779d7 100644
--- a/tutorials/graphics/anim.C
+++ b/tutorials/graphics/anim.C
@@ -1,6 +1,5 @@
 /// \file
 /// \ingroup tutorial_graphics
-/// \notebook
 /// Macro illustrating how to animate a picture using a Timer.
 ///
 /// \macro_code
diff --git a/tutorials/graphics/earth.C b/tutorials/graphics/earth.C
index 05aceee301ab77247bba1e540b2a3f5fbb4ba1d0..66f2470b8de0ffc3474970e41721f764a6098470 100644
--- a/tutorials/graphics/earth.C
+++ b/tutorials/graphics/earth.C
@@ -27,8 +27,8 @@ TCanvas *earth(){
    TH2F *hs = new TH2F("hs","Sinusoidal",180, -180, 180, 181, -90.5, 90.5);
    TH2F *hp = new TH2F("hp","Parabolic", 180, -180, 180, 181, -90.5, 90.5);
 
-   TString dat = gSystem->UnixPathName(__FILE__);
-   dat.ReplaceAll(".C",".dat");
+   TString dat = gROOT->GetTutorialsDir();
+   dat.Append("/graphics/earth.dat");
    dat.ReplaceAll("/./","/");
 
    ifstream in;
diff --git a/tutorials/graphics/polytest1.C b/tutorials/graphics/polytest1.C
index f6bf2b4506b6bc6e5b830529198522bf1312fe1a..5712c2ad8a8b3c8ce253f5e66831255bebd8b68b 100644
--- a/tutorials/graphics/polytest1.C
+++ b/tutorials/graphics/polytest1.C
@@ -1,5 +1,6 @@
 /// \file
 /// \ingroup tutorial_graphics
+/// \notebook
 /// This macro is testing the "compacting" algorithm in TPadPainter.
 /// It reduces the number of polygon's vertices using actual pixel coordinates.
 ///
diff --git a/tutorials/graphics/psview.C b/tutorials/graphics/psview.C
index 6e4c2f7b8edfafa6653e48c8dd1f7261f0d0ac45..3cd25dd1250538d7d44c16d46e8e1533276297ef 100644
--- a/tutorials/graphics/psview.C
+++ b/tutorials/graphics/psview.C
@@ -1,6 +1,5 @@
 /// \file
 /// \ingroup tutorial_graphics
-/// \notebook
 /// An example how to display PS, EPS, PDF files in canvas.
 /// To load a PS file in a TCanvas, the ghostscript program needs to be install.
 /// - On most unix systems it is installed by default.
diff --git a/tutorials/graphs/graphstruct.C b/tutorials/graphs/graphstruct.C
index 999dc948df170d9974fb1fe4689e9024e145235f..92edfee01f64ef9836a4342c655aa9898be2cbf3 100644
--- a/tutorials/graphs/graphstruct.C
+++ b/tutorials/graphs/graphstruct.C
@@ -1,5 +1,6 @@
 /// \file
 /// \ingroup tutorial_graphs
+/// \notebook
 /// Draw a simple graph structure.
 /// The graph layout is made using graphviz. This macro creates some
 /// nodes and edges and change a few graphical attributes on some of them.
@@ -9,6 +10,7 @@
 ///
 /// \author Olivier Couet
 
+void graphstruct()
 {
    TGraphStruct *gs = new TGraphStruct();
 
diff --git a/tutorials/graphs/motorcycle.C b/tutorials/graphs/motorcycle.C
index d7e6d76fc6539fbc5211af33de9f2463ffc5605a..8c12977bf528dd88ebe1c718572a71e4ec72ba7f 100644
--- a/tutorials/graphs/motorcycle.C
+++ b/tutorials/graphs/motorcycle.C
@@ -1,5 +1,6 @@
 /// \file
 /// \ingroup tutorial_graphs
+/// \notebook
 /// Macro to test scatterplot smoothers: ksmooth, lowess, supsmu
 /// as described in:
 ///
@@ -42,8 +43,8 @@ void DrawSmooth(Int_t pad, const char *title, const char *xt, const char *yt)
 void motorcycle()
 {
 // data taken from R library MASS: mcycle.txt
-   TString dir = gSystem->UnixPathName(__FILE__);
-   dir.ReplaceAll("motorcycle.C","");
+   TString dir = gROOT->GetTutorialsDir();
+   dir.Append("/graphs/");
    dir.ReplaceAll("/./","/");
 
 // read file and add to fit object
diff --git a/tutorials/graphs/waves.C b/tutorials/graphs/waves.C
index 05602ee73d7ffe651b7061087f5fbd92d71213f6..d2e1e8f425a2f72c85788e22af6b6a76a0a206ed 100644
--- a/tutorials/graphs/waves.C
+++ b/tutorials/graphs/waves.C
@@ -1,6 +1,6 @@
 /// \file
 /// \ingroup tutorial_graphs
-///
+/// \notebook
 /// Hint: Spherical waves
 ///
 /// \macro_image
diff --git a/tutorials/hist/FirstContour.C b/tutorials/hist/FirstContour.C
index 58c421227498220b616eaae1becc42b83f7ab81f..04b2da74eb9820649180be2c62f2d71178aab333 100644
--- a/tutorials/hist/FirstContour.C
+++ b/tutorials/hist/FirstContour.C
@@ -13,8 +13,8 @@
 
 void FirstContour()
 {
-   TString dir = gSystem->UnixPathName(__FILE__);
-   dir.ReplaceAll("FirstContour.C","../hsimple.C");
+   TString dir = gROOT->GetTutorialsDir();
+   dir.Append("/hsimple.C");
    dir.ReplaceAll("/./","/");
    if (!gInterpreter->IsLoaded(dir.Data())) gInterpreter->LoadMacro(dir.Data());
    TFile *file = (TFile*)gROOT->ProcessLineFast("hsimple(1)");
diff --git a/tutorials/hist/candleplotstack.C b/tutorials/hist/candleplotstack.C
index 4f0f1f1ca6c8c4b702ab06b77ef07cb9c1f0f0df..821aedcc6a8c720e6e0b1b0b8e0379aa9294a6c8 100644
--- a/tutorials/hist/candleplotstack.C
+++ b/tutorials/hist/candleplotstack.C
@@ -1,5 +1,6 @@
 /// \file
 /// \ingroup tutorial_hist
+/// \notebook
 /// Example showing how a THStack with candle plot option.
 ///
 /// \macro_image
diff --git a/tutorials/hist/draw2dopt.C b/tutorials/hist/draw2dopt.C
index 99446adb808fceac62453880c78091a40d1ae90b..8efc19428b0d8a307c1eca9601e76ab7451d06eb 100644
--- a/tutorials/hist/draw2dopt.C
+++ b/tutorials/hist/draw2dopt.C
@@ -7,6 +7,7 @@
 ///
 /// \author Rene Brun
 
+void draw2dopt()
 {
    gStyle->SetOptStat(0);
    gStyle->SetPalette(1);
diff --git a/tutorials/hist/exec1.C b/tutorials/hist/exec1.C
index b0d80427b8322fac6ef61ac8d1221e3326a9fb4a..7446e0cbe18377494a00df954c56e706dabb318d 100644
--- a/tutorials/hist/exec1.C
+++ b/tutorials/hist/exec1.C
@@ -1,6 +1,5 @@
 /// \file
 /// \ingroup tutorial_hist
-/// \notebook
 /// Echo object at mouse position.
 /// Example of macro called when a pad is redrawn
 /// one must create a TExec object in the following way
diff --git a/tutorials/hist/h1draw.C b/tutorials/hist/h1draw.C
index 1c7a430351863b82f0e0326c72222eb8c239a07d..96605209cf87a0150d18391623ea0eff2fde9bad 100644
--- a/tutorials/hist/h1draw.C
+++ b/tutorials/hist/h1draw.C
@@ -25,8 +25,8 @@
 
 void h1draw()
 {
-   TString dir = gSystem->UnixPathName(__FILE__);
-   dir.ReplaceAll("h1draw.C","../hsimple.C");
+   TString dir = gROOT->GetTutorialsDir();
+   dir.Append("/hsimple.C");
    dir.ReplaceAll("/./","/");
    if (gBenchmark->GetBench("hsimple") < 0) gInterpreter->LoadMacro(dir.Data());
    TFile *example = (TFile*)gROOT->ProcessLineFast("hsimple(1)");
diff --git a/tutorials/hist/hbars.C b/tutorials/hist/hbars.C
index 491526b1a336b5610ab75c5cb869337e34d4f998..81aad5bc0857b09bac68014fd745a92a0cace92c 100644
--- a/tutorials/hist/hbars.C
+++ b/tutorials/hist/hbars.C
@@ -12,8 +12,8 @@ TCanvas *hbars() {
    cout << gSystem->DirName(__FILE__) << endl;
 
    // Try to open first the file cernstaff.root in tutorials/tree directory
-   TString filedir = gSystem->DirName(__FILE__);
-   filedir += TString("/../tree/");
+   TString filedir = gROOT->GetTutorialsDir();
+   filedir += TString("/tree/");
    TString filename = "cernstaff.root";
    bool fileNotFound = gSystem->AccessPathName(filename); // note opposite return code
 
diff --git a/tutorials/hist/th2polyHoneycomb.C b/tutorials/hist/th2polyHoneycomb.C
index 1d58f486a2125e2c352069bdc366d06da62318c7..45fc31eaa79e867813899d8dea37b9f1c5409960 100644
--- a/tutorials/hist/th2polyHoneycomb.C
+++ b/tutorials/hist/th2polyHoneycomb.C
@@ -1,6 +1,5 @@
 /// \file
 /// \ingroup tutorial_hist
-/// \notebook
 /// This tutorial illustrates how to create an histogram with hexagonal
 /// bins (TH2Poly), fill it and draw it using GL.
 ///
diff --git a/tutorials/hist/th2polyUSA.C b/tutorials/hist/th2polyUSA.C
index 1086cd9b1b9753813bbb1360c0064f142d1ec950..84aa00ac0baa429060bdb2ea0ca53e55d6df1062 100644
--- a/tutorials/hist/th2polyUSA.C
+++ b/tutorials/hist/th2polyUSA.C
@@ -1,6 +1,5 @@
 /// \file
 /// \ingroup tutorial_hist
-/// \notebook
 /// This tutorial illustrates how to create an histogram with polygonal
 /// bins (TH2Poly), fill it and draw it using GL. The initial data are stored
 /// in TMultiGraphs. They represent the USA.
diff --git a/tutorials/hsimple.C b/tutorials/hsimple.C
index 2d819f5ab3a1dcfcd9a0133cfe96b915f0172ed6..ebcd1edd6c26daf6a0a6c7fa2c9138cb1187a3fc 100644
--- a/tutorials/hsimple.C
+++ b/tutorials/hsimple.C
@@ -1,5 +1,6 @@
 /// \file
 /// \ingroup Tutorials
+/// \notebook
 ///  This program creates :
 ///    - a one dimensional histogram
 ///    - a two dimensional histogram
@@ -33,8 +34,7 @@
 TFile *hsimple(Int_t get=0)
 {
    TString filename = "hsimple.root";
-   TString dir = gSystem->UnixPathName(__FILE__);
-   dir.ReplaceAll("hsimple.C","");
+   TString dir = gROOT->GetTutorialsDir();
    dir.ReplaceAll("/./","/");
    TFile *hfile = 0;
    if (get) {
@@ -106,6 +106,6 @@ TFile *hsimple(Int_t get=0)
    c1->Modified();
    return hfile;
 
-// Note that the file is automatically close when application terminates
-// or when the file destructor is called.
+   // Note that the file is automatically close when application terminates
+   // or when the file destructor is called.
 }
diff --git a/tutorials/io/copyFiles.C b/tutorials/io/copyFiles.C
index 8ebce6c1dbbbf621c1f7bf01c333c0568459f14e..e6fa0e46ce2e728627b1c2c6280304eda856cef3 100644
--- a/tutorials/io/copyFiles.C
+++ b/tutorials/io/copyFiles.C
@@ -1,5 +1,6 @@
 /// \file
 /// \ingroup tutorial_io
+/// \notebook -nodraw
 /// Example of script showing how to copy all objects (including directories)
 /// from a source file.
 /// For each input file, a new directory is created in the current directory
diff --git a/tutorials/io/dirs.C b/tutorials/io/dirs.C
index 55bf234b75d999d274a7c2374b3a79a73272a835..9b3f3e410980c3cd9961dbd19f59c7099848bd1c 100644
--- a/tutorials/io/dirs.C
+++ b/tutorials/io/dirs.C
@@ -1,5 +1,6 @@
 /// \file
 /// \ingroup tutorial_io
+/// \notebook -nodraw
 /// This macro illustrates how to create a hierarchy of directories
 /// in a Root file.
 /// Ten directories called plane0, plane1, ..., plane9 are created.
diff --git a/tutorials/io/fildir.C b/tutorials/io/fildir.C
index bb777e7369c6e40d1992be3b82acb9d58ee33653..7466b2c637a43655422c55e3ddafb77a4bf4266e 100644
--- a/tutorials/io/fildir.C
+++ b/tutorials/io/fildir.C
@@ -1,5 +1,6 @@
 /// \file
 /// \ingroup tutorial_io
+/// \notebook
 /// This macro displays the ROOT Directory data structure
 ///
 /// \macro_image
diff --git a/tutorials/io/file.C b/tutorials/io/file.C
index 96b5fad80724fae4bd731e50b5d2f5c05fbd6e2a..daf9f7223071dcf4e363723e8bf657111ef94a23 100644
--- a/tutorials/io/file.C
+++ b/tutorials/io/file.C
@@ -1,5 +1,6 @@
 /// \file
 /// \ingroup tutorial_io
+/// \notebook
 /// This macro displays the physical ROOT file structure
 ///
 /// \macro_image
diff --git a/tutorials/io/hadd.C b/tutorials/io/hadd.C
index 49230efb79b0cce1c137871b35a88a20c6ca01f1..d6f250d4071cb64d378f91ba0d0ee48ddf301770 100644
--- a/tutorials/io/hadd.C
+++ b/tutorials/io/hadd.C
@@ -1,5 +1,6 @@
 /// \file
 /// \ingroup tutorial_io
+/// \notebook -nodraw
 /// Macro to add histogram files
 /// This macro is kept for didactical purposes only: use instead the executable $ROOTSYS/bin/hadd !
 /// 
diff --git a/tutorials/io/importCode.C b/tutorials/io/importCode.C
index bcf57d14074ee99686a5d15da01a24a0cdc5f2a5..9799610d8615fb786824e971d6e185902e3778af 100644
--- a/tutorials/io/importCode.C
+++ b/tutorials/io/importCode.C
@@ -1,5 +1,6 @@
 /// \file
 /// \ingroup tutorial_io
+/// \notebook -nodraw
 /// Example of script showing how to create a ROOT file with subdirectories.
 /// The script scans a given directory tree and recreates the same structure in the ROOT file.
 /// All source files of type .h,cxx,c,dat,py are imported as TMacro objects.
@@ -53,6 +54,7 @@ void importdir(const char *dirname) {
 }
 void importCode() {
    TFile *f = new TFile("code.root","recreate");
-   importdir("../tutorials"); //change the directory as you like
+   TString dir = gROOT->GetTutorialsDir();
+   importdir(dir); //change the directory as you like
    delete f;
 }
diff --git a/tutorials/io/loopdir.C b/tutorials/io/loopdir.C
index 7b1362881738d567349d91bf8891f6bb94c2cbfd..72fbee74ccc2bb7dff04f6812e48bbca5f009067 100644
--- a/tutorials/io/loopdir.C
+++ b/tutorials/io/loopdir.C
@@ -1,5 +1,6 @@
 /// \file
 /// \ingroup tutorial_io
+/// \notebook -nodraw
 /// Example of script to loop on all the objects of a ROOT file directory
 /// and print on Postscript all TH1 derived objects.
 /// This script uses the file generated by tutorial hsimple.C
diff --git a/tutorials/io/mergeSelective.C b/tutorials/io/mergeSelective.C
index 4532e6a505d4d8bec26a963cc2bfb760d8b5523a..f71e9ce8eec8f72eccd8c95e6c9be509f92ffb76 100644
--- a/tutorials/io/mergeSelective.C
+++ b/tutorials/io/mergeSelective.C
@@ -1,5 +1,6 @@
 /// \file
 /// \ingroup tutorial_io
+/// \notebook
 /// Merge only part of the content of a set of files.
 /// This macro demonstrates how to merge only a part of the content of a set
 /// of input files, specified via the interface.
@@ -17,8 +18,8 @@
 ///
 /// 2. kSkipListed: via <tt>TFileMerger::PartialMerge(kSkipListed)</tt>
 ///    This will skip merging of specified objects. If a folder is specified, its
-///    whole content will be skipped.
-///
+///    whole content will be skipped. 
+/// 
 /// Important note: the kOnlyListed and kSkipListed flags have to be bitwise OR-ed
 /// on top of the merging defaults: kAll | kIncremental (as in the example)
 ///
diff --git a/tutorials/io/readCode.C b/tutorials/io/readCode.C
index d4e54790c9b38718d9429bfa5d4b407cfcca6792..e124830153b5397a280b45cf77ac7d6013344174 100644
--- a/tutorials/io/readCode.C
+++ b/tutorials/io/readCode.C
@@ -1,5 +1,6 @@
 /// \file
 /// \ingroup tutorial_io
+/// \notebook -nodraw
 /// Example of script showing how to navigate in a ROOT file
 /// with sub-directories and read the objects in each sub-directory.
 /// This example uses the file produced by the tutorial importCode.C
diff --git a/tutorials/io/testMergeCont.C b/tutorials/io/testMergeCont.C
index 244b6e621cd7e4fbcb446e70b53282841261ebcf..96f2cbef85dcfa58e4f35d12228c1b397b9abc33 100644
--- a/tutorials/io/testMergeCont.C
+++ b/tutorials/io/testMergeCont.C
@@ -1,5 +1,6 @@
 /// \file
 /// \ingroup tutorial_io
+/// \notebook
 /// Macro demonstrating the merging of containers.
 /// \macro_code
 ///
@@ -7,29 +8,6 @@
 
 TFile *f;
 
-TSeqCollection *GetCollection();
-
-void testMergeCont()
-{
-   TString tutdir = gROOT->GetTutorialsDir();
-   gROOT->LoadMacro(tutdir+"/hsimple.C");
-   TList *list = (TList *)GetCollection();
-   TList *inputs = new TList();
-   for (Int_t i=0; i<10; i++) {
-      inputs->AddAt(GetCollection(),0);
-      list->Merge(inputs);
-      inputs->Delete();
-      f->Close();
-   }
-   delete inputs;
-   TH1F *hpx = (TH1F*)(((TList*)list->At(1))->At(0));
-   printf("============================================\n");
-   printf("Total  hpx: %d entries\n", (int)hpx->GetEntries());
-   hpx->Draw();
-   list->Delete();
-   delete list;
-}
-
 
 TSeqCollection *GetCollection()
 {
@@ -58,3 +36,24 @@ TSeqCollection *GetCollection()
    l0->Add(l01);
    return l0;
 }
+
+void testMergeCont()
+{
+   TString tutdir = gROOT->GetTutorialsDir();
+   gROOT->LoadMacro(tutdir+"/hsimple.C");
+   TList *list1 = (TList *)GetCollection();
+   TList *inputs = new TList();
+   for (Int_t i=0; i<10; i++) {
+      inputs->AddAt(GetCollection(),0);
+      list1->Merge(inputs);
+      inputs->Delete();
+      f->Close();
+   }
+   delete inputs;
+   TH1F *hpx = (TH1F*)(((TList*)list1->At(1))->At(0));
+   printf("============================================\n");
+   printf("Total  hpx: %d entries\n", (int)hpx->GetEntries());
+   hpx->Draw();
+   list1->Delete();
+   delete list1;
+}