abenori / TeX2img

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

Dimension too large #4

Closed stoph86 closed 7 years ago

stoph86 commented 7 years ago

I am using TeX2img as part of a PowerPoint add-in (IguanaTex by Jonathan-LeRoux) to perform vector graphics.

Unfortunately using TeX2img produces pdfs without content which have the dimensions 5.080x5.080 mm. I copied a part of the output in the following.

Do you have any recommendations w.r.t this issue?

Best regards, Christoph


"C:\Program Files (x86)\MiKTeX 2.9\miktex\bin\pdftex.exe" -no-shell-escape -interaction=nonstopmode "ymh3zmyu.tex" This is pdfTeX, Version 3.14159265-2.6-1.40.17 (MiKTeX 2.9.6100) entering extended mode (ymh3zmyu.tex ! Dimension too large.

\relax l.5 \pdfhorigin=-149003995bp\relax ! Dimension too large. \relax l.6 \pdfvorigin=657125980bp\relax ! Dimension too large. \relax l.7 \pdfpagewidth=4950000bp\relax ! Dimension too large. \relax l.8 \pdfpageheight=7002000bp\relax [1 <./xqz2aifg.pdf{C:/Users/Christoph/AppData/Local/MiKTeX/2.9/pdftex/config/pd ftex.map}>] )
aminophen commented 7 years ago

What is your LaTeX code which reproduces the problem?

stoph86 commented 7 years ago

Just using any letter, e.g.

abc

As a preamble I use either pdflatex or LaTeX + dvips.

aminophen commented 7 years ago

I can't reproduce the problem with

%latex: pdflatex
\documentclass[fleqn]{article}
\usepackage{amsmath,amssymb}
\usepackage{xcolor}
\pagestyle{empty}
\begin{document}
abc
\end{document}

Which version of Ghostscript are you using? And, what is the output format? (emf? pdf? or others?)

Also, please provide the information about TeX2img settings. (Tools -> Options) Maybe screenshots of the settings window are useful.

stoph86 commented 7 years ago

Ghostscript 9.20 64-bit I tried several formats. They lead all to the same problem "Dimensions too large". pdf is the only format I can open - probably due to the huge dimensions.

I am using the default settings. I tried some changes without effect. Attached you find screenshots of the settings: 2016-12-11 2016-12-11 1 2016-12-11 2 2016-12-11 3

aminophen commented 7 years ago

Cannot reproduce at all, using the same settings and gs9.20 64bit on my computer. The only one difference from your environment seems TeX Live on my side, instead of MiKTeX.

stoph86 commented 7 years ago

Yes, the error "Dimensions too large" appears inside MiKTeX. I updated the packages in MikTeX but without effect. But compiling the same LaTeX-Code inside TeXnicCenter MiKTeX is working.

Do you have a suggestion to make MiKTeX working together with TeX2img?

abenori commented 7 years ago

Can you show me the full log which is shown in the output window?

stoph86 commented 7 years ago

C:\Users\Christoph\AppData\Local\Temp>"C:\Program Files (x86)\MiKTeX 2.9\miktex\bin\pdflatex.exe" -interaction=nonstopmode s01a5wjt.tex This is pdfTeX, Version 3.14159265-2.6-1.40.17 (MiKTeX 2.9.6100) entering extended mode (s01a5wjt.tex LaTeX2e <2016/03/31> patch level 1 Babel <3.9r> and hyphenation patterns for 75 language(s) loaded. ("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\base\article.cls" Document Class: article 2014/09/29 v1.4h Standard LaTeX document class ("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\base\fleqn.clo") ("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\base\size10.clo")) ("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\amsmath\amsmath.sty" For additional information on amsmath, use the `?' option. ("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\amsmath\amstext.sty" ("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\amsmath\amsgen.sty")) ("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\amsmath\amsbsy.sty") ("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\amsmath\amsopn.sty")) ("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\amsfonts\amssymb.sty" ("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\amsfonts\amsfonts.sty")) (C:\Users\Christoph\AppData\Roaming\MiKTeX\2.9\tex\latex\xcolor\xcolor.sty (C:\Users\Christoph\AppData\Roaming\MiKTeX\2.9\tex\latex\graphics-cfg\color.cfg ) (C:\Users\Christoph\AppData\Roaming\MiKTeX\2.9\tex\latex\graphics-def\pdftex.de f ("C:\Program Files (x86)\MiKTeX 2.9\tex\generic\oberdiek\infwarerr.sty") ("C:\Program Files (x86)\MiKTeX 2.9\tex\generic\oberdiek\ltxcmds.sty"))) No file s01a5wjt.aux. (C:\Users\Christoph\AppData\Roaming\MiKTeX\2.9\tex\context\base\supp-pdf.mkii [Loading MPS to PDF converter (version 2006.09.02).] ) [1{C:/Users/Christoph/AppData/Local/MiKTeX/2.9/pdftex/config/pdftex.map}] (s01a5wjt.aux) )<C:/Program Files (x86)/MiKTeX 2.9/fonts/type1/public/amsfonts/ cm/cmr10.pfb> Output written on s01a5wjt.pdf (1 page, 10170 bytes). Transcript written on s01a5wjt.log.

C:\Users\Christoph\AppData\Local\Temp>"C:\Program Files (x86)\MiKTeX 2.9\miktex\bin\pdflatex.exe" -interaction=nonstopmode s01a5wjt.tex This is pdfTeX, Version 3.14159265-2.6-1.40.17 (MiKTeX 2.9.6100) entering extended mode (s01a5wjt.tex LaTeX2e <2016/03/31> patch level 1 Babel <3.9r> and hyphenation patterns for 75 language(s) loaded. ("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\base\article.cls" Document Class: article 2014/09/29 v1.4h Standard LaTeX document class ("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\base\fleqn.clo") ("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\base\size10.clo")) ("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\amsmath\amsmath.sty" For additional information on amsmath, use the `?' option. ("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\amsmath\amstext.sty" ("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\amsmath\amsgen.sty")) ("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\amsmath\amsbsy.sty") ("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\amsmath\amsopn.sty")) ("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\amsfonts\amssymb.sty" ("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\amsfonts\amsfonts.sty")) (C:\Users\Christoph\AppData\Roaming\MiKTeX\2.9\tex\latex\xcolor\xcolor.sty (C:\Users\Christoph\AppData\Roaming\MiKTeX\2.9\tex\latex\graphics-cfg\color.cfg ) (C:\Users\Christoph\AppData\Roaming\MiKTeX\2.9\tex\latex\graphics-def\pdftex.de f ("C:\Program Files (x86)\MiKTeX 2.9\tex\generic\oberdiek\infwarerr.sty") ("C:\Program Files (x86)\MiKTeX 2.9\tex\generic\oberdiek\ltxcmds.sty"))) (s01a5wjt.aux) (C:\Users\Christoph\AppData\Roaming\MiKTeX\2.9\tex\context\base\supp-pdf.mkii [Loading MPS to PDF converter (version 2006.09.02).] ) [1{C:/Users/Christoph/AppData/Local/MiKTeX/2.9/pdftex/config/pdftex.map}] (s01a5wjt.aux) )<C:/Program Files (x86)/MiKTeX 2.9/fonts/type1/public/amsfonts/ cm/cmr10.pfb> Output written on s01a5wjt.pdf (1 page, 10170 bytes). Transcript written on s01a5wjt.log.

C:\Users\Christoph\AppData\Local\Temp>"C:\Program Files\gs\gs9.20\bin\gswin64c.exe" -q -dBATCH -dNOPAUSE -sDEVICE=bbox -dFirstPage=1 -dLastPage=1 "s01a5wjt.pdf" %%BoundingBox: 149 657 164 665 %%HiResBoundingBox: 149.003995 657.125980 163.637995 664.127980

C:\Users\Christoph\AppData\Local\Temp>"C:\Program Files (x86)\MiKTeX 2.9\miktex\bin\pdftex.exe" -no-shell-escape -interaction=nonstopmode "z4cct0bq.tex" This is pdfTeX, Version 3.14159265-2.6-1.40.17 (MiKTeX 2.9.6100) entering extended mode (z4cct0bq.tex ! Dimension too large.

\relax l.5 \pdfhorigin=-149003995bp\relax ! Dimension too large. \relax l.6 \pdfvorigin=657125980bp\relax ! Dimension too large. \relax l.7 \pdfpagewidth=14634000bp\relax ! Dimension too large. \relax l.8 \pdfpageheight=7002000bp\relax [1 <./s01a5wjt.pdf{C:/Users/Christoph/AppData/Local/MiKTeX/2.9/pdftex/config/pd ftex.map}>] ) (see the transcript file for additional information) Output written on z4cct0bq.pdf (1 page, 10884 bytes). Transcript written on z4cct0bq.log. C:\Users\Christoph\AppData\Local\Temp>"C:\Program Files\gs\gs9.20\bin\gswin64c.exe" -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -dAutoRotatePages=/None -dCompatibilityLevel=1.5 -r20016 -dNoOutputFonts -sOutputFile="vw03yri1.pdf" -c ".setpdfwrite" -f "obb1xjm1.pdf" GPL Ghostscript 9.20 (2016-09-26) Copyright (C) 2016 Artifex Software, Inc. All rights reserved. This software comes with NO WARRANTY: see the file PUBLIC for details. Processing pages 1 through 1. Page 1 C:\Users\Christoph\AppData\Local\Temp>"C:\Temp\TeX2img\pdfiumdraw.exe" --pdf --input-format=pdf --pages=1 --output="vw03yri1-1.pdf" "vw03yri1.pdf" output: C:\Users\Christoph\AppData\Local\Temp\vw03yri1-1.pdf
aminophen commented 7 years ago

And, please provide the whole "effective" LaTeX source (from \documentclass to \end{document}). If you don't understand, the screenshot with TeX2img preamble window + main window would be fine)

stoph86 commented 7 years ago

preamble window: %latex: pdflatex \documentclass[fleqn]{article} \usepackage{amsmath,amssymb} \usepackage{xcolor} \pagestyle{empty}

main window: abc

So alltogether it should be the same code you posted above including \begin and \end{document}

abenori commented 7 years ago

Thanks. The number "-149003995bp" maybe comes from "149.003995" in the output of Ghostscript. But as far as I run TeX2img with my computer, we didn't get such problem. I need to get more information. Can you do the following?

  1. Make a directory to store the test files (which will be denoted by DIR in the following) and make the following source file.

    \documentclass[fleqn]{article}
    \usepackage{amsmath,amssymb}
    \usepackage{xcolor}
    \pagestyle{empty}
    \begin{document}
    abc
    \end{document}
  2. Run TeX2img and change settings as follows

    • After compiling - Delete temporary files after compiling (Recommended) : OFF
    • Directory: Work in the same foloder as the input file
  3. Select the file in 1 for the Input TeX source file and run "Generate".

  4. In DIR, there should be some tex file which is started with \pdfoutput=1\relax Please show me the whole contents of this file.

stoph86 commented 7 years ago

\pdfoutput=1\relax \pdfminorversion=5\relax \pdfximage page 1 mediabox{qcqwgbj2.pdf} \setbox0=\hbox{\pdfrefximage\pdflastximage}\relax \pdfhorigin=-149003995bp\relax \pdfvorigin=657125980bp\relax \pdfpagewidth=14634000bp\relax \pdfpageheight=7002000bp\relax \ht0=\pdfpageheight\relax \shipout\box0\relax \bye

abenori commented 7 years ago

Please try the following TeX2img: https://1drv.ms/u/s!AnAe-sROy6tPgbEHpWSunjYaLbc07Q

stoph86 commented 7 years ago

Now it works for all formats except .emf (produces just some pixels) and .eps (only a white page). In my case this doesn´t matter as it works perfecty fine as part of a PowerPoint add-in (IguanaTex by Jonathan-LeRoux) producing vector grafics.

Thank you very much!

abenori commented 7 years ago

Could you try https://1drv.ms/u/s!AnAe-sROy6tPgbEHpWSunjYaLbc07Q again? I hope emf and eps are also fine.

The point was that my system language (Japanese) is different from yours and it changes the rule of the conversion from number to string etc. Now TeX2img use the English style for the conversion.

stoph86 commented 7 years ago

Unfortunately .emf still doesn´t work. But .eps works now!

abenori commented 7 years ago

Can you show me the full log again? And what is your language?

stoph86 commented 7 years ago

C:\Users\Christoph\AppData\Local\Temp>"C:\Program Files (x86)\MiKTeX 2.9\miktex\bin\pdflatex.exe" -interaction=nonstopmode izhnwdqx.tex This is pdfTeX, Version 3.14159265-2.6-1.40.17 (MiKTeX 2.9.6100) entering extended mode (izhnwdqx.tex LaTeX2e <2016/03/31> patch level 1 Babel <3.9r> and hyphenation patterns for 75 language(s) loaded. ("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\base\article.cls" Document Class: article 2014/09/29 v1.4h Standard LaTeX document class ("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\base\fleqn.clo") ("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\base\size10.clo")) ("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\amsmath\amsmath.sty" For additional information on amsmath, use the `?' option. ("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\amsmath\amstext.sty" ("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\amsmath\amsgen.sty")) ("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\amsmath\amsbsy.sty") ("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\amsmath\amsopn.sty")) ("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\amsfonts\amssymb.sty" ("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\amsfonts\amsfonts.sty")) (C:\Users\Christoph\AppData\Roaming\MiKTeX\2.9\tex\latex\xcolor\xcolor.sty (C:\Users\Christoph\AppData\Roaming\MiKTeX\2.9\tex\latex\graphics-cfg\color.cfg ) (C:\Users\Christoph\AppData\Roaming\MiKTeX\2.9\tex\latex\graphics-def\pdftex.de f ("C:\Program Files (x86)\MiKTeX 2.9\tex\generic\oberdiek\infwarerr.sty") ("C:\Program Files (x86)\MiKTeX 2.9\tex\generic\oberdiek\ltxcmds.sty"))) No file izhnwdqx.aux. (C:\Users\Christoph\AppData\Roaming\MiKTeX\2.9\tex\context\base\supp-pdf.mkii [Loading MPS to PDF converter (version 2006.09.02).] ) [1{C:/Users/Christoph/AppData/Local/MiKTeX/2.9/pdftex/config/pdftex.map}] (izhnwdqx.aux) )<C:/Program Files (x86)/MiKTeX 2.9/fonts/type1/public/amsfonts/ cm/cmr10.pfb> Output written on izhnwdqx.pdf (1 page, 10170 bytes). Transcript written on izhnwdqx.log.

C:\Users\Christoph\AppData\Local\Temp>"C:\Program Files (x86)\MiKTeX 2.9\miktex\bin\pdflatex.exe" -interaction=nonstopmode izhnwdqx.tex This is pdfTeX, Version 3.14159265-2.6-1.40.17 (MiKTeX 2.9.6100) entering extended mode (izhnwdqx.tex LaTeX2e <2016/03/31> patch level 1 Babel <3.9r> and hyphenation patterns for 75 language(s) loaded. ("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\base\article.cls" Document Class: article 2014/09/29 v1.4h Standard LaTeX document class ("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\base\fleqn.clo") ("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\base\size10.clo")) ("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\amsmath\amsmath.sty" For additional information on amsmath, use the `?' option. ("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\amsmath\amstext.sty" ("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\amsmath\amsgen.sty")) ("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\amsmath\amsbsy.sty") ("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\amsmath\amsopn.sty")) ("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\amsfonts\amssymb.sty" ("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\amsfonts\amsfonts.sty")) (C:\Users\Christoph\AppData\Roaming\MiKTeX\2.9\tex\latex\xcolor\xcolor.sty (C:\Users\Christoph\AppData\Roaming\MiKTeX\2.9\tex\latex\graphics-cfg\color.cfg ) (C:\Users\Christoph\AppData\Roaming\MiKTeX\2.9\tex\latex\graphics-def\pdftex.de f ("C:\Program Files (x86)\MiKTeX 2.9\tex\generic\oberdiek\infwarerr.sty") ("C:\Program Files (x86)\MiKTeX 2.9\tex\generic\oberdiek\ltxcmds.sty"))) (izhnwdqx.aux) (C:\Users\Christoph\AppData\Roaming\MiKTeX\2.9\tex\context\base\supp-pdf.mkii [Loading MPS to PDF converter (version 2006.09.02).] ) [1{C:/Users/Christoph/AppData/Local/MiKTeX/2.9/pdftex/config/pdftex.map}] (izhnwdqx.aux) )<C:/Program Files (x86)/MiKTeX 2.9/fonts/type1/public/amsfonts/ cm/cmr10.pfb> Output written on izhnwdqx.pdf (1 page, 10170 bytes). Transcript written on izhnwdqx.log.

C:\Users\Christoph\AppData\Local\Temp>"C:\Program Files\gs\gs9.20\bin\gswin64c.exe" -q -dBATCH -dNOPAUSE -sDEVICE=bbox -dFirstPage=1 -dLastPage=1 "izhnwdqx.pdf" %%BoundingBox: 149 657 164 665 %%HiResBoundingBox: 149.003995 657.125980 163.637995 664.127980

C:\Users\Christoph\AppData\Local\Temp>"C:\Program Files (x86)\MiKTeX 2.9\miktex\bin\pdftex.exe" -no-shell-escape -interaction=nonstopmode "xd0z5wlr.tex" This is pdfTeX, Version 3.14159265-2.6-1.40.17 (MiKTeX 2.9.6100) entering extended mode (xd0z5wlr.tex [1 <./izhnwdqx.pdf{C:/Users/Christoph/AppData/Local/MiKTeX/2.9/pd ftex/config/pdftex.map}>] )<C:/Program Files (x86)/MiKTeX 2.9/fonts/type1/publi c/amsfonts/cm/cmr10.pfb> Output written on xd0z5wlr.pdf (1 page, 10886 bytes). Transcript written on xd0z5wlr.log.

C:\Users\Christoph\AppData\Local\Temp>"C:\Program Files\gs\gs9.20\bin\gswin64c.exe" -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -dAutoRotatePages=/None -dCompatibilityLevel=1.5 -r20016 -dNoOutputFonts -sOutputFile="4p513wmp.pdf" -c ".setpdfwrite" -f "nk3oulua.pdf" GPL Ghostscript 9.20 (2016-09-26) Copyright (C) 2016 Artifex Software, Inc. All rights reserved. This software comes with NO WARRANTY: see the file PUBLIC for details. Processing pages 1 through 1. Page 1

C:\Users\Christoph\AppData\Local\Temp>"C:\Program Files\gs\gs9.20\bin\gswin64c.exe" -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -dAutoRotatePages=/None -dCompatibilityLevel=1.5 -sOutputFile="4p513wmp.pdf" -c ".setpdfwrite /oldstroke /stroke load def /stroke {.dashpath [] 0 setdash oldstroke} def" -f "1tlu0mk2.pdf" GPL Ghostscript 9.20 (2016-09-26) Copyright (C) 2016 Artifex Software, Inc. All rights reserved. This software comes with NO WARRANTY: see the file PUBLIC for details. Processing pages 1 through 1. Page 1

C:\Users\Christoph\AppData\Local\Temp>"C:\Temp\TeX2img\pdfiumdraw.exe" --extent=50 --emf --transparent --pages=1 --output="4p513wmp-%d.emf" "4p513wmp.pdf" output: C:\Users\Christoph\AppData\Local\Temp\4p513wmp-1.emf

stoph86 commented 7 years ago

My language is German.

abenori commented 7 years ago

Thanks, but still I don't understand why this does not work (and also I couldn't get any problem even when I changed the language to German.)

Can you give me all files produced by the steps in https://github.com/abenori/TeX2img/issues/4#issuecomment-266362469

stoph86 commented 7 years ago

\pdfoutput=1\relax \pdfminorversion=5\relax \pdfximage page 1 mediabox{wnvr1bzq.pdf} \setbox0=\hbox{\pdfrefximage\pdflastximage}\relax \pdfhorigin=-149.003995bp\relax \pdfvorigin=657.125980bp\relax \pdfpagewidth=14.634000bp\relax \pdfpageheight=7.002000bp\relax \ht0=\pdfpageheight\relax \shipout\box0\relax \bye

abenori commented 7 years ago

can you show me all files (not only that one)?

stoph86 commented 7 years ago

inputfolder.zip

abenori commented 7 years ago

Isn't there a emf file?

stoph86 commented 7 years ago

emf file.zip

abenori commented 7 years ago

The .emf file looks fine. I guess the reason why you thought it failed is that it's too small. Please see it with Inkscape, for example.

stoph86 commented 7 years ago

I am really sorry having generated this unnecessary extra work for you. But watching this emf in Paint it looks awful. Thx for your help again.

abenori commented 7 years ago

Not a problem, thanks a lot. I'll release a new version as soon as possible.