# Problem compiling latex document: invalid STOI argument (Miktex, pst-optexp)

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?

• Welcome to TeX SX! It seems to be linked to a conversion problem. Could you please post a small compete code reproducing the problem? – Bernard Jan 2 at 12:25
• @Bernard Hi, thanks for the quick comment. I'm not sure what you mean by a compete code reproducing the problem, do you mean the contents of a simple latex document that produces this error? If so, even something as simple as: \documentclass{article} \usepackage{pst-all} \usepackage{pst-optexp} \begin{document} test \end{document} – Oli Jan 2 at 12:37
• Just something that can be compiled as is, and reproduces the problem. – Bernard Jan 2 at 12:49
• Hi, slightly embarrassingly I've been able to solve the problem after resetting my personal miktex configuration in the 'cleanup' tab, redownloading all the packages, redownloading texworks and restarting again. However, thanks for taking the time to read through my problem. – Oli Jan 2 at 13:01
• No worry. Anyway, it is often useful to update. Happy new year! – Bernard Jan 2 at 13:35