summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/asymptote/plain.asy
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/asymptote/plain.asy')
-rw-r--r--Master/texmf-dist/asymptote/plain.asy22
1 files changed, 19 insertions, 3 deletions
diff --git a/Master/texmf-dist/asymptote/plain.asy b/Master/texmf-dist/asymptote/plain.asy
index c86cca630a6..2d4c419ae00 100644
--- a/Master/texmf-dist/asymptote/plain.asy
+++ b/Master/texmf-dist/asymptote/plain.asy
@@ -281,6 +281,22 @@ if(settings.autoimport != "") {
cputime();
-texpreamble("\ifx\pdfpagewidth\undefined\let\pdfpagewidth\paperwidth\else\let\paperwidth\pdfpagewidth\fi");
-texpreamble("\ifx\pdfpageheight\undefined\let\pdfpageheight\paperheight\else\let\paperheight\pdfpageheight\fi");
-if(settings.tex == "luatex") texpreamble("\input luatex85.sty");
+void nosetpagesize() {
+ if(latex() && pdf()) {
+ // Portably pass nosetpagesize option to graphicx package.
+ texpreamble("\makeatletter\newif\ifGin@setpagesize");
+ if(settings.tex == "pdflatex")
+ texpreamble("\input pdftex.def");
+ else if(settings.tex == "xelatex")
+ texpreamble("\input xetex.def");
+ else if(settings.tex == "lualatex") {
+ texpreamble("\ifx\pdfpagewidth\undefined\let\pdfpagewidth\paperwidth\fi");
+ texpreamble("\ifx\pdfpageheight\undefined\let\pdfpageheight\paperheight\fi");
+ }
+ }
+}
+
+nosetpagesize();
+
+if(settings.tex == "luatex")
+ texpreamble("\input luatex85.sty");