diff options
author | Karl Berry <karl@freefriends.org> | 2009-05-28 23:56:03 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2009-05-28 23:56:03 +0000 |
commit | e767448d0591f5dbb0cd485e4b014becdcbd1ba4 (patch) | |
tree | 83bec5bd1ee117130f3e9dcee985dcd42f5145d9 /Build/source/utils/asymptote/picture.cc | |
parent | 20751a51df382b884807d8b9ef1ff7f7cc7739a5 (diff) |
asymptote 1.74
git-svn-id: svn://tug.org/texlive/trunk@13514 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/utils/asymptote/picture.cc')
-rw-r--r-- | Build/source/utils/asymptote/picture.cc | 38 |
1 files changed, 32 insertions, 6 deletions
diff --git a/Build/source/utils/asymptote/picture.cc b/Build/source/utils/asymptote/picture.cc index 26023157229..7b41fd7b530 100644 --- a/Build/source/utils/asymptote/picture.cc +++ b/Build/source/utils/asymptote/picture.cc @@ -24,8 +24,15 @@ texstream::~texstream() { unlink((name+"aux").c_str()); unlink((name+"log").c_str()); unlink((name+"out").c_str()); - if(settings::pdf(getSetting<string>("tex"))) + string texengine=getSetting<string>("tex"); + if(settings::pdf(texengine)) unlink((name+"pdf").c_str()); + if(settings::context(texengine)) { + unlink((name+"tex").c_str()); + unlink((name+"top").c_str()); + unlink((name+"tua").c_str()); + unlink((name+"tui").c_str()); + } } namespace camp { @@ -216,7 +223,16 @@ void picture::texinit() unlink(cname); ostringstream cmd; - cmd << texprogram() << " \\scrollmode"; + bool context=settings::context(getSetting<string>("tex")); + if(context) { + // Create a null texput.tex file as a portable way of tricking context + // to enter interactive mode (pending the implementation of --pipe). + string texput=stripFile(outname())+"texput.tex"; + ofstream(texput.c_str()); + cmd << texprogram() << " --scrollmode --purgeall " << texput; + } else + cmd << texprogram() << " \\scrollmode"; + pd.tex.open(cmd.str().c_str(),"texpath",texpathmessage()); pd.tex.wait("\n*"); pd.tex << "\n"; @@ -239,15 +255,18 @@ bool picture::texprocess(const string& texname, const string& outname, unlink(aux.c_str()); string program=texprogram(); ostringstream cmd; - cmd << program << " \\nonstopmode\\input '" << texname << "'"; + bool context=settings::context(getSetting<string>("tex")); + cmd << program << (context ? " --nonstopmode --purgeall '" : + " \\nonstopmode\\input '") << texname << "'"; bool quiet=verbose <= 1; - status=System(cmd,quiet ? 1 : 0,"texpath",texpathmessage()); + status=System(cmd,quiet ? 1 : 0,true,"texpath",texpathmessage()); if(!status && getSetting<bool>("twice")) - status=System(cmd,quiet ? 1 : 0,"texpath",texpathmessage()); + status=System(cmd,quiet ? 1 : 0,true,"texpath",texpathmessage()); if(status) { if(quiet) { ostringstream cmd; - cmd << program << " \\scrollmode\\input '" << texname << "'"; + cmd << program << (context ? " --scrollmode --purgeall '" : + " \\scrollmode\\input '") << texname << "'"; System(cmd,0); } return false; @@ -326,6 +345,13 @@ bool picture::texprocess(const string& texname, const string& outname, unlink(aux.c_str()); unlink(auxname(prefix,"log").c_str()); unlink(auxname(prefix,"out").c_str()); + if(context) { + unlink(auxname(prefix,"top").c_str()); + unlink(auxname(prefix,"tua").c_str()); + unlink(auxname(prefix,"tuc").c_str()); + unlink(auxname(prefix,"tui").c_str()); + unlink(auxname(prefix,"tuo").c_str()); + } } if(status == 0) return true; } |