I'm writing a math book and I get this error message when I compile with XeLaTeX.

Package: pstricks 2013/12/12 v0.60 LaTeX wrapper for `PSTricks' (RN,HV)
! Undefined control sequence.
l.64 \ifnum\pdfshellescape
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.
! Missing number, treated as zero.
<to be read again>
l.64 \ifnum\pdfshellescape=
A number should have been here; I inserted `0'.
(If you can't figure out why I needed to see a number,
look up `weird error' in the index to The TeXbook.)

I need to compile with XeLaTeX because of I have to use some ttf fonts and I have read that it is simpler (to use ttf fonts in LaTeX) with XeLaTeX. But, first, I need to solve this problem with Pstricks and XeLaTeX.

What's wrong with Pstricks and XeLaTeX?

This is my preamble

\usepackage{verbatim} %Para comentar bloques de texto
\usepackage[text={168mm,240mm},centering]{geometry}%Define el ancho y la altura del texto (Página)

NOTES: 1. I'm using TeXmaker in Opensuse Leap 42.2 2. I've installed xetex-pstricks package and almost all pstricks packages.

Now I'm going to share to you the code of the main file, a chapter example and two pdf outputs: one after compiling without the pstrick image and the other one after compiling with the image.

\usepackage{verbatim} %Para comentar bloques de texto
\usepackage[text={168mm,240mm},centering]{geometry}%Define el ancho y la     altura del texto (Página)
\usepackage{tocloft}% Este paquete modifica los parámetros de la Tabla de     Contenidos (ToC)


BoldFont      =georgiab.TTF,
ItalicFont    =georgiai.TTF]

BoldFont      =calibrib.TTF,
ItalicFont    =calibrii.TTF]

\renewcommand{\cftchappresnum}{Capítulo }%Aparece "Capítulo" antes del  número correspondiente
\renewcommand{\cftchapaftersnum}{}%Lo que aparece después de "Capítulo n"
\renewcommand{\cftchapaftersnumb}{\\ }%Cambio de línea para que el Chapter    name quede en otra línea

\renewcommand{\chaptermark}[1]{\markboth{Álgebra lineal con el uso de MATLAB}{\chaptername\ \thechapter.\ #1}}

\titleformat{\chapter}[display]{\huge\myfont}{\chaptertitlename\ \thechapter}{20pt}{\Huge}

\newtheoremstyle{theorem}% name
{3pt}%      Space above
{3pt}%      Space below
{\itshape}%         Body font
{}%         Indent amount (empty = no indent, \parindent = para indent)
{\bfseries}% Thm head font
{}%        Punctuation after thm head
{.5em}%     Space after thm head: " " = normal interword space;
    %       \newline = linebreak
{}%         Thm head spec (can be left empty, meaning `normal')


% si no queremos que añada la palabra "Capitulo"

\include{Ensayos} % si queremos que aparezca en el índice




The first chapter code is


The second chapter code is (whitout the pstricks image)

\chapter{Álgebra de matrices}\label{Ensayos}
\section{Para ensayar}

This code produces this output enter image description here

And here it goes with the pstricks image

\newrgbcolor{xdxdff}{0.49 0.49 1}
\rput[tl](-0.94,-2.44){\index{Solución única}Solución única}
\rput[tl](6.6,-2.44){\index{Solución vacía}Solución vacía}
\rput[tl](13,-2.42){\index{Infinitas soluciones}Infinitas soluciones}
\rput[tl](3,-3.02){Figura 1.1: Intersección de rectas en un plano}

Which produces this output enter image description here

Thanks for your help.

  • 2
    Welcome to TeX.SX! A small example of code producing the issue is needed; we call it a minimal working example (MWE) (even if it doesn't work).
    – egreg
    Jul 11, 2017 at 16:46
  • 2
    Your pstricks is really old. You should consider to update. Beside this: don't use the [pdf] option with xelatex. Jul 11, 2017 at 16:46
  • 1
    The TL packages of OpenSuSE have a time lag of about year, but 42.2 should at least use TL 2016. I don't understand why there's a pstricks version from 2013
    – user31729
    Jul 11, 2017 at 16:47
  • 2
    Questions seeking debugging help ("why isn't this code working?") must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it in the question itself. Questions without a clear problem statement are not useful to other readers. See minimal working example (MWE). Jul 12, 2017 at 0:10
  • Update the file pstricks.sty
    – user2478
    Jul 12, 2017 at 10:32

1 Answer 1


I could solve my problem in an easy way: I just compiled with PDFTeX in order to get the pictures made by pstricks. Then, I edited every single image with Inkscape and, finally, I included them into my book with the figure environment. Thanks for your help.

You must log in to answer this question.

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