diff options
author | Karl Berry <karl@freefriends.org> | 2020-01-16 18:10:31 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2020-01-16 18:10:31 +0000 |
commit | 4891c2339425a6cee4c793d84059bd6340706296 (patch) | |
tree | ec7ac8764428600dca2f4ab0332c8c054c7d23ad /Build/source/utils/asymptote/texfile.h | |
parent | 60d3e46519371f71184451d5498aa7c7fcc92169 (diff) |
asy 2.62 sources
git-svn-id: svn://tug.org/texlive/trunk@53421 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/utils/asymptote/texfile.h')
-rw-r--r-- | Build/source/utils/asymptote/texfile.h | 31 |
1 files changed, 12 insertions, 19 deletions
diff --git a/Build/source/utils/asymptote/texfile.h b/Build/source/utils/asymptote/texfile.h index bc0f2e1611a..cc9ffd82855 100644 --- a/Build/source/utils/asymptote/texfile.h +++ b/Build/source/utils/asymptote/texfile.h @@ -36,11 +36,14 @@ void texdocumentclass(T& out, bool pipe=false) template<class T> void texuserpreamble(T& out, - mem::list<string>& preamble=processData().TeXpreamble) + mem::list<string>& preamble=processData().TeXpreamble, + bool pipe=false) { - for(mem::list<string>::iterator p=preamble.begin(); - p != preamble.end(); ++p) + for(mem::list<string>::iterator p=preamble.begin(); p != preamble.end(); + ++p) { out << stripblanklines(*p); + if(pipe) out << newl << newl; + } } template<class T> @@ -56,9 +59,9 @@ void latexfontencoding(T& out) template<class T> void texpreamble(T& out, mem::list<string>& preamble=processData().TeXpreamble, - bool ASYalign=true, bool ASYbox=true) + bool pipe=false, bool ASYbox=true) { - texuserpreamble(out,preamble); + texuserpreamble(out,preamble,pipe); string texengine=settings::getSetting<string>("tex"); if(settings::context(texengine)) out << "\\disabledirectives[system.errorcontext]%" << newl; @@ -69,7 +72,7 @@ void texpreamble(T& out, mem::list<string>& preamble=processData().TeXpreamble, << "\\long\\def\\ASYbase#1#2{\\leavevmode\\setbox\\ASYbox=\\hbox{#1}%" << "\\ASYdimen=\\ht\\ASYbox%" << newl << "\\setbox\\ASYbox=\\hbox{#2}\\lower\\ASYdimen\\box\\ASYbox}" << newl; - if(ASYalign) + if(!pipe) out << "\\long\\def\\ASYaligned(#1,#2)(#3,#4)#5#6#7{\\leavevmode%" << newl << "\\setbox\\ASYbox=\\hbox{#7}%" << newl << "\\setbox\\ASYbox\\hbox{\\ASYdimen=\\ht\\ASYbox%" << newl @@ -121,7 +124,7 @@ void texdefines(T& out, mem::list<string>& preamble=processData().TeXpreamble, bool pipe=false) { if(pipe || !settings::getSetting<bool>("inlinetex")) - texpreamble(out,preamble,!pipe); + texpreamble(out,preamble,pipe); if(pipe) { // Make tex pipe aware of a previously generated aux file. @@ -137,17 +140,7 @@ void texdefines(T& out, mem::list<string>& preamble=processData().TeXpreamble, string texengine=settings::getSetting<string>("tex"); if(settings::latex(texengine)) { if(pipe || !settings::getSetting<bool>("inlinetex")) { - out << "\\usepackage{graphicx}" << newl - << "\\usepackage[space]{grffile}" << newl; - if(settings::xe(texengine)) { - out << "\\makeatletter" << newl - << "\\def\\Gread@@xetex#1{%" << newl - << "\\IfFileExists{\"\\Gin@base\".bb}%" << newl - << "{\\Gread@eps{\\Gin@base.bb}}%" << newl - << "{\\Gread@@xetex@aux#1}%" << newl - << "}" << newl - << "\\makeatother" << newl; - } + out << "\\usepackage{graphicx}" << newl; if(!pipe) { dvipsfix(out); out << "\\usepackage{color}" << newl; @@ -184,7 +177,7 @@ bool setlatexfont(T& out, const pen& p, const pen& lastpen) { if(p.size() != lastpen.size() || p.Lineskip() != lastpen.Lineskip()) { out << "\\fontsize{" << p.size()*settings::ps2tex << "}{" - << p.Lineskip()*settings::ps2tex << "}\\selectfont\n"; + << p.Lineskip()*settings::ps2tex << "}\\selectfont%" << newl; return true; } return false; |