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
Hello everybody.
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!
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.

Re: .pdf/.pdf_t resize problem with font size
Have you marked/flagged all of the text so it isn't included in the .pdf? \resizebox should then take care of font size and placement.
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.
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
I have just checked the pdf-file, and there is no text included in it.
In the document itself I used the following code to include it:
The file foo.pdf_t looks like this (which is a simple example, with the text $P_10$ only):
In xfig I have set the fonttype to latex default.
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.)
In the document itself I used the following code to include it:
Code: Select all
Code, edit and compile here:
\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
Code, edit and compile here:
\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
I include my figures the same way and your pdf_t file has the same things as mine. I assume as you create two files that you have given the text the special flag?
What actually happens to the text when you use the \resizebox?
Do you compile with pdftex or latex?
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 compiled it with pdfLatex. Assuming that I enlarge the figure, the text will be enlarged too.
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.
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
Don't scale these figures with \resizebox, but create them with the desired size in the first place instead.
-
- Posts: 11
- Joined: Thu Sep 03, 2009 11:02 am
Re: .pdf/.pdf_t resize problem with font size
I have considered this as well. But often one doesn't know what size they will have when creating the figures. And to be honest: I thought that this is an advantage of using .pdf/pdf_t figures.
Re: .pdf/.pdf_t resize problem with font size
The advantage is that you get no quality loss and smaller files when using vector graphics, but still they are treated like a unit by \resizebox and the fonts cannot be scaled independently, no matter what the actual graphics format is. You'd get similar results when applying \resizebox to simple LaTeX text.
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.
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.
Re: .pdf/.pdf_t resize problem with font size
I've collected all objects together in xfig using COMPOUND object, then resized to less than 8cm width for 2 column papers and it worked perfectly for some images but doesn't work for others. I'm using evince to view the PDFs under Linux. It turns out that it seemed to cache some of the locations somehow and the images were not generated correctly. After some time the caching disappeared and the images are now the correct sizes. Now I get perfectly sized images. It also affects the appearance of the first page when using IEEEtrans document class. When you have all images corrected the first page viewing problem goes away.