Graphics, Figures & TablesLaPrint (Undefined Control sequence)

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
kramboa
Posts: 3
Joined: Sat Jan 29, 2011 7:40 pm

LaPrint (Undefined Control sequence)

Post by kramboa »

Hi!
I am trying to add a Matlab figure which have been generated by LaPrint. My code:

Code: Select all

\documentclass{article}
\usepackage{graphicx,color,psfrag}
\begin{document}
\input{convergence}
\end{document}
convergence.tex:

Code: Select all

% This file is generated by the MATLAB m-file laprint.m. It can be included
% into LaTeX documents using the packages graphicx, color and psfrag.
% It is accompanied by a postscript file. A sample LaTeX file is:
%    \documentclass{article}\usepackage{graphicx,color,psfrag}
%    \begin{document}\input{convergence}\end{document}
% See http://www.mathworks.de/matlabcentral/fileexchange/loadFile.do?objectId=4638
% for recent versions of laprint.m.
%
% created by:           LaPrint version 3.16 (13.9.2004)
% created on:           29-Jan-2011 16:56:24
% eps bounding box:     15 cm x 11.25 cm
% comment:              
%
\begin{psfrags}%
\psfragscanon%
%
% text strings:
\psfrag{s05}[b][b]{\color[rgb]{0,0,0}\setlength{\tabcolsep}{0pt}\begin{tabular}{c}Settlement over time\end{tabular}}%
\psfrag{s06}[t][t]{\color[rgb]{0,0,0}\setlength{\tabcolsep}{0pt}\begin{tabular}{c}Time [h]\end{tabular}}%
\psfrag{s07}[b][b]{\color[rgb]{0,0,0}\setlength{\tabcolsep}{0pt}\begin{tabular}{c}Displacement [mm]\end{tabular}}%
\psfrag{s10}[][]{\color[rgb]{0,0,0}\setlength{\tabcolsep}{0pt}\begin{tabular}{c} \end{tabular}}%
\psfrag{s11}[][]{\color[rgb]{0,0,0}\setlength{\tabcolsep}{0pt}\begin{tabular}{c} \end{tabular}}%
\psfrag{s12}[l][l]{\color[rgb]{0,0,0}End of draining period}%
\psfrag{s13}[l][l]{\color[rgb]{0,0,0}While and after draining}%
\psfrag{s14}[l][l]{\color[rgb]{0,0,0}Long time after draining}%
\psfrag{s15}[l][l]{\color[rgb]{0,0,0}End of draining period}%
%
% xticklabels:
\psfrag{x01}[t][t]{0}%
\psfrag{x02}[t][t]{20}%
\psfrag{x03}[t][t]{40}%
\psfrag{x04}[t][t]{60}%
\psfrag{x05}[t][t]{80}%
\psfrag{x06}[t][t]{100}%
\psfrag{x07}[t][t]{120}%
\psfrag{x08}[t][t]{140}%
%
% yticklabels:
\psfrag{v01}[r][r]{15.5}%
\psfrag{v02}[r][r]{15.55}%
\psfrag{v03}[r][r]{15.6}%
\psfrag{v04}[r][r]{15.65}%
\psfrag{v05}[r][r]{15.7}%
\psfrag{v06}[r][r]{15.75}%
\psfrag{v07}[r][r]{15.8}%
\psfrag{v08}[r][r]{15.85}%
\psfrag{v09}[r][r]{15.9}%
\psfrag{v10}[r][r]{15.95}%
%
% Figure:
\resizebox{12cm}{!}{\includegraphics{convergence.eps}}%
\end{psfrags}%
%
% End convergence.tex
Both TeX Live and Miktex gives the same error (using XeLaTeX):

Code: Select all

This is XeTeX, Version 3.1415926-2.2-0.9997.4 (Web2C 2010)
 restricted \write18 enabled.
entering extended mode
(./test.tex
LaTeX2e <2009/09/24>
Babel <v3.8l> and hyphenation patterns for english, dumylang, nohyphenation, ge
rman-x-2009-06-19, ngerman-x-2009-06-19, afrikaans, ancientgreek, ibycus, arabi
c, armenian, basque, bulgarian, catalan, pinyin, coptic, croatian, czech, danis
h, dutch, ukenglish, usenglishmax, esperanto, estonian, ethiopic, farsi, finnis
h, french, galician, german, ngerman, swissgerman, monogreek, greek, hungarian,
 icelandic, assamese, bengali, gujarati, hindi, kannada, malayalam, marathi, or
iya, panjabi, tamil, telugu, indonesian, interlingua, irish, italian, kurmanji,
 lao, latin, latvian, lithuanian, mongolian, mongolianlmc, bokmal, nynorsk, pol
ish, portuguese, romanian, russian, sanskrit, serbian, slovak, slovenian, spani
sh, swedish, turkish, turkmen, ukrainian, uppersorbian, welsh, loaded.
(c:/texlive/2010/texmf-dist/tex/latex/base/article.cls
Document Class: article 2007/10/19 v1.4h Standard LaTeX document class
(c:/texlive/2010/texmf-dist/tex/latex/base/size10.clo))
(c:/texlive/2010/texmf-dist/tex/latex/graphics/graphicx.sty
(c:/texlive/2010/texmf-dist/tex/latex/graphics/keyval.sty)
(c:/texlive/2010/texmf-dist/tex/latex/graphics/graphics.sty
(c:/texlive/2010/texmf-dist/tex/latex/graphics/trig.sty)
(c:/texlive/2010/texmf-dist/tex/latex/latexconfig/graphics.cfg)
(c:/texlive/2010/texmf-dist/tex/xelatex/xetex-def/xetex.def)))
(c:/texlive/2010/texmf-dist/tex/latex/graphics/color.sty
(c:/texlive/2010/texmf-dist/tex/latex/latexconfig/color.cfg))
(c:/texlive/2010/texmf-dist/tex/latex/psfrag/psfrag.sty) (./test.aux)
(./convergence.tex <psfrag:convergence.eps> (./test.pfg)
! Undefined control sequence.
\pfg@hidestart ...unt@ by\@ne \repeat \Gin@PS@raw 
                                                  {/PSfrag where{pop\pfg@ \t...
l.51 ...2cm}{!}{\includegraphics{convergence.eps}}
                                                  %
? 
Do I need to mention I'm new to this area?
Last edited by kramboa on Sun Jan 30, 2011 4:48 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

LaPrint (Undefined Control sequence)

Post by frabjous »

The psfrag package seems to work with regular LaTeX but not XeLaTeX -- further discussion of that here and here. Is there some reason you need to use XeLaTeX rather than regular LaTeX? Nothing in the sample code seems to make use of anything XeLaTeX-specific.
kramboa
Posts: 3
Joined: Sat Jan 29, 2011 7:40 pm

LaPrint (Undefined Control sequence)

Post by kramboa »

Oh, no LaTeX would be enough. But just LaTeX is nowhere to be found, I can only choose between XeLaTeX, pdfLaTeX and some more.
I tested with pdfLaTeX in TeX Live now, and it works! (almost) Doesn't work in MikTeX and I thought eps-figures couldn't be used with pdfLaTeX(?)

What left is correct labels, from the code:

Code: Select all

% xticklabels:
\psfrag{x01}[t][t]{1}%
It should display 1, but shows x01. The generated code is correct according to the LaPrint User Guide.
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

LaPrint (Undefined Control sequence)

Post by frabjous »

The newest versions of pdflatex (those from TeXlive 2010 and MikTeX 2.9), indirectly support .eps figures by converting them to pdf in the background. But it doesn't necessary support ps packages like pstricks and psfrag.

I don't really understand how it could be that regular latex cannot be found. Have you tried running latex <filename> from the command prompt?

I'm going to go out on a limb and assume that the problem is that you're using TeXworks as an editor, and TeXworks does not typically include a regular LaTeX option in its typesetting menu. Most likely you'll want to add one. Since LaTeX outputs DVI, not PDF, you'll want to set it up to convert the DVI to PS with dvips and the PS to PDF with ps2pdf. There are instructions here. (Or you could a different editor, like Texmaker or TeXnicCenter.)
kramboa
Posts: 3
Joined: Sat Jan 29, 2011 7:40 pm

Re: LaPrint (Undefined Control sequence)

Post by kramboa »

I'm a windows user and not very familiar with the command prompt.. ;)

You are totally correct! TeXnicCenter did the job using clean LaTeX.

I am very grateful, now I will be able to finish the report in time!
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

LaPrint (Undefined Control sequence)

Post by localghost »

kramboa wrote:[…] TeXnicCenter did the job using clean LaTeX. […]
Then please mark the topic accordingly as written in Section 3 of the Board Rules (to be read before posting).


Best regards and welcome to the board
Thorsten
Post Reply