From 60b942cf4d468afdd4f89723f3c9575573bede0b Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sat, 12 Nov 2016 23:00:13 +0000 Subject: pagesize compatibility, https://github.com/vectorgraphics/asymptote/issues/24 git-svn-id: svn://tug.org/texlive/trunk@42496 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/asymptote/plain.asy | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'Master/texmf-dist/asymptote') 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"); -- cgit v1.2.3