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
790 stars 57 forks source link

empty bbx file with LateX engine pdflatex #27

Closed rcontinuum closed 2 years ago

rcontinuum commented 2 years ago

Hello,

I encounter a problem with Iguanatex (v1_59_1.ppam) if I use pdflatex (miktex installed, Windows 10) as the latex engine. It could be a ghostscript problem too.

For any formula I try to generate the temporary pdf file "c:\temp\IguanaTex_tmp.pdf" looks good and contains the expected formula. The next command issued by Iguanatex (I'm in debug mode)

  1. cmd /C "C:\Program Files\gs\gs9.26\bin\gswin64.exe" -q -dBATCH -dNOPAUSE -sDEVICE=bbox IguanaTex_tmp.pdf 2> IguanaTex_tmp.bbx

leads not to an error but to an empty file "IguanaTex_tmp.bbx" , i.e. 0 bytes.

Thus the next command

  1. "C:\Program Files\gs\gs9.26\bin\gswin64.exe" -q -dBATCH -dNOPAUSE -sDEVICE=pngalpha -r1200 -sOutputFile=IguanaTex_tmp_tmp.png -gx -c "<</Install { translate}>> setpagedevice" -f "c:\temp\IguanaTex_tmp.pdf"

results in a ghostscript error message and Iguanatex fails. In a ghostscript window that pops up I see

-g must be followed by \<width\>x\<height\>
Close this window with the close button on the title bar or the system menu.

I assume the reason 2. is failing is the empty bbx-file in 1. The -g option in the gs command line is "empty".

Now, if I execute 1. in a shell, i.e. cmd.exe and cd C:\temp, and remove the -dNOPAUSE option, then ghostscript shows me a ghostscript window with the following text:

%%BoundingBox: 134 522 401 668
%%HiResBoundingBox: 134.00  522.86  400.12 667.04     (I skipped some digits)
>>showpage, press <return> to continue<<

Thus, command 1. gives a reasonable bounding box but somehow is not able to write it to the bbx file. Additionally, I tried gs9.56.1. The newest version, of ghostscript. But same problem.

Any hints?

PS: engine latex(DVI) works as expected, as it uses "dvipng" for the conversion.

Jonathan-LeRoux commented 2 years ago

I believe the issue is that you are using gswin64.exe instead of gswin64c.exe. I should probably do an automatic check as this is a subtle error that I'm sure has bitten quite a few people...

rcontinuum commented 2 years ago

You are right! gswin64c.exe works. And you wrote that even in the "Main Settings". Thank you!

Jonathan-LeRoux commented 2 years ago

Great. I added the automatic check to my To Do list.