2

I updated my packages in MikTeX Console this morning and appear to have somehow broken my LaTeX distribution. Everything worked fine a few days ago, and now it does not. Normally I'd try reinstalling MikTeX, but in a reply to this question, Ulrike Fischer said to spend less time uninstalling and reinstalling and more time trying to solve the problem, so I'm asking for help here.

My problem boils down to: whenever I try and compile a document using LaTeX, either by LaTeX or PDFLaTeX, in either the command prompt or TeXMaker, it fails. I am running a user-mode-only install of MikTeX on Windows 10 Pro (Version 2004). I usually use TeXMaker as my editor (Version 5.0.3), and my MikTeX Console is version 4.0.1. I have tried the following:

  • Compiling in the command line as mentioned above and suggested in many similar questions
  • Deleting the .fndb files in C:\Users\amize\AppData\Local\MiKTeX\2.9\miktex\data\le, as suggested in Error in Updating FNDB after last update
  • Installing all packages that begin with 'miktex', updating packages, and restarting, as suggested in MiKTeX won't typeset

This is the test file I've been using, called 'Test.tex':

\documentclass[12pt]{scrartcl}
\begin{document}
Testing
\end{document}

When compiling it in the command line with LaTeX I get

C:\Users\amize\XXXXX>latex Test.tex
This is pdfTeX, Version 3.14159265-2.6-1.40.21 (MiKTeX 20.11)

Sorry, but latex did not succeed.

The log file hopefully contains the information to get MiKTeX going again:

  C:\Users\amize\AppData\Local\MiKTeX\2.9\miktex\log\latex.log

with PDF LaTeX I get

C:\Users\amize\XXXXX>pdflatex Test.tex
This is pdfTeX, Version 3.14159265-2.6-1.40.21 (MiKTeX 20.11)

Sorry, but pdflatex did not succeed.

The log file hopefully contains the information to get MiKTeX going again:

  C:\Users\amize\AppData\Local\MiKTeX\2.9\miktex\log\pdflatex.log

I get essentially identical errors when trying to compile in TeXMaker, but I also get the following pop-up messages

PDFLaTeX TeXMaker Error

LaTeX TeXMaker Error

The called-out log files are as follows: first latex.log

2020-11-27 19:59:53,825-0600 INFO  latex - this process (6500) started by 'cmd' with command line: latex Test.tex
2020-11-27 19:59:53,840-0600 INFO  latex - allowing known shell commands
2020-11-27 19:59:53,840-0600 INFO  latex - enabling input (output) from (to) processes
2020-11-27 19:59:53,892-0600 INFO  latex - going to create file: latex.fmt
2020-11-27 19:59:53,947-0600 INFO  latex.core - start process: initexmf --enable-installer --dump-by-name=latex --engine=pdftex
2020-11-27 19:59:57,101-0600 ERROR latex - C:\Users\amize\AppData\Local\Programs\MiKTeX 2.9\miktex\bin\x64\initexmf.exe did not succeed; exitCode: 1
2020-11-27 19:59:57,101-0600 ERROR latex - output:
2020-11-27 19:59:57,101-0600 ERROR latex - 
Sorry, but "MiKTeX Configuration Utility" did not succeed.

The log file hopefully contains the information to get MiKTeX going again:

  C:\Users\amize\AppData\Local\MiKTeX\2.9\miktex\log\initexmf.log

2020-11-27 19:59:57,101-0600 FATAL latex.core - The memory dump file could not be found.
2020-11-27 19:59:57,101-0600 FATAL latex.core - Data: fileName="latex.fmt"
2020-11-27 19:59:57,101-0600 FATAL latex.core - Source: Libraries\MiKTeX\TeXAndFriends\texmfapp.cpp:715
2020-11-27 19:59:57,101-0600 FATAL latex - The memory dump file could not be found.
2020-11-27 19:59:57,101-0600 FATAL latex - Info: fileName="latex.fmt"
2020-11-27 19:59:57,101-0600 FATAL latex - Source: Libraries\MiKTeX\TeXAndFriends\texmfapp.cpp
2020-11-27 19:59:57,101-0600 FATAL latex - Line: 715
2020-11-27 19:59:57,102-0600 INFO  latex - this process (6500) finishes with exit code 1

then pdflatex.log

2020-11-27 20:00:13,616-0600 INFO  pdflatex - this process (3436) started by 'cmd' with command line: pdflatex Test.tex
2020-11-27 20:00:13,625-0600 INFO  pdflatex - allowing known shell commands
2020-11-27 20:00:13,626-0600 INFO  pdflatex - enabling input (output) from (to) processes
2020-11-27 20:00:13,659-0600 INFO  pdflatex - going to create file: pdflatex.fmt
2020-11-27 20:00:13,707-0600 INFO  pdflatex.core - start process: initexmf --enable-installer --dump-by-name=pdflatex --engine=pdftex
2020-11-27 20:00:16,924-0600 ERROR pdflatex - C:\Users\amize\AppData\Local\Programs\MiKTeX 2.9\miktex\bin\x64\initexmf.exe did not succeed; exitCode: 1
2020-11-27 20:00:16,924-0600 ERROR pdflatex - output:
2020-11-27 20:00:16,924-0600 ERROR pdflatex - 
Sorry, but "MiKTeX Configuration Utility" did not succeed.

The log file hopefully contains the information to get MiKTeX going again:

  C:\Users\amize\AppData\Local\MiKTeX\2.9\miktex\log\initexmf.log

2020-11-27 20:00:16,924-0600 FATAL pdflatex.core - The memory dump file could not be found.
2020-11-27 20:00:16,924-0600 FATAL pdflatex.core - Data: fileName="pdflatex.fmt"
2020-11-27 20:00:16,924-0600 FATAL pdflatex.core - Source: Libraries\MiKTeX\TeXAndFriends\texmfapp.cpp:715
2020-11-27 20:00:16,925-0600 FATAL pdflatex - The memory dump file could not be found.
2020-11-27 20:00:16,925-0600 FATAL pdflatex - Info: fileName="pdflatex.fmt"
2020-11-27 20:00:16,925-0600 FATAL pdflatex - Source: Libraries\MiKTeX\TeXAndFriends\texmfapp.cpp
2020-11-27 20:00:16,925-0600 FATAL pdflatex - Line: 715
2020-11-27 20:00:16,925-0600 INFO  pdflatex - this process (3436) finishes with exit code 1

and finally initexmf.log(for both of the above attempts)

2020-11-27 19:59:54,232-0600 INFO  initexmf - this is MiKTeX Configuration Utility 4.1 (MiKTeX 20.11)
2020-11-27 19:59:54,233-0600 INFO  initexmf - this process (10216) started by 'latex' with command line: initexmf --enable-installer --dump-by-name=latex --engine=pdftex
2020-11-27 19:59:54,233-0600 INFO  initexmf - Operating on the private (per-user) MiKTeX setup
2020-11-27 19:59:54,243-0600 INFO  initexmf - running: miktex-makefmt.exe --engine=pdftex --dest-name=latex --no-dump latex.ini --engine-option=-tcx=cp227.tcx --enable-installer --miktex-disable-maintenance --miktex-disable-diagnose
2020-11-27 19:59:54,299-0600 INFO  initexmf.core - start process: miktex-makefmt.exe --engine=pdftex --dest-name=latex --no-dump latex.ini --engine-option=-tcx=cp227.tcx --enable-installer --miktex-disable-maintenance --miktex-disable-diagnose
2020-11-27 19:59:57,093-0600 ERROR initexmf - sub-process error output has been saved to 'C:\Users\amize\AppData\Local\MiKTeX\2.9\miktex\log\miktex-makefmt_2020-11-27-195957.out'
2020-11-27 19:59:57,093-0600 FATAL initexmf - The executed process did not succeed.
2020-11-27 19:59:57,093-0600 FATAL initexmf - Info: fileName="C:\Users\amize\AppData\Local\Programs\MiKTeX 2.9\miktex\bin\x64\miktex-makefmt.exe", exitCode="1"
2020-11-27 19:59:57,093-0600 FATAL initexmf - Source: 
2020-11-27 19:59:57,093-0600 FATAL initexmf - Line: 0
2020-11-27 19:59:57,094-0600 INFO  initexmf - this process (10216) finishes with exit code 1
2020-11-27 20:00:13,993-0600 INFO  initexmf - this is MiKTeX Configuration Utility 4.1 (MiKTeX 20.11)
2020-11-27 20:00:13,993-0600 INFO  initexmf - this process (4632) started by 'pdflatex' with command line: initexmf --enable-installer --dump-by-name=pdflatex --engine=pdftex
2020-11-27 20:00:13,993-0600 INFO  initexmf - Operating on the private (per-user) MiKTeX setup
2020-11-27 20:00:14,004-0600 INFO  initexmf - running: miktex-makefmt.exe --engine=pdftex --dest-name=pdflatex --no-dump pdflatex.ini --engine-option=-tcx=cp227.tcx --enable-installer --miktex-disable-maintenance --miktex-disable-diagnose
2020-11-27 20:00:14,060-0600 INFO  initexmf.core - start process: miktex-makefmt.exe --engine=pdftex --dest-name=pdflatex --no-dump pdflatex.ini --engine-option=-tcx=cp227.tcx --enable-installer --miktex-disable-maintenance --miktex-disable-diagnose
2020-11-27 20:00:16,917-0600 ERROR initexmf - sub-process error output has been saved to 'C:\Users\amize\AppData\Local\MiKTeX\2.9\miktex\log\miktex-makefmt_2020-11-27-200016.out'
2020-11-27 20:00:16,917-0600 FATAL initexmf - The executed process did not succeed.
2020-11-27 20:00:16,917-0600 FATAL initexmf - Info: fileName="C:\Users\amize\AppData\Local\Programs\MiKTeX 2.9\miktex\bin\x64\miktex-makefmt.exe", exitCode="1"
2020-11-27 20:00:16,917-0600 FATAL initexmf - Source: 
2020-11-27 20:00:16,917-0600 FATAL initexmf - Line: 0
2020-11-27 20:00:16,918-0600 INFO  initexmf - this process (4632) finishes with exit code 1

The contents of the sub-process error output files are a bit long, for which I apologize (I couldn't figure out how to attach files). Both of them end the same way, with

! Undefined control sequence.

<argument> \document 

This is miktex-makefmt_2020-11-27-195957.out

Running miktex-pdftex.exe...
This is pdfTeX, Version 3.14159265-2.6-1.40.21 (MiKTeX 20.11) (INITEX)

entering extended mode

("C:/Users/amize/AppData/Local/Programs/MiKTeX 2.9/tex/latex/00miktex/latex.ini

"

(C:\Users\amize\AppData\Roaming\MiKTeX\2.9\tex/generic/config\pdftexconfig.tex)



("C:\Users\amize\AppData\Local\Programs\MiKTeX 2.9\tex/latex/base\latex.ltx"

("C:\Users\amize\AppData\Local\Programs\MiKTeX 2.9\tex/latex/base\texsys.cfg")

./texsys.aux found





\@currdir set to: ./.





Assuming \openin and \input 

have the same search path.





Defining UNIX/DOS style filename parser.



catcodes, registers, parameters,

LaTeX2e <2020-10-01> patch level 2

(C:\Users\amize\AppData\Roaming\MiKTeX\2.9\tex/latex/l3kernel\expl3.ltx

(C:\Users\amize\AppData\Roaming\MiKTeX\2.9\tex/latex/l3kernel\expl3-code.tex

(C:\Users\amize\AppData\Roaming\MiKTeX\2.9\tex/latex/l3kernel\l3deprecation.def

))

! Undefined control sequence.

<argument> \document 

                     

l.91

and this is miktex-makefmt_2020-11-27-200016.out,

Running miktex-pdftex.exe...
This is pdfTeX, Version 3.14159265-2.6-1.40.21 (MiKTeX 20.11) (INITEX)

entering extended mode



("C:/Users/amize/AppData/Local/Programs/MiKTeX 2.9/tex/latex/00miktex/pdflatex.

ini"

(C:\Users\amize\AppData\Roaming\MiKTeX\2.9\tex/generic/config\pdftexconfig.tex)



("C:\Users\amize\AppData\Local\Programs\MiKTeX 2.9\tex/latex/base\latex.ltx"

("C:\Users\amize\AppData\Local\Programs\MiKTeX 2.9\tex/latex/base\texsys.cfg")

./texsys.aux found





\@currdir set to: ./.





Assuming \openin and \input 

have the same search path.





Defining UNIX/DOS style filename parser.



catcodes, registers, parameters,

LaTeX2e <2020-10-01> patch level 2

(C:\Users\amize\AppData\Roaming\MiKTeX\2.9\tex/latex/l3kernel\expl3.ltx

(C:\Users\amize\AppData\Roaming\MiKTeX\2.9\tex/latex/l3kernel\expl3-code.tex

(C:\Users\amize\AppData\Roaming\MiKTeX\2.9\tex/latex/l3kernel\l3deprecation.def

))

! Undefined control sequence.

<argument> \document 

                     

My question is: what happened? How do I fix this? It feels like a problem on my end, in my local install, but I'm not experienced enough at the back end of LaTeX to know where to go looking for the error. Is it just a 'reinstall everything' situation, or is it easier or harder than that? Any assistance would be greatly appreicated.

Update 29 Nov 2020 16:19 CST

Here are my TEXMF root & link target directories, they seem to be the standard ones per the MikTeX documentation.

TEXMF Root & Link Target Directories

4
  • 1
    MiKTeX has a problem to create the formats. You seem to have two locations where files come from; Latex.ltx is from appdata/local but expl3 from appdata/roaming. So my first guess is that the files in one are outdated. Did updated as user and as admin? – Ulrike Fischer Nov 28 '20 at 7:45
  • Interesting. I'm using a user-only install: the "Switch to MikTeX Administrator Mode" option is grayed out for me, and running MikTeX Console as administrator didn't get me any new package updates. I've updated the post with a screenshot from MikTeX console showing my root & link target directories. I have only ever manually added the Dropbox one, which I use for style and bib files, etc, that need to be shared between my computers (laptop & desktop). – amizener Nov 29 '20 at 22:20
  • 1
    well your log says that expl3.ltx is taken from C:\Users\amize\AppData\Roaming\MiKTeX\2.9\tex/latex/l3kernel\expl3.ltx and this is not the standard location. It should be like latex.ltx in C:\Users\amize\AppData\Local\Programs\MiKTeX 2.9\tex/latex. But I can't say how it got there. – Ulrike Fischer Nov 29 '20 at 22:51
  • Fascinating. Looking at the dates on the l3kernel folders in both appdata\roaming and appdata\local, only the latter updated on Friday. The former is from February. Is there a way to know what folders should be in roaming and which should be in local, or is this a "screw it, reinstall and hope that fixes things" situation? – amizener Nov 30 '20 at 0:38
1

When I started using MikTeX, several years ago, I encountered the same kind of problems during the update from the console and couldn't easily go back.

Now I have a more conservative approach. (I tried before to have two twin machines and also using a virtual machine for the testing the new installation. But this way is faster)

  1. I do it maybe once a year, and only between projects. Maybe I wait a while until the dust settles for the new release.

  2. As administrator I change the names of the MikTeX installation directories. (in windows there are four) from:

    C:\Program Files\MikTeX

    C:\Program Data\MikTeX

    C:\Users\username\AppData\Local\MikTeX

    C:\Users\username\AppData\Roaming\MikTeX

to

C:\Program Files\MikTeX feb20 OK

C:\Program Data\MikTeX feb20 OK

C:\Users\username\AppData\Local\MikTeX feb20 OK

C:\Users\username\AppData\Roaming\MikTeX feb20 OK
 

where feb20 is the date of current installation and OK indicates that the installation was operational for some time and well tested.

  1. Then I install a basic MikTeX, as admin, using the latest installer available.

  2. Finally I run several tests. I copy to a new directory 3 or 4 old projects, very demanding in terms of memory, fonts and number of packages.

It might take a time until I am are satisfied and can certify the new installation as operational. I compare the new logs with the olds one line by line, and also the pdf output using Adobe Acrobat compare function.

In my work it is very important to be able to reproduce exactly the same result of a two years old document, at least.

If something unacceptable happens (the worst can be errors in the compilation, but sometimes there are more subtle) I add No OK to the 4 names of the newly created directories and change the name of the old ones to their former names. Then I verify that now the copies of the old projects run again without problems.

With this approach, the only additional time spent is downloading all the packages. Maybe a couple of hours, but it gave me a good foundation to get back to business instantly, instead of having a panic attack. I kept the entire font collection in a separate personal directory.

As a bonus, I get rid of packages that I tried once and never used again; plus cleaning the lua cache, fonts db, etc.

I know it sounds like a recipe from Grandma, but it served me well over the years.

(By the way, amizener problems could be related with the need to have admin permissions to install, windows 10 is very picky and annoying in that sense. Not to mention the antivirus)

5
  • That's not a bad idea moving forward, but unfortunately does not help me resolve my current situation. – amizener Nov 29 '20 at 22:23
  • You do mention the antivirus, though: when I went to install package updates the other day (after which my install broke), my antivirus blocked the first attempt at an update (from ctan.javinator9889.com) as an infected web resource. The second update attempt seemed to go fine, and then I got a popup saying something to the effect of 'MikTeX Console needs to close'. Might this be part of the problem? – amizener Nov 29 '20 at 22:29
  • @amizener My suggestion is not to spend time trying to fix it from the console. Do a fresh installation. Do it as admin. If you the only user choose install for everybody. Disable the real time of the antivirus until the basic install is finished. The packages should not be a problem, there are only text files. I always update the single packages and CTAN fonts from the console but not the .exe files because I do not know how to roll back to the older version in case of failure. – Simon Dispa Nov 30 '20 at 10:10
  • I do not have any directory MiKTeX 2.9 in the new installation. The one you mention is from a former one or a leftover. Check the date. – Simon Dispa Nov 30 '20 at 10:16
  • ctan.javinator9889.com is a w10x64. It might be compromised . joesandbox.com/analysis/243706/0/html Try another CTAN mirror. – Simon Dispa Nov 30 '20 at 10:41
0

I believe I have resolved the issue for the time being. Following Simon Dispa's suggestion in his answer, I backed up the non-working (but undisturbed) database structure for posterity, and following Ulrike Fischer's comment on another question, compared all the files in AppData\Roaming\MiKTeX\2.9 to a working directory structure (from my laptop).

There were a lot of extra folders, especially in AppData\Roaming\MiKTeX\2.9\tex\ and \AppData\Roaming\MiKTeX\2.9\tex\generic, but after removing them I refreshed the FNDB and LaTeX compiles again. I don't love this solution method, but it works so I'm not going to let perfect be the enemy of the good and will consider the problem fixed for now.

Thank you Ulrike and Simon for your assistance.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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