Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LatexIt doesn't work for me on Windows #56

Closed
urigrupel opened this issue Jun 29, 2020 · 16 comments
Closed

LatexIt doesn't work for me on Windows #56

urigrupel opened this issue Jun 29, 2020 · 16 comments

Comments

@urigrupel
Copy link

Hi,

I am running Windows 10 (1803), Miktex 20.6, Thunderbird 68.9.0 and LatexIt 0.6.8.
It doesn't matter which latex code I try to convert, it doesn't work. The error message I get is

LatexIt! run report...

*** Found expression $a^2$
LaTeX process returned 1
Proceeding anyway...
Severe error. Missing package?
We left the .tex file there: C:\Users\URIGRU~1\AppData\Local\Temp\tblatex-1.tex, try to run latex on it by yourself...

In the above code I don't use any package.
It happens to me on several computers with similar setup. I can run both latex and dvipng manually on the temporary file without a problem. The path for both is correct.

The add-on used to work for me with ImageMagick convert, but this option is not available anymore.

What should I do?
Thanks

@sphh
Copy link
Collaborator

sphh commented Jun 29, 2020

Can you please switch on the option Generate debug info in addition to Generate a log report and try to LaTeX It! again. Please post the output. Thanks.

@urigrupel
Copy link
Author

urigrupel commented Jun 29, 2020

Thank you. This is what I got.

LatexIt! run report...

*** Found expression $a^2$

$PATH is C:\Program Files\ImageMagick-7.0.8-Q16;;;;C:\Program Files\MATLAB\R2018b\bin;C:\Program Files\MATLAB\R2018b\bin\win64;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\PuTTY\;C:\Program Files\TortoiseSVN\bin;C:\Program Files\Git\cmd;C:\Program Files\TortoiseGit\bin;C:\Program Files\MiKTeX 2.9\miktex\bin\x64\;C:\Program Files\MATLAB\R2018b\runtime\win64;C:\Users\Admin\AppData\Local\Microsoft\WindowsApps;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Users\Uri Grupel\AppData\Local\Programs\Python\Python37\Scripts\;C:\Users\Uri Grupel\AppData\Local\Programs\Python\Python37\;C:\Users\Uri Grupel\AppData\Local\Microsoft\WindowsApps;C:\Users\Uri Grupel\AppData\Local\atom\bin

*** Generating LaTeX expression:
\documentclass{article}
\usepackage[utf8x]{inputenc}
\usepackage{amsmath, amssymb}
\pagestyle{empty}
\begin{document}
$a^2$ %this is where your LaTeX expression goes
\end{document}

I ran C:\Program Files\MiKTeX 2.9\miktex\bin\x64\latex.exe -output-directory=C:\Users\URIGRU~1\AppData\Local\Temp -interaction=batchmode C:\Users\URIGRU~1\AppData\Local\Temp\tblatex-2.tex error code 1
LaTeX process returned 1
Proceeding anyway...
Severe error. Missing package?
We left the .tex file there: C:\Users\URIGRU~1\AppData\Local\Temp\tblatex-2.tex, try to run latex on it by yourself...
--> Failed, not inserting

@sphh
Copy link
Collaborator

sphh commented Jun 30, 2020

Thanks. What happens if you run the command C:\Program Files\MiKTeX 2.9\miktex\bin\x64\latex.exe -output-directory=C:\Users\URIGRU~1\AppData\Local\Temp -interaction=batchmode C:\Users\URIGRU~1\AppData\Local\Temp\tblatex-2.tex from the command prompt? Can you please post the output.

@urigrupel
Copy link
Author

It seems to be a permissions problem. When I run the command from another folder, in the log file I see

Emergency stop.
<to be read again> 
                   \protect 
<*> C:/Users/URIGRU~

When I run this locally in the folder it works without a problem. An easy solution is to add an option to choose the temp folder. If I just use "C:\tmp" for example, it works.

If you want I can attach a log file and a print screen, but it doesn't seem to contain any information.

@sphh
Copy link
Collaborator

sphh commented Jun 30, 2020

I have to admit that I am not a Windows person...

Does the LaTeX command work, if you use the full path, that is C:\Users\URIGRUPEL\AppData\Local\Temp (or whatever it is) instead of C:\Users\URIGRU~1\AppData\Local\Temp in one or both occurrences?

@urigrupel
Copy link
Author

urigrupel commented Jun 30, 2020

Yes. Surprisingly, this solves the problem.
Thank you for your patience.

@sphh
Copy link
Collaborator

sphh commented Jun 30, 2020

If it works with the long path, but not the short path, then this is probably a problem in the realm of MiKTeX. Have you checked with them?

@urigrupel
Copy link
Author

No I didn't. Since I compile latex files all the time I assumed that the problem was not with MikTeX. Thanks.

@sphh
Copy link
Collaborator

sphh commented Jun 30, 2020

No worries. If you find a solution with MiKTeX, could you please (cross)post it here. Thanks.

@urigrupel
Copy link
Author

It seems that MiKTeX no longer support short paths.

@sphh
Copy link
Collaborator

sphh commented Jun 30, 2020

Thanks for checking with MiKTeX and posting the result.

LatexIt uses the temporary directory provided by javascript/Thunderbird (see https://github.com/protz/LatexIt/blob/master/content/main.js#L139-L141), which returns the temporary directory in short 8.3 DOS notation.

Personally I don't know enough Javascript and don't work on Windows, hence would not be able to test it. I am afraid we have to wait for @protz or someone else to step in. Sorry.

PS: I wonder, how MiKTeX handles the file tmp~tmp.tex, which I believe is a perfectly legal filename? You might want to try it and if it is not working, issue a bug report. (Just my 2 cent thought, because as I already said, I don't have access to MiKTeX on Windows.)

@urigrupel
Copy link
Author

urigrupel commented Jun 30, 2020

In a blog post they write that it doesn't support it anymore. The reason for the change is that ~ is used as a special character for some packages.

@sphh
Copy link
Collaborator

sphh commented Jun 30, 2020

Well, they write, that they don't support Windows/DOS 8.3 file names anymore. But tmp~tmp.tex is not the 8.3 version of a long Windows file name, but a proper Windows file name...

@urigrupel
Copy link
Author

I just checked it, it doesn't work. As they mentioned in the response to my issue, the problem is that ~ is used for some other purposes.

@sphh
Copy link
Collaborator

sphh commented Jun 30, 2020

~ is a non-breaking space in LaTeX.

My point is, that tmp~tmp.tex is a legal file name in Windows and must (should!) work when used as a file name, but you confirmed that it does not work. IMHO this is a regression. (I can understand that they don't want to support short file names anymore, but why not supporting tmp~tmp.tex escapes me.)

@sphh
Copy link
Collaborator

sphh commented Jul 8, 2020

Just for the record: #15 and #32 report the same problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants