I use Tex and Latex on Debian (Windows Linux Subsystem). I first intalled the tex_base Debian package, and also latex_base package, with apt-get. I think Debian uses Tex 2018. Then I install additional packages with TLmgr, Tex own package manager. I had to change year to 2018 in Tlmgr. I do it this way to have a minimal Tex/Latex install so not to take up too much disk space. Up until now I have managed to install new packages from ctan every time my document asks for more. However, now I get the error

! Undefined control sequence. \LaTeX3 error: Use \cs_prefix_spec:N not \token_get_prefix_spec:... l.9 \begin{document} ?

Is it at all possible to fix this? What file do I need to edit? Some times Tlmgr can not find the package. So I find it manually on ctan or tug and copy it manually to my user latex directory. I think some of these standalone packages are from 2020 or 2021. This could be the root of this error. Maybe they are noe compatible? I have read this one but did not find my solution. And also this one.

  • mixing packages from different years is difficult -- new packages often use also new commands from other packages. Better use either texlive 2018 or texlive 2021. Commented Mar 24, 2021 at 21:23

1 Answer 1


You have upgraded latex but not your packages. Commands that were deprecated have been removed by the package maintainers, but you have not kept up with the updates. You can either downgrade your LaTeX to an older version, or upgrade the package(s) with the offending commands.

I had a similar problem come up for me just tonight because I had manually-installed the siunitx package in 2017 from CTAN, and forgotten about it. After a system upgrade, the old package no longer worked, so I had to remove it and install the proper package for my os (on arch linux: pacman -S texlive-science).

As you can see from the changelog you linked in your question, the \token_get_prefix_spec command was deprecated in March 2019. I assume the bug occurred when it did because two years is a reasonable period to enforce a deprecation.

If you are not going to start using a package manager, you could grep -r in your latex source directory for the offending command, and then upgrade the packages that you find. But that may turn out to be a burdensome manual procedure, as the upgrade may introduce new dependencies or break other dependencies.

You must log in to answer this question.

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