Tilde messed up in EPS output

Hi - the following script in ROOT 4.00/08 produces messed up tilde’s in my EPS output:

hep.caltech.edu/~edward/penalty.eps

(Executed using the ROOT command line)

.L mypenalty.C TF1 * myfunc = new TF1("myfunc","x",0.0,10); TF1 * myfunc2 = new TF1("myfunc2",mypenalty,0.0,10,1); //myfunc->SetTitle("") myfunc->SetTitle("#tilde{B}'"); //myfunc2->SetTitle("") myfunc->Draw(); myfunc->GetXaxis()->SetTitle("#tilde{B}"); //myfunc->GetYaxis()->SetTitle("#tilde{B}'"); myfunc->SetTitle("#tilde{B}'"); myfunc->Draw(); myfunc2->SetLineColor(2); myfunc2->Draw("SAME"); Float_t legendX1C; Float_t legendX2C; Float_t legendY1C; Float_t legendY2C; legendY1C = 0.70; legendY2C = 0.89; legendX1C = 0.15; legendX2C = 0.29; TLegend * myLegend = new TLegend(legendX1C,legendY1C,legendX2C,legendY2C); myLegend->SetFillStyle(0); myLegend->SetBorderSize(0); myLegend->SetTextSize(0.03); myLegend->AddEntry(myfunc,"Unpenalized event count","L"); myLegend->AddEntry(myfunc2,"Penalized event count","L"); myLegend->Draw(); .x myprint.cc("ps/penalty",113);

where

myprint.cc:


#include <TString.h>
void myprint(TString myFile,Int_t psVal=112, Int_t x=26, Int_t y=20)
{  
  // psVal: 111 = Portrait, 112 = Landscape, 113 = eps

  cout << " Calling myprint for " << myFile << endl;
  TString myFullFile; 
  if (psVal == 113){
    myFullFile = myFile+".eps";
  }
  else{
    myFullFile = myFile+".ps";
  }
  TPostScript * myps = new TPostScript(myFullFile,psVal);
  if (psVal != 113) myps->Range(x,y);
  c1->Draw();
  myps->Close();
  delete myps;

}

and

mypenalty.C:

Double_t mypenalty(Double_t *x, Double_t *par)
{
   Double_t xx =x[0];
   Double_t f = 0;
   if (xx <= 5){
     f = 2.0 + ((1 - ((2*2.0)/5)) * xx) + (((2.0/(5.0*5.0))) * xx*xx);
   }
   else{
     f = xx;
   }
   return f;
}

Is there a way to fix this without switching ROOT versions? Thanks.

I see the problem with ps or eps. the pdf format seems to be OK.

Olivier will investigate on Monday.

Rene

This problem is now fixed in the CVS head. Thanks to have reported it. I have search in the TLatex cvs log file when this bug appeared but it seems it has always been there (the code drawing the tilde has not changed since it is available). I guess it was not mentionned earlier because depending on the character you put the tilde on it is more or less visible. So to answer you question: There is no way to fix this without switching ROOT versions

Thanks. I’m wondering if one could in principle edit the eps file somehow and change this.

Yes, you can find the place where the tilde is drawn and increase the y postion by a few points. Email me the PS file if you do not find the way to do it.