diff options
author | Karl Berry <karl@freefriends.org> | 2015-05-20 17:51:10 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2015-05-20 17:51:10 +0000 |
commit | aeecf951b2d292ab5afce830bc1b85bf7ea22e0b (patch) | |
tree | 950d0bcf124ac371f95d0225337fcf71e3dba991 /Build/source/utils/asymptote/runlabel.in | |
parent | 11b7caf0b63d1af64dbff00b40f521432d26adc8 (diff) |
asy 2.35 sources
git-svn-id: svn://tug.org/texlive/trunk@37458 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/utils/asymptote/runlabel.in')
-rw-r--r-- | Build/source/utils/asymptote/runlabel.in | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/Build/source/utils/asymptote/runlabel.in b/Build/source/utils/asymptote/runlabel.in index b4595741251..3b1d5f360cc 100644 --- a/Build/source/utils/asymptote/runlabel.in +++ b/Build/source/utils/asymptote/runlabel.in @@ -259,7 +259,7 @@ patharray2 *_texpath(stringarray *s, penarray *p) string dviname=auxname(prefix,"dvi"); bbox b; string texengine=getSetting<string>("tex"); - bool xe=settings::xe(texengine); + bool xe=settings::xe(texengine) || settings::context(texengine); texfile tex(texname,b,true); tex.miniprologue(); @@ -293,6 +293,8 @@ patharray2 *_texpath(stringarray *s, penarray *p) int status=opentex(texname,prefix,!xe); string pdfname,pdfname2,psname2; + bool keep=getSetting<bool>("keep"); + if(!status) { if(xe) { pdfname=auxname(prefix,"pdf"); @@ -324,12 +326,20 @@ patharray2 *_texpath(stringarray *s, penarray *p) cmd.push_back("-dBATCH"); if(safe) cmd.push_back("-dSAFER"); cmd.push_back("-sDEVICE=eps2write"); - cmd.push_back("-sOutputFile="+psname2); + // Work around eps2write bug that forces all postscript to first page. + cmd.push_back("-sOutputFile="+psname2+"%d"); cmd.push_back(pdfname2); status=System(cmd,0,true,"gs"); - std::ifstream in(psname2.c_str(),std::ios::binary); - ps << in.rdbuf(); + for(unsigned int i=1; i <= n ; ++i) { + ostringstream buf; + buf << psname2.c_str() << i; + const char *name=buf.str().c_str(); + std::ifstream in(name,std::ios::binary); + ps << in.rdbuf(); + ps << "(>\n) print flush\n"; + if(!keep) unlink(name); + } ps.close(); } } else { @@ -350,7 +360,6 @@ patharray2 *_texpath(stringarray *s, penarray *p) if(status != 0) error("texpath failed"); - bool keep=getSetting<bool>("keep"); if(!keep) { // Delete temporary files. unlink(texname.c_str()); if(!getSetting<bool>("keepaux")) @@ -359,12 +368,12 @@ patharray2 *_texpath(stringarray *s, penarray *p) if(xe) { unlink(pdfname.c_str()); unlink(pdfname2.c_str()); - unlink(psname2.c_str()); } else unlink(dviname.c_str()); if(settings::context(texengine)) { unlink(auxname(prefix,"top").c_str()); unlink(auxname(prefix,"tua").c_str()); + unlink(auxname(prefix,"tuc").c_str()); unlink(auxname(prefix,"tui").c_str()); } } |