This is a bug in graphicx.tex, not in Asymptote. Here is a simpler TeX example, which produces the error
`Unknown graphics extension: ../pdf/bpms_0.pdf`. One workaround is to use a symbolic link. Or use pdflatex. Perhaps you would like to report this bug to the maintainer of graphicx:
   \input graphicx
   \input picture
   \includegraphics{../pdf/bpms_0.pdf}%
   \bye
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
To be more precisely, the problem lies within the filename parser in miniltx, which doesn't parse paths. Try using the original filename parser from LaTeX:
       \def\filename@parse#1{%
     \let\filename@area\@empty
     \expandafter\filename@path#1/\\}
   \def\filename@path#1/#2\\{%
     \ifx\\#2\\%
        \def\reserved@a{\filename@simple#1.\\}%
     \else
        \edef\filename@area{\filename@area#1/}%
        \def\reserved@a{\filename@path#2\\}%
     \fi
     \reserved@a}
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Many thanks for your help, I've already sent an email to a tex-live mail list about it.
I've got one more problem. Take this simplistic script:
   unitsize(1cm);
   draw((0, 0)-(1, 1));
   label("ahoj", (0, 0));
   shipout("test");
When run by
<pre>asy -tex tex -o ../ bla.asy</pre>
it creates the following error:
<pre>
dvips: DVI file can't be opened: test_.dvi: No such file or directory
/usr/local/asymptote/base/plain_xasy.asy: 93.7: runtime: shipout failed
</pre>
It looks to me that some of temporary reside in ../ directory but some in the current one…
The problem disappears when the -o option is removed or the shipout command is not present.
Many thanks, Kašpi.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
An alternative solution might be to modify <pre>texfile::beginlayer</pre>
not to exploit \includegraphics for plainTeX (which is a bit awkward anyway). It could directly use \epsfbox for tex engine and image handling primitives for pdftex. What do you think? I believe I could provide such a patch if you wished…
Cheers, Kašpi.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
For modularity, I feell that the tex-engine dependence of includegraphics should be kept within that package and not moved into Asymptote. It's already unfortunate that we must have a special case for conTeXt; let's not allow the code to proliferate further every time some new TeX engine becomes popular.
Morover, includegraphics also appears in plain_strings.asy, so you would have to duplicate whatever code you develop there as well.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
TeX Live isn't an appropriate place to report bugs in graphicx.tex. David Carlisle lists contact details in doc/plain/plgraph/00readme.txt regarding support for this file, and miniltx.tex itself says:
> "Under no circumstances should any problems relating to this file be sent to the LaTeX bugs address, or any other LaTeX related support address. Problems can be sent to me directly (but I don't promise to fix them)."
But I'd say you'd be lucky to receive much response. (The readme also contains a note requesting maintainers for the package.)
Also, John, if you're planning on distributing that graphics.tex file, under the LPPL you should put \typeout messages telling the user that it's a derived version of the original.
Best regards,Â
Will
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks for that; sorry to be a pain about it.
I figure if we're going to have this slightly-restrictive LPPL then we should at least ensure that it's being followed in spirit (even though in this case the outcome was probably harmless).
Many thanks,
Will
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
I'm experiencing a problem with -o option. Look for instance here (the idea is to keep pdf products separate from the asy sources):
 asy -f pdf -tex pdftex -o ../pdf/ bpms.asy
which runs into troubles while TeX processing
 l.34 \includegraphics{../pdf/bpms_0.pdf}
It looks to me as a bug… The bpms.asy can be found here
 http://jkaspar.web.cern.ch/jkaspar/share/bpms.asy
Many thanks, Kašpi.
This is a bug in graphicx.tex, not in Asymptote. Here is a simpler TeX example, which produces the error
`Unknown graphics extension: ../pdf/bpms_0.pdf`. One workaround is to use a symbolic link. Or use pdflatex. Perhaps you would like to report this bug to the maintainer of graphicx:
   \input graphicx
   \input picture
   \includegraphics{../pdf/bpms_0.pdf}%
   \bye
To be more precisely, the problem lies within the filename parser in miniltx, which doesn't parse paths. Try using the original filename parser from LaTeX:
       \def\filename@parse#1{%
     \let\filename@area\@empty
     \expandafter\filename@path#1/\\}
   \def\filename@path#1/#2\\{%
     \ifx\\#2\\%
        \def\reserved@a{\filename@simple#1.\\}%
     \else
        \edef\filename@area{\filename@area#1/}%
        \def\reserved@a{\filename@path#2\\}%
     \fi
     \reserved@a}
Many thanks for your help, I've already sent an email to a tex-live mail list about it.
I've got one more problem. Take this simplistic script:
   unitsize(1cm);
   draw((0, 0)-(1, 1));
   label("ahoj", (0, 0));
   shipout("test");
When run by
<pre>asy -tex tex -o ../ bla.asy</pre>
it creates the following error:
<pre>
dvips: DVI file can't be opened: test_.dvi: No such file or directory
/usr/local/asymptote/base/plain_xasy.asy: 93.7: runtime: shipout failed
</pre>
It looks to me that some of temporary reside in ../ directory but some in the current one…
The problem disappears when the -o option is removed or the shipout command is not present.
Many thanks, Kašpi.
Thanks to phst, here is a patched version of graphicx.tex for plain TeX users: . Just put this in your TeX path (e.g. the current directory).
The other issue is likely the one previously reported
 : http://asymptote.svn.sourceforge.net/viewvc/asymptote/trunk/asymptote/patches/graphicx.tex
 : https://sourceforge.net/projects/asymptote/forums/forum/409349/topic/3354836
Thank you very much.
An alternative solution might be to modify <pre>texfile::beginlayer</pre>
not to exploit \includegraphics for plainTeX (which is a bit awkward anyway). It could directly use \epsfbox for tex engine and image handling primitives for pdftex. What do you think? I believe I could provide such a patch if you wished…
Cheers, Kašpi.
For modularity, I feell that the tex-engine dependence of includegraphics should be kept within that package and not moved into Asymptote. It's already unfortunate that we must have a special case for conTeXt; let's not allow the code to proliferate further every time some new TeX engine becomes popular.
Morover, includegraphics also appears in plain_strings.asy, so you would have to duplicate whatever code you develop there as well.
TeX Live isn't an appropriate place to report bugs in graphicx.tex. David Carlisle lists contact details in doc/plain/plgraph/00readme.txt regarding support for this file, and miniltx.tex itself says:
> "Under no circumstances should any problems relating to this file be sent to the LaTeX bugs address, or any other LaTeX related support address. Problems can be sent to me directly (but I don't promise to fix them)."
But I'd say you'd be lucky to receive much response. (The readme also contains a note requesting maintainers for the package.)
Also, John, if you're planning on distributing that graphics.tex file, under the LPPL you should put \typeout messages telling the user that it's a derived version of the original.
Best regards,Â
Will
Ok, due to licensing issues, I've removed the patched graphicx.tex from svn and merged the patch directly into Asymptote (texfile.h).
Hi John,
Thanks for that; sorry to be a pain about it.
I figure if we're going to have this slightly-restrictive LPPL then we should at least ensure that it's being followed in spirit (even though in this case the outcome was probably harmless).
Many thanks,
Will