TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

To keep in line with the Q&A format:

I am on Ubuntu Lucid, with the frozen TexLive 2011, from where I installed texdef. Unfortunately, when I ran one of the examples from the help (and I installed xspace) specifically for this, I got:

$ texdef -t latex -l -p xspace
Compile error: Undefined control sequence.

What is the problem?


Versions discussed here:

$ texdef --version
texdef: Version 1.6 -- 2012/05/02

$ grep -A3 'ProvidesPackage' `kpsewhich currfile.sty`
    Provides the file path elements of the current input file]
share|improve this question
Please report bugs directly to the package/script author using the provided email address in the package manual. This is not a page for bug reports. (Even if the author, here me, is a regular) – Martin Scharrer Jun 12 '12 at 19:52
And please provide the version of the script (and currfile) you are using. TeX Live 2011 is not an exact description, it's just the distribution. I updated texdef (and currfile) several times during the 2011 live cycle. – Martin Scharrer Jun 12 '12 at 19:58
Hi @MartinScharrer - thanks for the notes; added versions above. Sorry for posting here; but unfortunately when I discover bugs (like this time), I'm usually not in a position to utilize my mail - so I thought I'd better just quickly post something where I can do it quite quickly. (A bug report page for Latex packages that accepts OpenID would really do the trick for me, I guess). Apologies again! – sdaau Jun 17 '12 at 18:21
up vote 2 down vote accepted

This issue is fixed in v1.7b from 2012/05/15 available from CTAN and from the Bitbucket Mercurial Repository including a TDS ZIP file for easy install. There is also a bug tracker where issues can be reported. Please ensure that you have the latest released version before reporting issues.

The same is true for currfile: CTAN, Bitbucket Mercurial Repository.

share|improve this answer
Many thanks for the fix, @MartinScharrer - and apologies again for posting the bug publicly. – sdaau Jun 17 '12 at 18:22

Thankfully, texdef is a Perl script - so I added a print $_ to the texpipe, to observe results - and the texing process was crashing at:

! Undefined control sequence.
l.42         \currfile@realmainfilefalse

! Extra \fi.
l.53 \fi\fi

Since texdef depends on currfile, that must be the source of errors - and indeed, there are some mismatching definitions:

$ grep -i '20..\|ifcurrfile@abspath' `kpsewhich currfile-abspath.sty`
$ grep -i '20..\|ifcurrfile@abspath' `kpsewhich currfile.sty`

$ grep 'ifcurrfile@' `kpsewhich currfile-abspath.sty`

$ grep 'ifcurrfile@' `kpsewhich currfile.sty`
\expandafter\ifx\csname ifcurrfile@realmainfile\endcsname\relax

These two hacks seem to solve the problem:

sed -i 's/ifcurrfile@abspath@windows/ifcurrfile@abspath/' `kpsewhich currfile-abspath.sty`
sed -i 's_\\let\\ifcurrfile@realmainfile_\\newif\\ifcurrfile@realmainfile\n\\let\\ifcurrfile@realmainfile_' `kpsewhich currfile.sty`

And now I can happily run the example command line:

$ texdef -t latex -l -p xspace
Defined by file 'xspace.sty':
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.