I have a very basic problem. I am trying to use the xstring package in a Latex document and I keep getting the following error message for an undefined control sequence:

(c:/Program Files (x86)/PCTeX/PCTeXv6/texmf-dist/tex/generic/xstring/xstring.sty

(c:/Program Files (x86)/PCTeX/PCTeXv6/texmf-dist/tex/generic/xstring/xstring.tex

****! Undefined control sequence.**

**\@xs@buildlines ...\expandafter {\number \numexpr 
                                                  #1+1-1}\edef \@xs@reserved...**

**l.427 \@xs@newmacro\StrRemoveBraces{}{1}{1}

Typesetter process aborted

I downloaded and installed this package from CTAN; it is the 2013-07-29 version.


1 Answer 1


Package xstring requires the e-TeX extensions. Otherwise you get the error, that \numexpr from e-TeX is undefined as seen in the question.

It seems that PCTeX has some support for e-TeX, but it must be enabled. This is done during format generation, if the first characters is a star *.

"How do I fix a Package etex error?" from PCTeX's home page describes the procedure to enable extended mode.

  • +1 I just realised that I was thrown by the formatting (\numexpr wasn't at the end of the line, until we both edited the q at the same time:-) Sep 23, 2013 at 2:01

You must log in to answer this question.

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