答案1
这采用了双极子的代码oscope
,从中移除了圆角、网格和图形,而是添加了大十字。
\documentclass{standalone}
\usepackage{circuitikz}
\makeatletter
\pgfcircdeclarebipolescaled{instruments}
{
% put the node text above and centered
\anchor{text}{\pgfextracty{\pgf@circ@res@up}{\northeast}
\pgfpoint{-.5\wd\pgfnodeparttextbox}{
\dimexpr.5\dp\pgfnodeparttextbox+.5\ht\pgfnodeparttextbox+\pgf@circ@res@up\relax
}
}
}
{\ctikzvalof{bipoles/oscope/height}}
{josephson}
{\ctikzvalof{bipoles/oscope/height}}
{\ctikzvalof{bipoles/oscope/width}}
{
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
\pgfextracty{\pgf@circ@res@up}{\northeast}
\pgfextractx{\pgf@circ@res@right}{\northeast}
\pgfextractx{\pgf@circ@res@left}{\southwest}
\pgfextracty{\pgf@circ@res@down}{\southwest}
\pgfmathsetlength{\pgf@circ@res@step}{0.25*\pgf@circ@res@up}
\pgfscope
\pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
\pgf@circ@draworfill
\endpgfscope
\pgfscope
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}%
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}%
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}%
\pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}%
\pgfusepath{draw}
\endpgfscope
}
\def\pgf@circ@josephson@path#1{\pgf@circ@bipole@path{josephson}{#1}}
\tikzset{josephson/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@josephson@path, l=#1}}
\begin{document}
\begin{circuitikz}
\draw (0,0) to[josephson] (3,0);
\draw (1,1) to[josephson] (2,4);
\end{circuitikz}
\end{document}