Asymptote 套件產生不需要的邊距

Asymptote 套件產生不需要的邊距

我有以下程式碼:

\documentclass{standalone}
\usepackage{asymptote}
\begin{document}
\begin{asy}
size(100);
import graph;
path bill = Circle((0,0),100);
real phi = 70*pi/180;
draw(bill);
pair s = (-100,0), db, dt = exp(I*phi), e = s+300*dt;
path traj = s--e;
real [] c;
for(int i=0; i<8; ++i) {
c = intersect(bill, traj);
e = point(traj, c[1]);
db = dir(bill, c[0]);
draw(s--e,blue);
dt = -dt + 2*dot(dt,db)*db;
s = e;
e = s+300*dt;
traj = (s+dt)--e;
}
\end{asy}
\end{document}

輸出正常,除了圖片中出現不需要的左邊距。我怎麼刪除它?

答案1

您只需要新增varwidth到 的選項standalone

\documentclass[varwidth]{standalone}
\usepackage{asymptote}
\begin{document}
\begin{asy}
size(100);
import graph;
path bill = Circle((0,0),100);
real phi = 70*pi/180;
draw(bill);
pair s = (-100,0), db, dt = exp(I*phi), e = s+300*dt;
path traj = s--e;
real [] c;
for(int i=0; i<8; ++i) {
c = intersect(bill, traj);
e = point(traj, c[1]);
db = dir(bill, c[0]);
draw(s--e,blue);
dt = -dt + 2*dot(dt,db)*db;
s = e;
e = s+300*dt;
traj = (s+dt)--e;
}
\end{asy}
\end{document}

在此輸入影像描述

相關內容