From c59fe5fe4739f0c61560f05d4e42b4e552219b27 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sat, 28 May 2011 02:18:52 +0000 Subject: asy 2.10 git-svn-id: svn://tug.org/texlive/trunk@22633 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/utils/asymptote/base/plain_strings.asy | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'Build/source/utils/asymptote/base/plain_strings.asy') diff --git a/Build/source/utils/asymptote/base/plain_strings.asy b/Build/source/utils/asymptote/base/plain_strings.asy index 138ab05ca05..98f72f460aa 100644 --- a/Build/source/utils/asymptote/base/plain_strings.asy +++ b/Build/source/utils/asymptote/base/plain_strings.asy @@ -155,16 +155,24 @@ private void notimplemented(string text) abort(text+" is not implemented for the '"+settings.tex+"' TeX engine"); } +string jobname(string name) +{ + int pos=rfind(name,"-"); + return pos >= 0 ? "\ASYprefix\jobname"+substr(name,pos) : name; +} + string graphic(string name, string options="") { if(latex()) { if(options != "") options="["+options+"]"; - if(find(name," ") < 0) - return "\includegraphics"+options+"{"+name+"}"; - else { - return "\includegraphics"+options+ - (pdf() ? "{\""+stripextension(name)+"\".pdf}" : "{\""+name+"\"}"); - } + bool pdf=pdf(); + string includegraphics="\includegraphics"+options; + if(settings.inlinetex) + return includegraphics+"{"+jobname(name)+"}"; + else + return includegraphics+ + (find(name," ") < 0 ? "{"+name+"}" : + (pdf ? "{\""+stripextension(name)+"\".pdf}" : "{\""+name+"\"}")); } if(settings.tex != "context") notimplemented("graphic"); -- cgit v1.2.3