I am trying to compile this code with "latex" (not pdflatex).

I got the code itself from a collegue, so it should work. Except maybe the way I compile it and the usepackage options?

Right now, I am getting the error:

" ...graphics[width = 0.54\textwidth]{SVM2.eps ! Undefined control sequence."

I shouldn't use graphics in Latex right? Since it is an eps figure. Any ideas?

The eps file is available here.


I forget to include some newcommands, as was remarked below. This is the corrected code. It compiles, but the substitutions appear next to the graph. I thought they were supposed to come inside the graph.

%  \usepackage{graphicx}
\def\bkRrm{{\rm I\kern-.17em R}}
\psfrag{E1}[][]{\ \ \ \footnotesize{${\bf w}^T\varphibold({\bf x})+b=-1$}}
\psfrag{E2}[][]{\ \ \ \ \footnotesize{${\bf w}^T\varphibold({\bf x})+b=0$}}
\psfrag{E3}[][]{\ \ \ \ \footnotesize{${\bf w}^T\varphibold({\bf x})+b=+1$}}
\psfrag{E4}[][]{$\varphibold_1({\bf x})$}
\psfrag{E5}[][]{$\varphibold_2({\bf x})$}
\psfrag{E6}[][]{$2/||{\bf w}||$}
\psfrag{E7}[][]{Class +1}
\psfrag{E8}[][]{Class -1}
  \includegraphics[width = 0.54\textwidth]{SVM2.eps}

enter image description here

  • You can use graphicx in latex or pdflatex however you don't need to explicitly refer to it as it is loaded by psfrag – David Carlisle Jun 28 '13 at 10:59

You don't show the important part of the error message. The undefined command is \varphibold.

From the name I guess you want a definition like


using latex, dvips, ps2pdf`, on the posted code I get the expected result:

enter image description here

| improve this answer | |
  • Oh, you are absolutely right, I forgot to paste my newcommands in the file. I have edited my original question. This time, no compile errors, but the substitutions appear next to the picture. – dorien Jul 1 '13 at 8:49
  • 1
    @dorien works for me, see update. – David Carlisle Jul 1 '13 at 9:26
  • Thanks, apparently the dvips is a necessary step, that fixed it! – dorien Jul 1 '13 at 9:37

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.