Here are three solutions.
1) If you necessarily need every path/.style
, choose this excellent answer from Matthew Leingang (but the TeX group around \clip
prevents the propagation of the bounding box):
\documentclass{article}
\usepackage{tikz}
\tikzset{every path/.style={draw=blue,line width=2pt}}
\begin{document}
\begin{tikzpicture}
{
\tikzset{every path/.style={}}
\clip (2,0) circle (2cm);
}
\draw (0,0) circle (3cm);
\end{tikzpicture}
\end{document}
2) Most of the time, you can avoid to use every path/.style
. Here, you can use every picture/.style
instead of every path/.style
:
\documentclass{article}
\usepackage{tikz}
\tikzset{every picture/.style={line width=2pt}}
\begin{document}
\begin{tikzpicture}
\clip (2,0) circle (2cm);
\draw (0,0) circle (3cm);
\end{tikzpicture}
\end{document}
3) The third solution redefines the clip
option :
\documentclass{article}
\usepackage{tikz}
\makeatletter
\tikzset{clip/.code={%
\let\tikz@mode=\pgfutil@empty%
\let\tikz@preactions=\pgfutil@empty%
\let\tikz@postactions=\pgfutil@empty%
\let\tikz@options=\pgfutil@empty%
\tikz@addmode{\tikz@mode@cliptrue}%
},
}
\makeatother
\tikzset{every path/.style={line width=2pt}}
\begin{document}
\begin{tikzpicture}
\clip (2,0) circle (2cm);
\draw (0,0) circle (3cm);
\end{tikzpicture}
\end{document}