TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Assume that at creation time (of an EPS image) the final 'size' of the image is not known. However, this one EPS is used multiple times in different sizes within different documents. But the font size of text (e.g., axes labels) should be consistent.

Example: In one .tex use


and in another use


but ensure, that the axes labels are shown with 12pt in both figures.

Is there another way/vector graphics format to reach this functionality? (pstricks, tikz is not a solution, since it's not a supported export format.)

share|improve this question

migrated from stackoverflow.com Feb 7 '12 at 17:20

This question came from our site for professional and enthusiast programmers.

Welcome to TeX.sx! Your question was migrated here from Stack Overflow. Please register on this site, too, and make sure that both accounts are associated with each other, otherwise you won't be able to comment on or accept answers or edit your question. – Werner Feb 7 '12 at 17:23

psfrag allows for this by default since it inserts the <replacement> of <tag> at compile-time:


So you have to create the document with appropriate tags that can be replaced within your document. Here is a minimal example, taken from the auto-pst-pdf package on CTAN. The example image is example.eps:

psfrag maintains consistent font size when image is scaled

\usepackage{graphicx}% http://ctan.org/pkg/graphicx
\usepackage{psfrag}% http://ctan.org/pkg/psfrag

% psfrag setup
\psfrag{[hb]}{$\mathbf h$}%

Original image: \par
\includegraphics{example} \par\bigskip\bigskip%

Scaled 50\%: \par
\includegraphics[scale=.5]{example} \par\bigskip\bigskip

Scaled 150\%: \par

It is obvious that the <replacement> text maintains a consistent font size, based on the document default. You may have to adjust the placement of the <replacement> based on the image size.

share|improve this answer

psfrag might be your friend if the text in the eps is not too obscured by whatever wrote the EPS, it should allow you to replace the text in the EPS file by LaTeX-typeset text over the top, which of course can be any size you wish.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.