1

Asymptote and Latex were successfully installed and configured on a Windows 10 laptop, but throw errors on a PC with multiple hard drives. Since the user's working directory is on a different drive, the environment variables below were created for the search paths. It has been confirmed that the search paths are being invoked. What is missing here?

OS and packages:

OS: Windows 10
Miktex v22.10
Asymptote v2.83
Ghostscript v9.56.1

Error:

Error: /undefined in .setfillconstantalpha

Search path environment variables:

ASYMPTOTE_DIR       C:\Program Files\Asymptote
ASYMPTOTE_HOME      %USERPROFILE%\.asy

%USERPROFILE%.asy\config.asy

import settings;
outformat="pdf";

Latex file test.tex:

\documentclass{article}
\usepackage{asymptote}
\begin{document}
\begin{center}
  \begin{asy}
    settings.prc = false;
    settings.render = 0;
    import three;
    size(4cm,0);
    
    // Draw axes
    draw(O--2X, blue);
    draw(O--2Y, green);
    draw(O--2Z, red);
  \end{asy}
\end{center}
\end{document}

Terminal output:

PS F:\working_dir\latex> pdflatex .\test.tex           
This is pdfTeX, Version 3.141592653-2.6-1.40.24 (MiKTeX 22.10) (preloaded format=pdflatex.fmt)
 restricted \write18 enabled.
entering extended mode
(test.tex
LaTeX2e <2022-11-01>
L3 programming layer <2022-11-02>
(C:\Program Files\MiKTeX\tex/latex/base\article.cls
Document Class: article 2022/07/02 v1.4n Standard LaTeX document class
(C:\Program Files\MiKTeX\tex/latex/base\size10.clo))
(C:\Users\user1\AppData\Roaming\MiKTeX\tex/latex/asymptote\asymptote.sty
(C:\Program Files\MiKTeX\tex/latex/graphics\keyval.sty)
(C:\Program Files\MiKTeX\tex/latex/base\ifthen.sty)
(C:\Program Files\MiKTeX\tex/latex/graphics\graphicx.sty
(C:\Program Files\MiKTeX\tex/latex/graphics\graphics.sty
(C:\Program Files\MiKTeX\tex/latex/graphics\trig.sty)
(C:\Program Files\MiKTeX\tex/latex/graphics-cfg\graphics.cfg)
(C:\Program Files\MiKTeX\tex/latex/graphics-def\pdftex.def)))
(C:\Program Files\MiKTeX\tex/generic/iftex\ifpdf.sty
(C:\Program Files\MiKTeX\tex/generic/iftex\iftex.sty))
(C:\Program Files\MiKTeX\tex/generic/iftex\ifxetex.sty)
(C:\Users\user1\AppData\Roaming\MiKTeX\tex/generic/catchfile\catchfile.sty
(C:\Users\user1\AppData\Roaming\MiKTeX\tex/generic/infwarerr\infwarerr.sty)
(C:\Users\user1\AppData\Roaming\MiKTeX\tex/generic/ltxcmds\ltxcmds.sty)
(C:\Users\user1\AppData\Roaming\MiKTeX\tex/generic/etexcmds\etexcmds.sty)))
(C:\Program Files\MiKTeX\tex/latex/l3backend\l3backend-pdftex.def)
No file test.aux.
(C:\Program Files\MiKTeX\tex/context/base/mkii\supp-pdf.mkii
[Loading MPS to PDF converter (version 2006.09.02).]
) (C:\Program Files\MiKTeX\tex/latex/epstopdf-pkg\epstopdf-base.sty
(C:\Program Files\MiKTeX\tex/latex/00miktex\epstopdf-sys.cfg))

Package asymptote Warning: file `test-1.pdf' not found on input line 14.

[1{C:/Users/user1/AppData/Local/MiKTeX/fonts/map/pdftex/pdftex.map}] (test.aux
) )<C:/Program Files/MiKTeX/fonts/type1/public/amsfonts/cm/cmr10.pfb>
Output written on test.pdf (1 page, 9253 bytes).
Transcript written on test.log.
pdflatex: major issue: So far, you have not checked for updates as a MiKTeX user.

Terminal output:

PS F:\working_dir\latex> asy -vvv .\test-1.asy
Using configuration directory C:/Users/user1/.asy
Loading config.asy from C:/Users/user1/.asy/config.asy
Using history C:/Users/user1/.asy/history
Welcome to miktex-asy version 2.81
cd \\?\F:\working_dir\latex
Processing test-1
Loading plain from C:/Program Files/Asymptote/plain.asy
Including plain_constants from C:/Program Files/Asymptote/plain_constants.asy
Loading version from C:/Program Files/Asymptote/version.asy
Including plain_strings from C:/Program Files/Asymptote/plain_strings.asy
Including plain_pens from C:/Program Files/Asymptote/plain_pens.asy
Including plain_paths from C:/Program Files/Asymptote/plain_paths.asy
Including plain_filldraw from C:/Program Files/Asymptote/plain_filldraw.asy
Including plain_margins from C:/Program Files/Asymptote/plain_margins.asy
Including plain_picture from C:/Program Files/Asymptote/plain_picture.asy
Loading plain_scaling from C:/Program Files/Asymptote/plain_scaling.asy
Loading simplex from C:/Program Files/Asymptote/simplex.asy
Loading plain_bounds from C:/Program Files/Asymptote/plain_bounds.asy
Including plain_scaling from C:/Program Files/Asymptote/plain_scaling.asy
Including plain_prethree from C:/Program Files/Asymptote/plain_prethree.asy
Including plain_Label from C:/Program Files/Asymptote/plain_Label.asy
Including plain_arcs from C:/Program Files/Asymptote/plain_arcs.asy
Including plain_boxes from C:/Program Files/Asymptote/plain_boxes.asy
Including plain_shipout from C:/Program Files/Asymptote/plain_shipout.asy
Including plain_markers from C:/Program Files/Asymptote/plain_markers.asy
Including plain_arrows from C:/Program Files/Asymptote/plain_arrows.asy
Including plain_debugger from C:/Program Files/Asymptote/plain_debugger.asy
warning [version]: using possibly incompatible version 2.83 of plain.asy
Loading .\test-1.asy from .\test-1.asy

Loading three from C:/Program Files/Asymptote/three.asy
Loading math from C:/Program Files/Asymptote/math.asy
Loading embed from C:/Program Files/Asymptote/embed.asy
Including three_light from C:/Program Files/Asymptote/three_light.asy
Including three_surface from C:/Program Files/Asymptote/three_surface.asy
Loading bezulate from C:/Program Files/Asymptote/bezulate.asy
Loading interpolate from C:/Program Files/Asymptote/interpolate.asy
Loading graph_splinetype from C:/Program Files/Asymptote/graph_splinetype.asy
Including three_margins from C:/Program Files/Asymptote/three_margins.asy
Including three_tube from C:/Program Files/Asymptote/three_tube.asy
Including three_arrows from C:/Program Files/Asymptote/three_arrows.asy
Error: /undefined in .setfillconstantalpha
Operand stack:
   1
Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   false 
  1   %stopped_push   2015   1   3   %oparray_pop   2014   1   3   %oparray_pop   --nostringval--   1998   1   3   %oparray_pop   1884   1   3   %oparray_pop   --nostringval--   %errorexec_pop   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--
Dictionary stack:
   --dict:979/1684(ro)(G)--   --dict:0/20(G)--   --dict:82/200(L)--
Current allocation mode is local
Current file position is 350
MiKTeX GPL Ghostscript 9.25: Unrecoverable error, exit code 1
  _shipout(prefix,f,currentpatterns,format,wait,view,t);
          ^
C:/Program Files/Asymptote/plain_shipout.asy: 116.11: runtime: shipout failed
asy: major issue: So far, you have not checked for updates as a MiKTeX user.
5
  • As you can see in the Terminal output, the ancient GS version 9.25 bundled with MiKTeX is still used, despite the relatively recent system-wide installation 9.56.1. It is a long-standing MiKTeX nuisance. Try set MIKTEX_PREFERMIKTEXGHOSTSCRIPT=false in the Windows environment. Source: tex.stackexchange.com/q/636379
    – AlexG
    Commented Nov 23, 2022 at 15:23
  • @AlexG thanks. You mean in the Windows system environment variable dialogue or in one of the miktex .ini files? I tried setting 'Variable name: MIKTEX_PREFERMIKTEXGHOSTSCRIPT' and 'Variable value: false' in the Windows EV dialogue but it doesn't seem to work. I've never used booleans with Windows System Variables. I saw the Github issue but couldn't find that variable in the Miktex docs.
    – pomomayu
    Commented Nov 23, 2022 at 19:29
  • See: docs.miktex.org/manual/miktex.ini.html : Acc. to this document, run initexmf in a MiKTeX command line window, look for the variable PreferMiKTeXGhostscript and set it to false. Unfortunately, I do not have MiKTeX, so I cannot try this myself.
    – AlexG
    Commented Nov 23, 2022 at 20:14
  • @AlexG running initexmf --show-config-value=PreferMikTexGhostscript returns false, but it's still trying to compile with the Miktex' bundled Ghostscript 9.25. Strangely all of this was tested on a dummy Windows 10 laptop first and that installation picked up the system-wide Ghostscript package 9.56.1 without any configuration. Will have to submit an issue on Github.
    – pomomayu
    Commented Nov 27, 2022 at 18:49
  • @AlexG apparently the way to set this variable is: initexmf --admin --set-config-value=[COre]PREFERMIKTEXGHOSTSCRIPT=no. The strangest thing is that I had almost given up on Miktex and was going to try TexLive, but in the process received an answer on Github so I re-installed Miktex. After re-installing Miktex everything worked without any configuration. Perhaps Ghostscript needs to be installed on the system before Miktex is installed but the issue was closed before I could ask. github.com/MiKTeX/miktex-packaging/issues/309
    – pomomayu
    Commented Dec 3, 2022 at 3:43

0

You must log in to answer this question.

Browse other questions tagged .