I want to embed a root graphic in a Latex file and got the following problem:
The Size of the titles in the Statistic Boxes adjust to the given size in the PDF and the normal root output but it will not adjust in the .tex file. In the Latex dokument, the size of the titles are the original size.
Yes i see that the template.tex file produces a distorted output for both 2D_35_fast.tex and 2D_35_fast.pdf . Note that 2D_35_fast.pdf is correct when visualized alone. I made a template2.tex file based on the example given in the documentation (see the code at the end of this post). And then the output produced from this file is correct. So something else in the file template.tex file should distord the image.
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{patterns}
\usetikzlibrary{plotmarks}
\title{A simple LaTeX example}
\date{March 2018}
\begin{document}
\maketitle
The following image as been generated using the TTeXDump class:
\par
\resizebox{0.98 \width}{18cm}{\input{2D_35_fast.tex}}
\end{document}
This is very unfortunate, because I cannot produce a poster with the article class. But I found the problem:
As soon as you do not add any extra lines in the status box, then the titles are visualized in the correct size.
Here you can see the difference:
No … but I can check. That’s really bizarre because both the tex and the pdf show this effect when included in a tex file. The pdf seems ok when visualised alone …
It seems your compiler does not also care of undeclared variables (which is weird …):
In file included from input_line_11:1:
/Users/couet/Downloads/original_fast.c:260:1: error: use of undeclared identifier 'lol'
lol = s2->GetListOfLines();
^
/Users/couet/Downloads/original_fast.c:261:1: error: use of undeclared identifier 'ltx'
ltx = new TLatex(0, 0, TString::Format("f(x_0) = %g", ref_value2));
^
/Users/couet/Downloads/original_fast.c:262:1: error: use of undeclared identifier 'ltx'
ltx->SetTextFont(42); ltx->SetTextSize(StatsTextSize); ltx->SetTextColor(1);
^
/Users/couet/Downloads/original_fast.c:262:23: error: use of undeclared identifier 'ltx'
ltx->SetTextFont(42); ltx->SetTextSize(StatsTextSize); ltx->SetTextColor(1);
^
/Users/couet/Downloads/original_fast.c:262:56: error: use of undeclared identifier 'ltx'
ltx->SetTextFont(42); ltx->SetTextSize(StatsTextSize); ltx->SetTextColor(1);
^
/Users/couet/Downloads/original_fast.c:263:1: error: use of undeclared identifier 'lol'
lol->Add(ltx);
^
/Users/couet/Downloads/original_fast.c:263:10: error: use of undeclared identifier 'ltx'
lol->Add(ltx);
^
/Users/couet/Downloads/original_fast.c:264:1: error: use of undeclared identifier 'ltx'
ltx = new TLatex(0, 0, TString::Format("1%% = %g", value));
^
/Users/couet/Downloads/original_fast.c:265:1: error: use of undeclared identifier 'ltx'
ltx->SetTextFont(42); ltx->SetTextSize(StatsTextSize); ltx->SetTextColor(1);
^
/Users/couet/Downloads/original_fast.c:265:23: error: use of undeclared identifier 'ltx'
ltx->SetTextFont(42); ltx->SetTextSize(StatsTextSize); ltx->SetTextColor(1);
^
/Users/couet/Downloads/original_fast.c:265:56: error: use of undeclared identifier 'ltx'
ltx->SetTextFont(42); ltx->SetTextSize(StatsTextSize); ltx->SetTextColor(1);
^
/Users/couet/Downloads/original_fast.c:266:1: error: use of undeclared identifier 'lol'
lol->Add(ltx);
^
/Users/couet/Downloads/original_fast.c:266:10: error: use of undeclared identifier 'ltx'
lol->Add(ltx);
^
/Users/couet/Downloads/original_fast.c:267:1: error: use of undeclared identifier 'ltx'
ltx = new TLatex(0, 0, TString::Format("2%% = %g", value));
^
/Users/couet/Downloads/original_fast.c:268:1: error: use of undeclared identifier 'ltx'
ltx->SetTextFont(42); ltx->SetTextSize(StatsTextSize); ltx->SetTextColor(1);
^
/Users/couet/Downloads/original_fast.c:268:23: error: use of undeclared identifier 'ltx'
ltx->SetTextFont(42); ltx->SetTextSize(StatsTextSize); ltx->SetTextColor(1);
^
/Users/couet/Downloads/original_fast.c:268:56: error: use of undeclared identifier 'ltx'
ltx->SetTextFont(42); ltx->SetTextSize(StatsTextSize); ltx->SetTextColor(1);
^
/Users/couet/Downloads/original_fast.c:269:1: error: use of undeclared identifier 'lol'
lol->Add(ltx);
^
/Users/couet/Downloads/original_fast.c:269:10: error: use of undeclared identifier 'ltx'
lol->Add(ltx);
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
This does not surprise me, since if you include the PDF, the style of the object is not changed. Sadly this is not an option, because I would like that the Font and the Formulas match (This is the reason why I was using the .tex file).
the image c1.tex has been produced by a simple hpx->Draw() (hpx being the standard histogram from hsimple.root). When I use the a0poster document class I get:
the text size is defined by the value in the scale field. If you make a script to change this values you can adjust them with a size making a0poster happy. For instance I changed 0.954572 to 0.5 and I got readable stats sizes in the a0poster style. This is similar to what @ferhue proposed earlier.