![Asymptote 套件產生不需要的邊距](https://rvso.com/image/391782/Asymptote%20%E5%A5%97%E4%BB%B6%E7%94%A2%E7%94%9F%E4%B8%8D%E9%9C%80%E8%A6%81%E7%9A%84%E9%82%8A%E8%B7%9D.png)
我有以下程式碼:
\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}