Closed MaxKoll closed 3 years ago
I think I found a better way to do this:
Don't call latex.exe
directly but via shell (same as with dvipng.exe
), and change into the temporary directory first by prefixing the command with cd /d [temp_path] &&
. I already tried it and it seems to work as expected. No need to set the temporary directory manually.
I will soon open another PR with the proposed changes.
Also, I realize, I should have pushed these changes to a separate branch associated with this PR. If I close this PR, is it still tracking changes to my forked mailextension branch? (I hope not.)
Do those two help pages help?
I believe the brûte force way is to close the pull request, delete your fork (that's somewhere in the settings of your fork) and start again from square one ;-)
Thanks! I will close this now and then reset my mailextension branch, which will hopefully lock this PR's state. Fingers crossed. :-)
Hey,
I ran into the same issue as described in #15, #32 and #56 (even after #81 & #82). So I started digging and came up with a solution/workaround.
What's the problem?
As of May 2020, MiKTeX does no longer support short filenames (aka 8.3 filenames). Unfortunately in my case the path to the temporary directory as given by
Cc["@mozilla.org/file/directory_service;1"].getService(Ci.nsIProperties).get("TmpD", Ci.nsIFile).path
includes short filenames. If I run the command that LaTeX It! shows in the debug box manually (with the paths adjusted), everything works fine.What I considered:
I tried finding a reasonable way to extract the full path in the given framework, but had no success:
Cc["@mozilla.org/process/environment;1"].createInstance(Ci.nsIEnvironment).get("TEMP"/"TMP")
instead, but it also contains short filenames.nsIFile
does not exactly represent a file (handle), but a string (the path). As such, many of its properties and methods are just string manipulations. A notable exception isexists()
which is indeed a true file operation.Also, I haven't found a way to pass a working/execution directory to
nsIProcess
. Otherwise you could just launch the executables from the temporary directory.What I came up with:
I added the option to change the path of the temporary directory. This setting is only used and shown on Windows.
During this I discovered a few other issues that I also tackled:
fontpx_textbox
are not displayed.async function file_exists()
is used in expressions withoutawait
. As the result is a promise, it is always true.I tested my changes on:
On these systems, everything seems to work fine. I don't have the possibility to test on OS X.
If some or all of these changes are desirable, please feel free to use them any way you like. Please tell me if you want this PR split up.
Max