# Creating figure files in pdf version from eps files with proper fonts using psfrag and psfragfig

Here is my code

\documentclass[12pt]{article}
\usepackage{pstool}
\usepackage{amsmath}

\begin{document}

\psfragfig[height=83mm,keepaspectratio]{identical_distributions2}{%
\psfrag{p}[t][]{Probability of Error ($P_E$)}
\psfrag{s}[t][]{ Number of Sensors ($K$)}}

\end{document}


I am also using identical_distributions2-psfrag file with the content:

\psfrag{p}[t][]{Probability of Error ($P_E$)}

\psfrag{s}[t][]{ Number of Sensors ($K$)}


I would like to convert this eps file to a pdf file with proper labels as described by psfrag

I am also using shell escape as explained here:

http://www.epr.ch/brb/wiki/blog/enable_shell_escape_in_miktex_running_from_winedt

I am not able to get a correct figure file. The x-label is half cut and not displayed properly.

If I use this eps file and use dvi->ps->pds, all is fine. I couldnt understand what was wrong here or missing.. any idea?

• How exactly do you compile? Under which TeX distribution? Oct 25, 2020 at 7:15
• My guess is that you are using MiKTeX and you do not have helvetic package installed. Update MiKTeX, enable package installation "on-the-fly" or with the prompt ("Ask me") in MiKTeX settings and try again. More info: tex.stackexchange.com/questions/537612/…, github.com/MiKTeX/miktex/issues/393, github.com/MiKTeX/miktex-packaging/issues/112 Oct 25, 2020 at 7:24
• Hi, any progress? Nov 20, 2020 at 16:26
• @ivankokan hello. sorry for not being around for a while. I had much to do but now I am back. So your proposal was to install the helvetic package. I just checked miktex packages and searched for helvetic and it found it. After I clicked on it, it asked me whether I wanna uninstall it. So it seems this font is already installed. Dec 20, 2020 at 20:04
• @ivankokan I am sorry the like was valid for a week only. I found another uploading page and uploaded again. The link is updated. Jan 9, 2021 at 20:28

Leave the \psfrag's posn positioning argument empty.

\documentclass[12pt]{article}

\usepackage{pstool}
\usepackage{amsmath}

\begin{document}

\psfragfig[height=83mm,keepaspectratio]{identical_distributions2}{%
\psfrag{p}[][]{Probability of Error ($P_E$)}
\psfrag{s}[][]{Number of Sensors ($K$)}}

\end{document}

• Abra kadabra style! This is a magic!) Jan 15, 2021 at 2:27
• Why did you use t for \psfrag's posn positioning argument, is there any special reason? Jan 18, 2021 at 12:47
• Oh it was just a copy paste from a paper. I didn’t have any intention of using it. Jan 18, 2021 at 12:52