0

I used the code here and compiled in my computer, with the result as seen in the picture (this was compiled using PDFLaTeX -> Asy -> PDFLaTeX; neither XeLaTeX, LuaLaTeX nor dvips -> ps2pdf solve this). For comparison I also did it using TikZ and transparency works fine. Here's the MWE:

\documentclass[12pt]{article}

\usepackage[paperwidth=10cm,paperheight=6cm]{geometry}
\usepackage{tikz}
%\usepackage{asymptote}
\usepackage{asypictureB}
\pagestyle{empty}

\setlength{\parindent}{0pt}

\begin{document}
%
\begin{asypicture}{name=1}
%\begin{asy}
unitsize(1cm);

fill(shift(1.5dir(120))*unitcircle,green+opacity(0.75));
fill(shift(1.5dir(60))*unitcircle,red+opacity(0.75));
fill(unitcircle,blue+opacity(0.75));
label("Asymptote",shift(1.5dir(270))*(0,0));
%\end{asy}
\end{asypicture}
\qquad
\begin{tikzpicture}[opacity=0.75]   
\fill[shift={(120:1.5)},green] (0,0) circle (1cm);
\fill[shift={(60:1.5)},red] (0,0) circle (1cm);
\fill[blue] (0,0) circle (1cm);
\node at (270:1.5) {TikZ};
\end{tikzpicture}


\end{document}

I tried using the asymptote and asypictureB packages. I had a somewhat similar issue with PSTricks; the user Akira Kakuto pointed out that this was due to a bug with both Ghostscript and xdvipdfmx (versions 9.52 and 20190824, respectively; as packaged in Debian's TeXLive 2019). Is this related to that bug? I found this report, so apparently the GS hypothesis stands. Is there any way of properly diagnosing this (that is, to be sure it is a bug with GS)? Or to solve it? Thanks!

Asy vs. TikZ

mathbekunkus
  • 1,389
  • For me it works fine using the asymptote package (v1.33) and compiling with pdflatex, asy -nosafe yourfile-1.asy, pdflatex again. Note the nosafe, as also mentioned in the Github thread. My versions are somewhat older, Asymptote version 2.41, Ghostscript version 9.26, all installed using Debian packages for Ubuntu 18.04. Maybe you could try running just asy -nosafe on the example .asy file, see if the issue is there or somewhere in the LaTeX chain? – Marijn Apr 26 '20 at 20:29
  • No joy with the -nosafe option, I regret to say. – mathbekunkus Apr 26 '20 at 21:41
  • similar problems (Debian sid, asymptote svn version). Transparency is ok with svg output. – O.G. Apr 26 '20 at 22:02
  • It works OK under My Windows, except that the Asymptote image is a bit lower in the vertical direction. Please not that you should remove the %\begin{asy} and %\end{asy} inside the asypicture environment, it will cause compiler errors when building the asy code. – ollydbg23 Apr 26 '20 at 22:39
  • @O.G. Indeed, it works with SVG output; however, the result is not scalable (it is pixelated on zoom). – mathbekunkus Apr 27 '20 at 00:40
  • asy code compiles just fine with the current version (2.65) and gs-9.26. Also, you have %\begin{asy} in the asy code, and % does not start a comment in the Asymptote language. – g.kov Apr 27 '20 at 12:31
  • Issue here : https://github.com/vectorgraphics/asymptote/issues/155 – O.G. Apr 28 '20 at 21:21
  • Hi, @O.G. I have attach a pdf in the github issue, it looks like under Windows, transparency is OK, but it does have other issues. – ollydbg23 Apr 28 '20 at 23:24

0 Answers0