[Tex/LaTex] Problem compiling latex document: invalid STOI argument (Miktex, pst-optexp)

miktexmiktex2.9pst-optexptexworks

I've been trying to produce optics figures using the pst-optexp package in latex, however something has gone wrong meaning I can't compile anything in latex now using texworks and miktex. I'm working on Windows 10 on a Dell XPS 13.

I've had a few problems with the package and Miktex previously, e.g. having to enable write-18 on the Miktex extension after errors. I found it easiest to get pdf output to look as intended in the package manual by compiling in latex, running dvips and sp2pdf as so on the commmand line:

'''
latex test.tex
dvips test.dvi
ps2pdf test.ps
'''

This worked better than compiling with Xelatex, which is the recommended. However, all of a sudden without any changes I can no longer compile with the latex, pdflatex or xelatex commands at all, both on the command line or in the texworks own compiler. I get the error:

Sorry, but latex did not succeed.

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

When viewing the log file it reads the following:

latex test.tex
2020-01-02 11:59:06,970Z FATAL latex - invalid stoi argument
2020-01-02 11:59:06,970Z INFO  latex - finishing with exit code 1

I assume as a similar term exists in C/C++ that this is a problem with a config file in Miktex, however after uninstall and reinstalling I get the same error trying to compile with any of latex,pdflatex or xelatex.

What does the 'invalid STOI argument' mean in this context, and/or how could this be fixed?

Best Answer

I've been able to solve the problem after resetting my personal miktex configuration in the 'cleanup' tab, redownloading all the relevant packages, redownloading texworks and restarting again. The error was likely in a config file or one of the imported modules that disappeared on cleanup.

Related Question