4

Using pdflatex [Version 3.14159265-2.6-1.40.16 (MiKTeX 2.9 64-bit)] to compile the following:

\documentclass{article}
\usepackage[version=4]{mhchem}
\begin{document}
Hello, world!
\end{document}

throws the following error:

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
! LaTeX error: "kernel/command-not-defined"
! 
! Control sequence \str_case:nnn undefined.
! 
! See the LaTeX3 documentation for further information.
! 
! For immediate help type H <return>.
!...............................................

l.58 \cs_generate_variant:Nn \str_case:nnn { Vnn }

Note that I am using mhchem v4.01.

Any help in regards to fixing this issue is appreciated.

Ruben
  • 13,448
  • You need to update your TeX distribution – specifically files of the l3kernel. – Sean Allred Jul 23 '15 at 00:34
  • According to MikTeX' package manager, I am already running the latest version of l3kernel (SVN 5666). – Nessiesson Jul 23 '15 at 00:48
  • That should certainly be recent enough, but nevertheless, that function does exist. How strange. Have you tried just that code in a minimal document? \documentclass{article}\usepackage{expl3}\ExplSyntaxOn\cs_generate_variant:Nn\str_case:nnn{Vnn}\begin{document}hi\end{document}? – Sean Allred Jul 23 '15 at 00:58
  • Running your code returns two separate errors: kernel/command-not-defined; Control sequence \s undefined. and kernel/missing-colon; Function '\s' contains no ':'.. – Nessiesson Jul 23 '15 at 01:09
  • Welcome! Can you add \listfiles before \documentclass and post the output? – cfr Jul 23 '15 at 01:12
  • I have the same error message with fontawesome and fontspec. – Bernard Jul 23 '15 at 01:12
  • @Bernard With a different engine, you mean? – cfr Jul 23 '15 at 01:15
  • @cfr I hope that this is what you're after: http://pastebin.com/aCWuCW8Z – Nessiesson Jul 23 '15 at 01:18
  • Hmm. That was it, yes. MiKTeX appears to have newer versions of the l3 stuff than TeX Live (I just updated to be sure I'd got the current stuff). @Bernard Do you have those 566* versions from this week? TL is still giving me 5630. Did they introduce a bug, do you think? – cfr Jul 23 '15 at 01:42
  • @SeanAllred I don't think so. Downgrading might work, though...? – cfr Jul 23 '15 at 01:46
  • graphics.cfg is the only thing which looks older than TL gives me. The rest is the same or newer, and I bet the newer is the problem here. – cfr Jul 23 '15 at 01:49
  • It seems to be this problem as mentioned perhaps by @Bernard. This comment includes a workaround. – cfr Jul 23 '15 at 01:57
  • It seems that fontspec and mhchem rely on a function which is considered deprecated and has now disappeared.... – cfr Jul 23 '15 at 02:01

1 Answers1

9

Joseph Wright wrote a message to 10 package authors last weekend (and I am sure he does not mind quoting it here).

Hello all,

I've done a recent expl3 update in which I've remove functions deprecated in 2013, following the pattern we've set up. A sweep of TeX Live shows there are a few stray uses of \int_case:nnn, \tl_case:Nnn, \str_case:nnn and \str_case_x:nnn, all of which should now end "F" (e.g. \str_case:nnF). These are easy to miss (I've got one myself to fix in siunitx), but updates of your code to match expl3 would be welcome.

Where I can I've made pull requests on GitHub/BitBucket with fixes. I've also asked that TL don't update the expl3 version until people have a chance to address this.

Regards,

Joseph

So, MikTeX updated too quickly. Less than a week seems not enough for 10 package authors to update their packages.

Update: I updated mhchem. The upload to CTAN was made 2015-07-23. It will take a day to get approved, a day to distribute to the mirrors and a few extra days until you will eventually see it as a MiKTeX update.

This addendum might be useful for others, but is not related to the mhchem package: After correcting the signature (from :nnn to :nnF), the functions were renamed once again to correct the type of expansion they perform. \str_case_x:nn(TF) is now \str_case_e:nn(TF) (the x expansion is slightly different from the e expansion, and the latter is correct for these functions).

mhchem
  • 3,485
  • 12
  • 37
  • After the new update to 4.04, I get this new error @mhchem:
    • LaTeX error: "kernel/command-not-defined"
    • Control sequence \prop_get:Nn undefined.
    – TobiasDK Mar 05 '16 at 09:16
  • 1
    @TobiasDk You should have asked at a more obvious place. This error seems to come from chemgreek 1.0d. MikTeX seems to have not yet updated to 1.0e from February this year. – mhchem Jul 29 '16 at 16:19