abenori / TeX2img

Converte TeX source to images.
Other
59 stars 5 forks source link

Issue when generating EMF to charge it in Power point (using windows 10) (does not generate EMF file when I create a vector entry from Iguanatex) #13

Open martigomaria opened 4 years ago

martigomaria commented 4 years ago

It starts to convert from latex to pdf but in the step when it has to create a EMF file to charge it to power point it stops. I guess the problem cames from the pdfiumdraw.exe step.

In Tex2img appears the following output:

"F:\Programas\TeX2img\pdfiumdraw.exe" --extent=50 --emf --transparent --pages=1 --output="c4nvcxw0-%d.emf" "c4nvcxw0.pdf" output: F:\Maria\Prueba Iguanatex\c4nvcxw0-1.emf

And after 60 seconds waiting for a response, it appers the following error: screenshot

Any guess why?

abenori commented 4 years ago

Can you give me an example of a LaTeX source code which causes a problem?

martigomaria commented 4 years ago

Sure. With the following code, I am not having any problem if a create a bitmap iguanaTex output. However, I encourage the problem I described below if I try to generate a vector output.

\documentclass{article} \usepackage{amsmath} \pagestyle{empty} \begin{document} $i_{12}$ \end{document}

abenori commented 4 years ago

Thank you. I tried with your source but it in fact did not fail. I'll try to figure out what is happening, but maybe not soon... Did you ask it to the developer of IguanaTeX? Because you succeed to generated a EMF file with TeX2img, it is possible that there is some reason with IguanaTeX. I think it worth to do it.

Jonathan-LeRoux commented 3 years ago

(Developer of IguanaTex here ;) ) I'm happy to look into this if that's still an issue. First thing to try is to run IguanaTeX with the Debug box checked, then open a command line, cd to the IguanaTex Temp folder, paste the TeX2img command that was copied to the clipboard, and run it. There must be some issue with paths. If I had to take a guess, I would say that you put tex2img.exe instead of tex2imgc.exe as the TeX2img path in the IguanaTex settings.

amirweiss15 commented 1 year ago

Hi, I also have the same bug, and I made sure that I have 'tex2imgc.exe' rather than 'tex2img.exe' in my IguanaTex settings, so that's not the issue like Jonathan had hypothesized. Can anyone help with this? Tried several things, but I'm bit a stuck here

Jonathan-LeRoux commented 1 year ago

Did you try the debugging steps I mentioned in IguanaTeX?

amirweiss15 commented 1 year ago

Yes, of course. I went over this page. However, there is nothing about the error message that appears in the screenshot above ("Tex2img did not return in 60 seconds..."). It should be mentioned that I see it after a few seconds, not 60. Moreover, I tried changing the number of second in the respective field, and it gives the same message, with the number of seconds modified, but the message appears after (approximately or the same, haven't measured exactly) period of time.

Jonathan-LeRoux commented 1 year ago

Just to confirm, what happens if you run the compilation in IguanaTeX with the Debug box checked, then open a command line, cd to the IguanaTex Temp folder, paste the TeX2img command that was copied to the clipboard, and run it? As a workaround, I would suggest using SVG instead of EMF for vector graphics. It's available in the latest version of IguanaTex.

amirweiss15 commented 1 year ago

Well, it's a very long output, but the end of it is: image How do I try the workaround? Where do I change from EMF to SVG? And thanks for helping with this! Much appreciated!

Jonathan-LeRoux commented 1 year ago

This may be a Tex2img issue, I'd suggest showing the command you used in CMD, and the latex source.

Re: SVG, you need the latest version of IguanaTex v1.60.2. Then you can choose which type of vector conversion you would like to use in the "Main settings". Note that you need a recent version of Office for SVG support.

abenori commented 1 year ago

Is it possible to give the command line and the source file which TeX2img tried to compile? It will be helpful.

amirweiss15 commented 1 year ago

I updated to the latest version of IguanaTex v1.60.2, and when I generate with Latex Engine "latex (DVI)" and "Vector", I get this error message: image

Not sure what is the source file, but it happens with every simple latex code (e.g., "$x=y$).

This is the error message I get when running with the latest IguanaTex version: image

Jonathan-LeRoux commented 1 year ago

Maybe your version of Office doesn't support SVG. I believe it's only on Office 2019 and 365. You can try switching the vector setting back to EMF, but you'll likely be back to the tex2img issue.

amirweiss15 commented 1 year ago

Yes, that's where I am now (and I have office 2021)

abenori commented 1 year ago

I compiled the following source file with the command line you showed.

\documentclass{article}
\begin{document}
$x = y$
\end{document}

I didn't get any error. Could you give me more information. The source file should be helpful. It would be also good if you give me a full log file.

Jonathan-LeRoux commented 1 year ago

One thing to confirm is, can you compile the same source in the Tex2img GUI.

amirweiss15 commented 1 year ago

I tried to generate the source code: \documentclass{article} \begin{document} $x = y$ \end{document} directly in the Tex2ing GUI. I got this error message: image and here's the output:


C:\Users\amirw\AppData\Local\Temp>"C:\Users\amirw\AppData\Local\Programs\MiKTeX\miktex\bin\x64\latex.exe" -interaction=nonstopmode wjxgurqp.tex This is pdfTeX, Version 3.141592653-2.6-1.40.25 (MiKTeX 23.4) (preloaded format=latex.fmt) restricted \write18 enabled. entering extended mode (wjxgurqp.tex LaTeX2e <2022-11-01> patch level 1 L3 programming layer <2023-03-30> (C:\Users\amirw\AppData\Local\Programs\MiKTeX\tex/latex/base\article.cls Document Class: article 2022/07/02 v1.4n Standard LaTeX document class (C:\Users\amirw\AppData\Local\Programs\MiKTeX\tex/latex/base\size10.clo)) (C:\Users\amirw\AppData\Local\Programs\MiKTeX\tex/latex/l3backend\l3backend-dvi ps.def) No file wjxgurqp.aux. [1] (wjxgurqp.aux) ) Output written on wjxgurqp.dvi (1 page, 300 bytes). Transcript written on wjxgurqp.log.

C:\Users\amirw\AppData\Local\Temp>"C:\Users\amirw\AppData\Local\Programs\MiKTeX\miktex\bin\x64\latex.exe" -interaction=nonstopmode wjxgurqp.tex This is pdfTeX, Version 3.141592653-2.6-1.40.25 (MiKTeX 23.4) (preloaded format=latex.fmt) restricted \write18 enabled. entering extended mode (wjxgurqp.tex LaTeX2e <2022-11-01> patch level 1 L3 programming layer <2023-03-30> (C:\Users\amirw\AppData\Local\Programs\MiKTeX\tex/latex/base\article.cls Document Class: article 2022/07/02 v1.4n Standard LaTeX document class (C:\Users\amirw\AppData\Local\Programs\MiKTeX\tex/latex/base\size10.clo)) (C:\Users\amirw\AppData\Local\Programs\MiKTeX\tex/latex/l3backend\l3backend-dvi ps.def) (wjxgurqp.aux) [1] (wjxgurqp.aux) ) Output written on wjxgurqp.dvi (1 page, 300 bytes). Transcript written on wjxgurqp.log.

C:\Users\amirw\AppData\Local\Temp>"C:\Users\amirw\AppData\Local\Programs\MiKTeX\miktex\bin\x64\dvipdfmx.exe" wjxgurqp.dvi wjxgurqp.dvi -> wjxgurqp.pdf [1] 2997 bytes written

C:\Users\amirw\AppData\Local\Temp>"C:\Program Files\gs\gs10.01.1\bin\gswin64c.exe" -q -dBATCH -dNOPAUSE -sDEVICE=bbox -dFirstPage=1 -dLastPage=1 "wjxgurqp.pdf" %%BoundingBox: 149 139 308 712 %%HiResBoundingBox: 149.003995 139.247996 307.313991 711.539978

C:\Users\amirw\AppData\Local\Temp>"C:\Program Files\gs\gs10.01.1\bin\gswin64c.exe" -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -dAutoRotatePages=/None -dCompatibilityLevel=1.5 -r20016 -dNoOutputFonts -dFirstPage=1 -dLastPage=1 -sOutputFile="ekidilfq.pdf" -c ".setpdfwrite" -f "wjxgurqp.pdf" GPL Ghostscript 10.01.1 (2023-03-27) Copyright (C) 2023 Artifex Software, Inc. All rights reserved. This software is supplied under the GNU AGPLv3 and comes with NO WARRANTY: see the file COPYING for details. Error: /undefined in .setpdfwrite Operand stack: GPL Ghostscript 10.01.1: Unrecoverable error, exit code 1

Execution stack: %interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- Dictionary stack: --dict:777/1123(ro)(G)-- --dict:0/20(G)-- --dict:75/200(L)-- Current allocation mode is local Last OS error: No such file or directory


abenori commented 1 year ago

Which version of TeX2img are you using? It seems to be before 2.1.0.

amirweiss15 commented 1 year ago

I have 2.1.0.0

abenori commented 1 year ago

The latest version is 2.2.1, so please download it from https://www.ms.u-tokyo.ac.jp/~abenori/soft/index.html#TEX2IMG and update it.

amirweiss15 commented 1 year ago

I just downloaded it, updated the settings, and tried to generate. It gave me the same error message I posted above: image

abenori commented 1 year ago

Did you really get the same error? In the previous post the error comes from .setpdfwrite command, but in the latest version the usage of this command is removed, so it is very strange for me. Could you please check the full log file and the version again?

Jonathan-LeRoux commented 1 year ago

You should try again in the Tex2img GUI. The error you are showing is more likely due to the fact that your version of Office does not support SVG.

amirweiss15 commented 1 year ago

I have no errors when I generate an eps file via Tex2img GUI.

abenori commented 1 year ago

Maybe you should switch the vector setting back to EMF?

amirweiss15 commented 1 year ago

It works with no errors with EMF. Thanks a lot to both of you for your help!