latex3 / xfrac

Split level fractions
LaTeX Project Public License v1.3c
1 stars 0 forks source link

Undefined control sequence. \DeclareCollectionInstance #1

Closed octaeder closed 1 month ago

octaeder commented 1 month ago

I updated my miktex (Win10) packages including xfrac. When compiling (pdflatex, lualatex) with txs I get following messages:

\documentclass[10pt,a5paper]{article}
\usepackage{xfrac}
\begin{document}
abc
\end{document}

338: Undefined control sequence. \DeclareCollectionInstance 338: Missing \begin{document}. \DeclareCollectionInstance { p 342: Illegal unit of measure (pt inserted). sc

josephwright commented 1 month ago

Have you updated both in 'user' and admin modes? This looks like a mismatched file issue - if you an provide a .log that would be useful.

octaeder commented 1 month ago

I started miktex as normal user, now I selected Run as Admin, but miktex says there are no updates available. Should I run Update file name database?

log file This is pdfTeX, Version 3.141592653-2.6-1.40.26 (MiKTeX 24.4) (preloaded format=pdflatex 2024.10.20) 20 OCT 2024 12:28 entering extended mode \write18 enabled. %&-line parsing enabled. **./texstudio_jeZIdU.tex (texstudio_jeZIdU.tex LaTeX2e <2024-06-01> patch level 2 L3 programming layer <2024-09-10> (C:\Users\xxx\AppData\Local\Programs\MiKTeX\tex/latex/base\article.cls Document Class: article 2024/02/08 v1.4n Standard LaTeX document class (C:\Users\xxx\AppData\Local\Programs\MiKTeX\tex/latex/base\size10.clo File: size10.clo 2024/02/08 v1.4n Standard LaTeX file (size option) ) \c@part=\count194 \c@section=\count195 \c@subsection=\count196 \c@subsubsection=\count197 \c@paragraph=\count198 \c@subparagraph=\count199 \c@figure=\count266 \c@table=\count267 \abovecaptionskip=\skip49 \belowcaptionskip=\skip50 \bibindent=\dimen141 ) (C:\Users\xxx\AppData\Local\Programs\MiKTeX\tex/latex/l3packages/xfrac\xfrac .sty (C:\Users\xxx\AppData\Local\Programs\MiKTeX\tex/latex/l3kernel\expl3.sty Package: expl3 2024-09-10 L3 programming layer (loader) (C:\Users\xxx\AppData\Local\Programs\MiKTeX\tex/latex/l3backend\l3backend-pd ftex.def File: l3backend-pdftex.def 2024-05-08 L3 backend support: PDF output (pdfTeX) \l__color_backend_stack_int=\count268 \l__pdf_internal_box=\box52 )) (C:\Users\xxx\AppData\Local\Programs\MiKTeX\tex/latex/amsmath\amstext.sty Package: amstext 2021/08/26 v2.01 AMS text (C:\Users\xxx\AppData\Local\Programs\MiKTeX\tex/latex/amsmath\amsgen.sty File: amsgen.sty 1999/11/30 v2.0 generic functions \@emptytoks=\toks17 \ex@=\dimen142 )) (C:\Users\xxx\AppData\Local\Programs\MiKTeX\tex/latex/graphics\graphicx.sty Package: graphicx 2021/09/16 v1.2d Enhanced LaTeX Graphics (DPC,SPQR) (C:\Users\xxx\AppData\Local\Programs\MiKTeX\tex/latex/graphics\keyval.sty Package: keyval 2022/05/29 v1.15 key=value parser (DPC) \KV@toks@=\toks18 ) (C:\Users\xxx\AppData\Local\Programs\MiKTeX\tex/latex/graphics\graphics.sty Package: graphics 2024/05/23 v1.4g Standard LaTeX Graphics (DPC,SPQR) (C:\Users\xxx\AppData\Local\Programs\MiKTeX\tex/latex/graphics\trig.sty Package: trig 2023/12/02 v1.11 sin cos tan (DPC) ) (C:\Users\xxx\AppData\Local\Programs\MiKTeX\tex/latex/graphics-cfg\graphics. cfg File: graphics.cfg 2016/06/04 v1.11 sample graphics configuration ) Package graphics Info: Driver file: pdftex.def on input line 106. (C:\Users\xxx\AppData\Local\Programs\MiKTeX\tex/latex/graphics-def\pdftex.de f File: pdftex.def 2024/04/13 v1.2c Graphics/color driver for pdftex )) \Gin@req@height=\dimen143 \Gin@req@width=\dimen144 ) (C:\Users\xxx\AppData\Local\Programs\MiKTeX\tex/latex/l3packages/l3keys2e\l3 keys2e.sty Package: l3keys2e 2024-08-16 LaTeX2e option processing using LaTeX3 keys ) (C:\Users\xxx\AppData\Local\Programs\MiKTeX\tex/latex/base\textcomp.sty Package: textcomp 2024/04/24 v2.1b Standard LaTeX package ) (C:\Users\xxx\AppData\Local\Programs\MiKTeX\tex/latex/l3packages/xparse\xpar se.sty Package: xparse 2024-08-16 L3 Experimental document command parser ) (C:\Users\xxx\AppData\Local\Programs\MiKTeX\tex/latex/l3packages/xtemplate\x template.sty Package: xtemplate 2024-08-16 L3 Experimental prototype document functions ) Package: xfrac 2023-10-10 L3 Experimental split-level fractions \l__xfrac_slash_box=\box53 \l__xfrac_tmp_box=\box54 \l__xfrac_denominator_bot_sep_dim=\dimen145 \l__xfrac_numerator_bot_sep_dim=\dimen146 \l__xfrac_numerator_top_sep_dim=\dimen147 \l__xfrac_slash_left_sep_dim=\dimen148 \l__xfrac_slash_right_sep_dim=\dimen149 \l__xfrac_slash_left_muskip=\muskip17 \l__xfrac_slash_right_muskip=\muskip18 LaTeX template Info: Declaring template type 'xfrac' taking 3 argument(s) on (template) line 80. ! Undefined control sequence. l.338 \DeclareCollectionInstance { plainmath } { xfrac } { mathdefault } { m... The control sequence at the end of the top line of your error message was never \def'ed. If you have misspelled it (e.g., `\hobx'), type `I' and the correct spelling (e.g., `I\hbox'). Otherwise just continue, and I'll forget about whatever was undefined.
u-fischer commented 1 month ago

your xfrac version is too old. I have on miktex Package: xfrac 2024-06-04. Check in the package manager. You could for example deinstall it (as user and admin if needed) and reinstall it.

josephwright commented 1 month ago

Here is my log for the example with current MiKTeX.

octaeder commented 1 month ago

this is random, I looked for packages in miktex and found xfrac not being installed. Don't know how I was able to compile my project all the days...

image

I let miktex install the package as admin (be aware of the small change in size), but didn't help.

image

I see in the log:

Package: xtemplate 2024-08-16 L3 Experimental prototype document functions
)
Package: xfrac 2023-10-10 L3 Experimental split-level fractions
josephwright commented 1 month ago

Do you have xfrac.sty in the directory with your source?

octaeder commented 1 month ago

The file exists twice:

C:\Users\xxx\AppData\Local\Programs\MiKTeX\tex\latex\xfrac
\ProvidesExplPackage{xfrac}{2024-06-04}{}

C:\Users\xxx\AppData\Local\Programs\MiKTeX\tex\latex\l3packages\xfrac
\ProvidesExplPackage{xfrac}{2023-10-10}{}

Why this?

josephwright commented 1 month ago

The file exists twice:

C:\Users\xxx\AppData\Local\Programs\MiKTeX\tex\latex\xfrac
\ProvidesExplPackage{xfrac}{2024-06-04}{}

C:\Users\xxx\AppData\Local\Programs\MiKTeX\tex\latex\l3packages\xfrac
\ProvidesExplPackage{xfrac}{2023-10-10}{}

Why this?

You have an older l3packages installed - we moved where xfrac is located. You need to update your l3packages.

u-fischer commented 1 month ago

well it can happen that you install twice. That is why I suggested that you deinstalled first.

octaeder commented 1 month ago

I'm only able to remove the package by using miktex app. In miktex I can see it only once. From the images above I would say it was removed. Everything worked fine until I updated miktex. Maybe I need more details about uninstalling the package.

octaeder commented 1 month ago

Why this?

You have an older l3packages installed - we moved where xfrac is located. You need to update your l3packages.

I expect miktex to always update everything ?

josephwright commented 1 month ago

Remove and reinstall l3packages

josephwright commented 1 month ago

I expect miktex to always update everything ?

In theory yes, in practice not always!

octaeder commented 1 month ago

as admin?

josephwright commented 1 month ago

@octaeder Looks like you've installed it just for your account

octaeder commented 1 month ago

I started miktex as admin and removed, then installed l3packages:

image

But in the compile log I still see '(C:\Users\xxx\AppData\Local\Programs\MiKTeX\tex/latex/l3packages/xfrac\xfrac.sty`

miktex recommends installing for your own.

josephwright commented 1 month ago

But in the compile log I still see '(C:\Users\xxx\AppData\Local\Programs\MiKTeX\tex/latex/l3packages/xfrac\xfrac.sty`

That's definitely installed just for your user

octaeder commented 1 month ago

Again I removed and added package xfrac (thought this could be necessary after updating l3packages), but this didn't help either. Even so I think this is not the way how to proceed, I renamed C:\Users\xxx\AppData\Local\Programs\MiKTeX\tex\latex\l3packages\xfrac\xfrac~.sty. Now it works. But this leaves me behind with the question what the correct update or fixing procedure would be?

octaeder commented 1 month ago

Thanks to all for the quick support.

octaeder commented 1 month ago

removing l3packages doesn't remove the folder xfrac and its files. I think there is something missing in the cleanup process.

octaeder commented 1 month ago

Problems returned somehow. So I reinstalled miktex. That's it.