[quote=“couet”]
I need to understand what this inkscape does, I had no time to try. I am not sure I fully understand what you are requesting from ROOT.
I am surprised you have alignment issue with PDF because this is treated before the PDF generation and in the PDF file itself all the text is bottom left …
Ok I will try to see how this inkscape works …[/quote]
Let me first of all emphasize that this is a suggestion, not a request. This is lowest priority IMO. It is merely an idea.
Here are some examples to work with:
makeplot.C:
void makeplot(){
TCanvas *tc = new TCanvas("c","c",400,300);
TH1 *h = new TH1D("h","My Histogram of beta;beta;#beta^{2}",100,0,1);
h->FillRandom("gaus",1000);
h->Draw();
tc->SaveAs("nice_root.pdf");
TH1 *h2 = new TH1D("h2","My Histogram of #beta_{MS}^{2};#beta^{2};forgot braces #beta^2",100,0,1);
h2->FillRandom("gaus",1000);
h2->Draw();
tc->SaveAs("nasty_root.pdf");
}
document.tex:
\documentclass{minimal}
\usepackage[pdftex]{graphicx}
%\usepackage[utf8]{inputenc}
\begin{document}
\centering
\def\svgwidth{0.5\textwidth}
\input{\infile}
\centering
\def\svgwidth{0.2\textwidth}
\input{\infile}
\end{document}
runall.sh:
mkdir tmp; cd tmp
root -q -b ../makeplot.C
inkscape -D -z --file=nice_root.pdf --export-pdf=nice_inkscape.pdf --export-latex
inkscape -D -z --file=nasty_root.pdf --export-pdf=nasty_inkscape.pdf --export-latex
pdflatex -jobname nice_final "\def\infile{nice_inkscape.pdf_tex}\input{../document.tex}"
pdflatex -jobname nasty_final -halt-on-error "\def\infile{nasty_inkscape.pdf_tex}\input{../document.tex}"
Put all three files in one directory and execute runall.sh. The final line will fail.
for me the result nice_final.pdf looks terrible with inkscape flipping the coordinates and cutting parts of the figure off. I have included the result here for reference. Of course nasty_final.pdf doesn’t even compile because of the unescaped special characters.
Notice the absence of the beta character from nice_final.pdf. Trying the inputenc line I get this error:
! Package inputenc Error: Unicode char \u8:β not set up for use with LaTeX.
See the inputenc package documentation for explanation.
Type H <return> for immediate help.
...
l.66 ...ebox{-180}{\makebox(0,0)[lb]{\smash{β}}}}
%
? ^D
! Emergency stop.
My thought was mainly that it would be possible to get a better result if going from ROOT directly.
This was my example of the status quo. I may get 'round to making a nice-to-have example in a few days, but I’m really busy right now with writing my thesis so don’t hold your breath 