I am using beamer to creating my presentation, I am using many Matlab generated figures and up until now, I was using \psfrag with 'auto-pst-pdf' for my articles. However, when I try to use the same technique with beamer, for some reasons it is not working returning the error as follows :

This is pdfTeX, Version 3.14159265-2.6-1.40.17 (MiKTeX 2.9 64-bit)         
(preloaded format=pdflatex 2016.7.6)  10 NOV 2016 16:07
entering extended mode
! Undefined control sequence.
<recently read> \psfrag
l.15 \end{frame}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
Overfull \hbox (117.2166pt too wide) in paragraph at lines 15--15
[]\OT1/lmss/m/n/10.95 SC[c][]Sensor
Overfull \vbox (67.0767pt too high) detected at line 15
Non-PDF special ignored!
Non-PDF special ignored!
Non-PDF special ignored!{C:/Users/rganapat/AppData/Local/MiKTeX/2.9/pdftex/conf
ig/pdftex.map} <./test-pics.pdf>]
\openout6 = `test.nav'.
\openout7 = `test.toc'.
\openout8 = `test.snm'.
Package atveryend Info: Empty hook `BeforeClearDocument' on input line 16.
Package atveryend Info: Empty hook `AfterLastShipout' on input line 16.
Package atveryend Info: Executing hook `AtVeryEndDocument' on input line 16.
Package atveryend Info: Executing hook `AtEndAfterFileList' on input line 16.
Package rerunfilecheck Info: File `test.out' has not changed.
(rerunfilecheck) Checksum: D41D8CD98F00B204E9800998ECF8427E;0.
Package atveryend Info: Empty hook `AtVeryVeryEnd' on input line 16.
Here is how much of TeX's memory you used:
18442 strings out of 493335
352078 string characters out of 3128932
435874 words of memory out of 3000000
21529 multiletter control sequences out of 15000+200000
15137 words of font info for 20 fonts, out of 3000000 for 9000
1141 hyphenation exceptions out of 8191
56i,11n,55p,414b,378s stack positions out of 5000i,500n,10000p,200000b,50000s
{C:/Users/rganapat/AppData/Local/Programs/MiKTeX 2.9/fonts/enc/dvips/lm/lm-rm
.enc}<C:/Users/rganapat/AppData/Local/Programs/MiKTeX 2.9/fonts/type1/public/lm
/lmss10.pfb><C:/Users/rganapat/AppData/Local/Programs/MiKTeX 2.9/fonts/type1/pu
Output written on test.pdf (1 page, 33183 bytes).
PDF statistics:
35 PDF objects out of 1000 (max. 8388607)
3 named destinations out of 1000 (max. 500000)
41 words of extra memory for PDF output out of 10000 (max. 10000000)

Can somebody help me with this issue? Moreover, I am running my pdflatex with shell escape. In addition, I have also given a MWE for your use.

\setbeamertemplate{navigation symbols}{} 
   \psfrag{SC}[c][]{Sensor carrier}

Thanks in advance.

  • 1
    does it work with \usepackage{psfrag} ? You don't need \usepackage{graphicx} Nov 10, 2016 at 14:56
  • @samcarter No it doesn't work. Nov 10, 2016 at 14:58
  • 2
    please put the exact error from the log into your question (in a {} code section so line breaks are preserved) the full error will for example show which command is undefined Nov 10, 2016 at 15:03
  • Can you also include the beginning of the log? Nov 10, 2016 at 15:07
  • @ David Carlisle I have added the full error message Nov 10, 2016 at 15:08

1 Answer 1


As the error shows \psfrag has not been defined. You can use pstool to automate this to a certain extent eg this runs without error

\setbeamertemplate{navigation symbols}{} 
   \psfrag{A}[c][]{Sensor carrier}

although simpler really than trying to use shell-escape tricks to use psfrag with pdflatex I would use a small self contained document with article class and latex to make a new pdf with the psfrag replacements, and then just include the new pdf into the beamer presentation with \includegraphics.

  • could you say what shell-escape tricks, because I am already using shell escape for this. Nov 10, 2016 at 15:21
  • 1
    @RaajaG: David is saying that you should not try to automate this. Create an external image. This is much less trouble. Nov 10, 2016 at 15:22
  • 1
    No I just mean using shell escape at all, that is just making pdflatex copy out a segment of the document run latex to do psfrag and then include the result. it is often simpler (and quicker after the first time) just to do that yourself once, without needing shell-escape at all, Nov 10, 2016 at 15:23
  • @DavidCarlisle Initially I didn't understood what you meant, however now it worked like a charm!!. Thanks. Nov 10, 2016 at 15:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .