24

After updating MikTex up to 09.04.2018 (MikTex 2.9.6637, Win 10, 64bit) I've got the error:

(F:\...\texmfs\install\tex\latex\chngcntr\chngcntr.sty
! LaTeX Error: Command \counterwithout already defined.
               Or name \end... illegal, see p.192 of the manual.
See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                                                                               
l.42 ...thout}{\@ifstar{\c@t@soutstar}{\c@t@sout}}                                                  
?

It seems to me this problem is connected with multiple definitions of star versions od \counterwithout / \counterwithin in latexrelease.sty and chngcntr.sty.

\documentclass{article}

\usepackage{chngcntr}

\begin{document}

\end{document}

Is anybody know how to solve this?

David Carlisle
  • 757,742
Alexey
  • 415
  • @DavidCarlisle: Something that has changed recently and it made it's way into MikTeX already? –  Apr 09 '18 at 12:57
  • @ChristianHupfer yes there have been three latex releases in last three days, but also latexrelease is mostly aimed at end users not core developers. – David Carlisle Apr 09 '18 at 12:58
  • @DavidCarlisle: That's not really clear from the documentation, in my point of view. –  Apr 09 '18 at 12:58
  • @ChristianHupfer well it is only for running old documents on new formats (or the other way round) so it is just for fixing local issues with locally available documents. – David Carlisle Apr 09 '18 at 12:59
  • @DavidCarlisle: I wonder how many documents are broken then until chngcntr is updated unless your work-around isn't applied. –  Apr 09 '18 at 13:02
  • @samcarter Sorry for a stupid question but what's mean "MWE"? – Alexey Apr 09 '18 at 13:03
  • @samcarter Thank you, we already have found a solution. – Alexey Apr 09 '18 at 13:19
  • @ChristianHupfer update gone to ctan this morning – David Carlisle Apr 10 '18 at 09:03
  • @DavidCarlisle If counterwithin and counterwithout are now defined in latex, does that mean chngcntr is not neccessary anymore? (I am not sure if I understand everything of this discussion here correctly.) – Lysanne Apr 17 '18 at 21:44
  • @Lysanne if you have the very latest latex it is not necessary but you may want to leave the package in for a while as it does not harm and makes things work in "old " latex (which includes current texlive releases, as the new latex release is just in the texlive 2018 pretest which is not for general use) – David Carlisle Apr 17 '18 at 21:47
  • @DavidCarlisle Since I just migrated to TeXlive two days ago this is good to know. Thank you! – Lysanne Apr 20 '18 at 21:39

1 Answers1

30

A new version 1.1a of chngcntr is now available on ctan which detects that the commands are already defined and so does nothing other than leave a message in the log, so the error in the question is no longer generated.


Original answer

For now, you can do

\documentclass{article}
\let\counterwithout\relax
\let\counterwithin\relax
\usepackage{chngcntr}

\begin{document}

\end{document}

chngcntr needs a small update (which was planned but the current maintainer is possibly distracted at present)

David Carlisle
  • 757,742
  • Thank you for the quick reply but, unfortunately, in my document chngcntr.sly are loading implicitly as a part of some package (which I don't know). – Alexey Apr 09 '18 at 13:07
  • @Alexey put the two \let lines as the first two lines of your document, that should work also – David Carlisle Apr 09 '18 at 13:10
  • The оnly solution I've found is to replace \newcommand\counterwithout by \renewcommand\counterwithout within chngcntr.sty – Alexey Apr 09 '18 at 13:12
  • @Alexey you should not change inside packages. And a better solution would have been \providecommand instead of \renewcommand, then the version coming from LaTeX wins. – daleif Apr 09 '18 at 13:20
  • @daleif Of course, I shouldn't but it's the quickest solution than I can find. – Alexey Apr 09 '18 at 13:29
  • @Alexey are you using miktex "next" or a standard miktex? – David Carlisle Apr 09 '18 at 13:42
  • @DavidCarlisle What is the small update required for the chngcntr package? As the originator of the package I might do something but better the current distracted maintainer. – Peter Wilson Apr 09 '18 at 19:43
  • @PeterWilson Hi, one possible suggestion is here Will was planning an update before the release but... Basically we adopted the package into the format so chngcntr (and my even older remreset) are obsolete in the new format, if you are happy with the suggestion on that githib and send me an email to authorise a ctan update I could push it to ctan, or if you would rather do it I'm happy to delete that again:-) – David Carlisle Apr 09 '18 at 19:47
  • @PeterWilson I got a quick message from Will so I'll update ctan later, hope that's OK – David Carlisle Apr 10 '18 at 08:49
  • @DavidCarlisle I trust you and Will better than I trust myself now. Thanks to both of you. – Peter Wilson Apr 11 '18 at 18:45
  • 1
    Maybe that helps someone who had problems getting the updated version to work: For me, the error remained even after installing the updated version of chngcntr and also after deleting all document generated files and recompiling and after explicitly calling the package version. The error pointed to the chngcntr.sty in the AppData/Local/Roaming tree. So I had to delete the old file there to make LaTeX use the new updated version. – Lysanne Apr 17 '18 at 21:35
  • @DavidCarlisle I just installed TL2018 (Win-64) and stumbled upon this question and your answer. I see, that ctan lists chngcntr 1.1a, but tlmgr update --all does not fetch it (chngcntr.sty says: 1.0a). Do you have an idea why? And how I could get the updated version (using tlmgr)? Thx! – lAtExFaN May 02 '18 at 07:53
  • @lAtExFaN oh thanks for the ping. I see same here I guess texlive team busy moving things over to tl2018 and it got missed, I'll ask on texlive list – David Carlisle May 02 '18 at 07:58
  • @lAtExFaN the new package is distributed by tlmgr today (or possibly tomorrow if your mirror is slow to catch up) – David Carlisle May 03 '18 at 06:59
  • @DavidCarlisle yes I've already updated and tested it successfully - thanks for your report! – lAtExFaN May 03 '18 at 07:17