我有两个相交圆的代码:
\begin{tikzpicture}
\draw (0,0) circle (1cm);
\draw (2,-2) circle (2cm);
\end{tikzpicture}
输出如下内容:
我想放大交叉区域,但又不想编写新的代码块。我可以使用arc
s 来实现:
\begin{tikzpicture}
\tikzstyle{intersection} = [draw, circle ,fill=darkgray, inner sep=0.3mm]
\draw (0,0) arc (-90:70:1cm);
\draw (2,1.5) arc (100:200:2cm);
\end{tikzpicture}
输出如下内容:
这很像我想要的。但如果我一遍又一遍地这样做,就会非常不方便。那么,有没有更简单的方法来重复使用裁剪的部分tikzpicture
?
答案1
\documentclass[tikz, margin=3mm]{standalone}
\begin{document}
\begin{tikzpicture}
\clip (0,0) rectangle + (1.2,-1.2); % <added, size of rectangle is estimated
% from circles radius and distances between
% centers of circles
\draw (0,0) circle (1cm);
\draw (2,-2) circle (2cm);
\end{tikzpicture}
\end{document}