Jonathan-LeRoux / IguanaTex

A PowerPoint add-in allowing you to insert LaTeX equations into PowerPoint presentations on Windows and Mac
http://www.jonathanleroux.org/software/iguanatex/
Other
802 stars 57 forks source link

cannot get tex2img work properly for lguanatex on Mac #15

Closed zhongzhu1998 closed 3 years ago

zhongzhu1998 commented 3 years ago

I have installed the tex2img GUI app and also an exec file of tex2img on my mac. I am sure I typed in the correct path for the exec file but it still has the problem:

" TeX2img did not return in 60 seconds and may have hung. You should have run TeX2img once outside IguanaTex to make sure its path are set correctly. Please make sure your code compiles outside IguanaTex."

I am sure that I can run both the GUI file and exec file correctly outside the lguana tex. So could you please help me with this issue?

Thanks!

Jonathan-LeRoux commented 3 years ago

Hi! Usage of Tex2Img within IguanaTex is not supported on Mac, because EMF files are not supported in Powerpoint for Mac (the irony being that PowerPoint saves PDFs as EMF internally...). I'm actually working on improving IguanaTex for Mac with @ray851107. It looks like the best route on Mac is to replace PNGs with PDFs, and EMFs with SVGs. We'll hopefully have an update in the next few weeks. Thanks, Jonathan

zhongzhu1998 commented 3 years ago

Thanks for your reply! Really looking forward to the new version!

Jonathan-LeRoux commented 3 years ago

I just wanted to let you know that we have made good progress on a unified PC/Mac version of IguanaTex and are in the process of ironing bugs out. I'm confident we will have a beta by the end of April, hopefully earlier.

SivamPillai commented 3 years ago

Could there be any reason for the same error to appear in Windows 10 with Office 365? I am able to run TeX2img outside both in UI and command mode. I was also able to generate bitmap from tex in IguanaTex. The only problem is generating vector from tex in PPT.

Any directions would certainly help, thanks.

image

image

Jonathan-LeRoux commented 3 years ago

There shouldn't be. Can you try running in debug mode and see what happens? That should copy the last command before the error in your clipboard, you can then open a command line window, navigate to your temp folder, paste and run it there.

SivamPillai commented 3 years ago

Yes, the exact same command works just fine in my command line. Tried debug and checked all the path vaues. The error is very strange and haven't been able to figure it out yet.

Jonathan-LeRoux commented 3 years ago

Very strange indeed. If you can, please try opening the .pptm file and generating the same vector display. When the error occurs, it should give you the ability to "debug" and jump to the place in the code where the error is. This may help pinpointing the problem. You could try placing a breakpoint a bit earlier, then stepping through the code (shift+F8 to step over, F8 to step into).

SivamPillai commented 3 years ago

I tried debugging the code, not that I have enough expertise. I believe the error comes at this point:

ret& = CreateProcessA(0&, Pathname, 0&, 0&, 1&, _
            NORMAL_PRIORITY_CLASS, 0&, sdir, start, proc)

ret still remains 0 after the execution of the above... All values prior to this stage seem to be as expected. image

Jonathan-LeRoux commented 3 years ago

I think the problem is due to the use of %USERPROFILE% instead of the expanded path. I just tried and I get the same error as you. That's weird, because indeed, it works if you paste the code in a command line window. In the settings window, can you try setting the path of Tex2imgc.exe by browsing to it with the "..." button? I don't know why this leads to an error. What's especially strange is that the error code is 0, which means success...

SivamPillai commented 3 years ago

Great catch! That was indeed the error. Changing %USERPROFILE% to full path fixes the problem. Thank you so much for helping me out.

Jonathan-LeRoux commented 3 years ago

No worries, I learnt something. I'll have to add this to the installation instructions.

Jonathan-LeRoux commented 3 years ago

@zhongzhu1998 I just released a beta of the new version of IguanaTex, please check it out: v1.59 aka v1.60 beta

Jonathan-LeRoux commented 3 years ago

@SivamPillai Note that the latest beta version now automatically replaces %USERPROFILE% with its value upon saving the settings.