2

I used xelatex and the asymptote package for the asy pictures inside the tex file, which both worked just fine. But when I install the Miktex and asymptote on my new computer (the OS is the same as the old one), I find the asy picture would turn out to be on a full size of A4paper instead of a small picture which just contain its content as it should be whenever I put a label in that asy picture.

What can I do to fix this? Many thanks.

5
  • 2
    probably this issue: github.com/vectorgraphics/asymptote/issues/… Aug 6, 2016 at 14:20
  • 2
    if it is the above add texpreamble("\usepackage[nosetpagesize]{color,graphicx}"); to your .asy file. Aug 6, 2016 at 14:32
  • 2
    At least for now and assuming you are using the latest versions of graphcix: If you don't have an asydef environment in your source document add \begin{asydef} texpreamble("\usepackage[nosetpagesize]{color,graphicx}"); \end{asydef} to your source document after the \begin{document} command. If you already are using that environment in your document add the line suggested by David Carlisle to that environment. Aug 6, 2016 at 15:34
  • @HerbSchulz can you answer (I don't really know asymptote syntax) Aug 6, 2016 at 22:21
  • Thank you all for the help! texpreamble("\usepackage[nosetpagesize]{color,graphicx}"); really works! Aug 10, 2016 at 23:47

1 Answer 1

2

At least for now and assuming you are using the latest versions of the graphicx package: Place an asydef environment just after the \begin{document} environment starts in your source document that looks like this:

\begin{asydef}
texpreamble("\usepackage[nosetpagesize]{color,graphicx}"); 
\end{asydef}

If you already are using that environment in your document add the line shown to the environment. All of your asymptote figures will be properly cropped.

At some point this will all go away and you can remove that line/environment.

NOTE: As of an update to the asymptote package on or around (the CTAN repositories take a shile to synchronize) 2016/08/28 the problem has been fixed and you should no longer need this temporary fix.

2
  • This completely solved my problem, many thanks! Aug 10, 2016 at 23:46
  • PLEASE SEE THE NOTE: IN THE ANSWER ABOVE. Aug 28, 2016 at 12:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .