I have a series of eps picture to be included in a LaTeX document. They need to be stretched to fit the linewidth, without mantaining their ratio.

This solution works perfectly:


But in this case I get the text scaled too.

I am trying to make the scaling including the picture in TikZ, but I cannot find a way to tell TikZ to make an xscale=\textwidth/(the width of my picture).

Something like this:


\node at (0,0) {\includegraphics{esempio3024nuovo-1.eps}};


Thank you for your suggestions, AM

  • If you mean text that is in the eps figure then tikz will scale it the same way as \resizebox (or you could just use \includegraphics options) If you want that text to behave differently you should look at psfrag – David Carlisle Nov 20 '14 at 8:27
  • I guess psfrag is the tool. I don't understand much from the manual, though. This tagging, I just need to import the file and resize without changing the font. I'll figure out. – user56153 Nov 20 '14 at 11:49
  • actually I don't understand your question at all to be honest, within the eps file (assuming the text really is fonts not just drawn paths) you have some lines and shapes and text, if you scale everything except the text where do you want the non-scaled text to go, all the coordinates of all the points have changed? – David Carlisle Nov 20 '14 at 12:03
  • To the proportionally scaled points. I just have to stretch the image a few millimeters to fill the line, otherwise I will have many images one on top of the other with different lenghts, and the right margin of the page would look bad. But if I alter the size of the font I will have many pictures (justidfied) with text of (very slightly) different sizes one close to the other. – user56153 Nov 20 '14 at 14:29
  • but depending on the image generation software each letter (or part of letter for accented letters) might be separately positioned by coordinate in the EPS, if you stretch them out while not changing their size it is going to look very odd. It may be that your EPS are in a very specific form and you can do this but clearly no tool is going to be applicable in general. why distort the image at all rather than just putting them into a table and aligning with white space as is more normal? – David Carlisle Nov 20 '14 at 14:37

Save the picture into a box and use \wd\IBox:


\node at (0,0) {\usebox\IBox};



\node at (0,0) {\includegraphics{esempio3024nuovo-1.eps}};

if you do not want the saved Image

  • This method will resize the fonts as well, and it is actually the same method I have asked an alternative to in my question. In any case my picture doesn't even get resized. – user56153 Nov 20 '14 at 11:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.