summaryrefslogtreecommitdiff
path: root/graphics/asymptote/texfile.h
diff options
context:
space:
mode:
Diffstat (limited to 'graphics/asymptote/texfile.h')
-rw-r--r--graphics/asymptote/texfile.h31
1 files changed, 12 insertions, 19 deletions
diff --git a/graphics/asymptote/texfile.h b/graphics/asymptote/texfile.h
index bc0f2e1611..cc9ffd8285 100644
--- a/graphics/asymptote/texfile.h
+++ b/graphics/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;