Large EPS files when mathscr is used

Dear ROOT developers (and users),

I came across a weird behavior due to the presence of calligraphic symbols in my plots. The plotted quantity, a likelihood, is represented in the paper as $mathscr{L}$. To be consistent with the text, and to avoid using the same symbol for the integrated luminosity (plain L), I was asked to introduce this "fancy" L in the y-axis of the histograms. The plots looked very nice, but once stored as .eps, their size exceeded 20 MB each! Such a size is not accepted by arXiv (<2 MB). You can reproduce the effect easily e.g. with this simple macro:

{ TCanvas c("c", "C", 800, 800 ); TH1F h("txt", "Text", 3, 0, 2 ); h.GetYaxis()->SetTitle( "log\\mathscr{L}" ); h.Draw(); c.SaveAs("fancylhood.eps"); c.SaveAs("fancylhood.png"); }

Apparently, this is due to the fact that the eps includes the set of fonts the symbol belongs to. This is really an annoying behavior, we had to modify the plot with an external program and we don’t want to do that again in the future. Is there any workaround (but the symbol must remain the same!) or any other “legal” manipulation on the eps to avoid the large-size effect?

Thank you in advance,

Yes Using TMathText makes huge PS file. This is known. Use png instead.

One work around is to convert the eps file to pdf or eps using the linux convert command:

$ convert fancylhood.eps fancylhood_small.eps
$ convert fancylhood.eps fancylhood.pdf

ls gives:

-rw-r--r--      1 couet  staff   21092021 Jul  2 14:43 fancylhood.eps
-rw-r--r--      1 couet  staff      22908 Jul  2 14:43 fancylhood.png
-rw-r--r--@     1 couet  staff      41210 Jul  2 14:44 fancylhood.pdf
-rw-r--r--@     1 couet  staff    1904287 Jul  2 14:45 fancylhood_small.eps