Graphics, Figures & Tables ⇒ .pdf/.pdf_t resize problem with font size
-
- Posts: 11
- Joined: Thu Sep 03, 2009 11:02 am
.pdf/.pdf_t resize problem with font size
I have created some combined .pdf/.pdf_t graphics and then included them into my document.
Now it is necessary to resize those figures.
I know that one can do this with \resizebox, which also works fine.
But how can I achive that unless I resize the figure, the font size remains the same, as in the document?
Thanks for your help!
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
Re: .pdf/.pdf_t resize problem with font size
I output pstex/pstex_t from xfig, but assume the method used is the same. The idea of the combined output is that one file contains the lines and drawings and the other is a latex file that includes the 'line and drawing' file then places the text on top.
To check, open the .pdf file of the figure. There should be no text.
-
- Posts: 11
- Joined: Thu Sep 03, 2009 11:02 am
.pdf/.pdf_t resize problem with font size
In the document itself I used the following code to include it:
Code: Select all
\begin{figure}[h]
\resizebox{\textwidth}{!}{\input{foo.pdf_t}
}
\end{figure}
The file foo.pdf_t looks like this (which is a simple example, with the text $P_10$ only):
Code: Select all
\begin{picture}(0,0)%
\includegraphics{foo.pdf}%
\end{picture}%
\setlength{\unitlength}{4144sp}%
%
\begingroup\makeatletter\ifx\SetFigFontNFSS\undefined%
\gdef\SetFigFontNFSS#1#2#3#4#5{%
\reset@font\fontsize{#1}{#2pt}%
\fontfamily{#3}\fontseries{#4}\fontshape{#5}%
\selectfont}%
\fi\endgroup%
\begin{picture}(3413,2812)(2142,-4175)
\put(2521,-1546){\makebox(0,0)[lb]{\smash{{\SetFigFontNFSS{12}{14.4}{\familydefault}{\mddefault}{\updefault}{\color[rgb]{0,0,0}$P_1$}%
}}}}
\end{picture}%
Maybee I have to set the fontsize to default size too, but I couldn't find an option in xfig to do that.
I guess the problem is that I surround the entire foo.pdf_t with the \resizebox.
Any hint to do it better?
(To be honest, I am not a LATEX-Pro.)
Re: .pdf/.pdf_t resize problem with font size
What actually happens to the text when you use the \resizebox?
Do you compile with pdftex or latex?
-
- Posts: 11
- Joined: Thu Sep 03, 2009 11:02 am
.pdf/.pdf_t resize problem with font size
I did set the special flag for the text.
In the image I have displayed the results I get when scaling it to 0.3\textwidth or 0.7\textwidth. Thanks for your help.
Re: .pdf/.pdf_t resize problem with font size
-
- Posts: 11
- Joined: Thu Sep 03, 2009 11:02 am
Re: .pdf/.pdf_t resize problem with font size
Re: .pdf/.pdf_t resize problem with font size
Apart from the text scaling problem, the line widths will probably get scaled, too. So I see no alternative than creating all graphics with the final dimensions. In fact, most graphics packages should allow to specify a custom coordinate system that doesn't depend on the physical dimensions of the image.