Нарисуйте специальный элемент (линию с крестиком посередине) в circuitikz

Нарисуйте специальный элемент (линию с крестиком посередине) в circuitikz

Мне нужно нарисовать провод, который выглядит так

введите описание изображения здесь

Это символ, который мой лектор использует для перехода Джозефсона. Я немного погуглил, и, похоже, это общепринятый символ для такого элемента, поэтому было бы полезно иметь способ реализовать его в circuitikz.

Я использую pgfplotsтакже tikzexternalize, что заставляет меня запускать среду circuitikz с \begin{tikzpicture}, если это имеет какое-либо значение.


EDIT (как просили в комментарии): Я хотел бы использовать элемент междуаигв следующей схеме:

\begin{figure}[ht]
  \centering
\begin{tikzpicture}
      \draw (0,0)
        node[label={[font=\footnotesize]above:a}] {}
      to[short,*-*] (1.732,1)
        node[label={[font=\footnotesize]above:d}] {};
      \draw (0,0)
      to[C=$C$,*-*] (-1.732,1)
        node[label={[font=\footnotesize]above:b}] {};
      \draw (0,0)
      to[L=$L$,*-*] (0,-2)
        node[label={[font=\footnotesize]east:c}] {};
\end{tikzpicture}
    \caption{Explaining conventions}
\end{figure}

Код выводит в моем документе следующее: введите описание изображения здесь

решение1

Используя собственный circuitikzсимвол, известный как barrier:

введите описание изображения здесь

\documentclass{article}
\usepackage{circuitikz}
\begin{document}

\begin{figure}[ht]
  \centering
\begin{tikzpicture}
      \draw (0,0)
        node[label={[font=\footnotesize]above:a}] {}
      to[barrier,*-*] (1.732,1)
        node[label={[font=\footnotesize]above:d}] {};
      \draw (0,0)
      to[C=$C$,*-*] (-1.732,1)
        node[label={[font=\footnotesize]above:b}] {};
      \draw (0,0)
      to[L=$L$,*-*] (0,-2)
        node[label={[font=\footnotesize]east:c}] {};
\end{tikzpicture}
    \caption{Explaining conventions}
\end{figure}

\end{document}

решение2

Вы можете создать свой собственный компонент, вот пример, хотя его, возможно, придется немного доработать:

введите описание изображения здесь

Вы можете настроить ширину и высоту с помощью:

\ctikzset{bipoles/josephsonjunction/height/.initial=.30}   % box height
\ctikzset{bipoles/josephsonjunction/width/.initial=.30}    % box width

... и ширину линии с помощью:

\pgfsetlinewidth{3\pgfstartlinewidth}

Код:

\documentclass[tikz,border=10pt]{standalone}
\usepackage{tikz}
\usepackage{circuitikz}

\makeatletter
% used to process styles for to-path
\def\TikzBipolePath#1#2{\pgf@circ@bipole@path{#1}{#2}}
% restore size value for bipole definitions
\pgf@circ@Rlen = \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
\makeatother
\newlength{\ResUp}
\newlength{\ResDown}
\newlength{\ResLeft}
\newlength{\ResRight}

%  josephsonjunction
\ctikzset{bipoles/josephsonjunction/height/.initial=.30}   % box height
\ctikzset{bipoles/josephsonjunction/width/.initial=.30}    % box width
\pgfcircdeclarebipole{}                                    % no extra anchors
{\ctikzvalof{bipoles/josephsonjunction/height}}
{josephsonjunction}                                        % component name
{\ctikzvalof{bipoles/josephsonjunction/height}}
{\ctikzvalof{bipoles/josephsonjunction/width}}
{                                                          % component symbol drawing...
  \pgfextracty{\ResUp}{\northeast}                         % coordinates
  \pgfextracty{\ResDown}{\southwest}
  \pgfextractx{\ResLeft}{\southwest}
  \pgfextractx{\ResRight}{\northeast}
  \pgfsetlinewidth{3\pgfstartlinewidth}
  \pgfmoveto{\pgfpoint{\ResLeft}{\ResDown}}
  \pgflineto{\pgfpoint{\ResRight}{\ResUp}}
  \pgfmoveto{\pgfpoint{\ResRight}{\ResDown}}
  \pgflineto{\pgfpoint{\ResLeft}{\ResUp}}
  \pgfusepath{draw}
  \pgfsetlinewidth{\pgfstartlinewidth}
  \pgfmoveto{\pgfpoint{\ResLeft}{0}}
  \pgflineto{\pgfpoint{\ResRight}{0}}
  \pgfusepath{draw}
}
\def\circlepath#1{\TikzBipolePath{josephsonjunction}{#1}}
\tikzset{josephsonjunction/.style = {\circuitikzbasekey, /tikz/to path=\circlepath, l=#1}}

\begin{document}
\begin{tikzpicture}
  \draw (0,0)
    node[label={[font=\footnotesize]above:a}] {}
    to[josephsonjunction,*-*] (1.732,1) % using the josephsonjunction
    node[label={[font=\footnotesize]above:d}] {};
  \draw (0,0)
    to[C=$C$,*-*] (-1.732,1)
    node[label={[font=\footnotesize]above:b}] {};
  \draw (0,0)
    to[L=$L$,*-*] (0,-2)
    node[label={[font=\footnotesize]east:c}] {};
\end{tikzpicture}
\end{document}

Связанный контент