Zeichnen Sie ein spezielles Element (Linie mit einem Kreuz in der Mitte) in circuitikz

Zeichnen Sie ein spezielles Element (Linie mit einem Kreuz in der Mitte) in circuitikz

Ich muss einen Draht zeichnen, der aussieht wie

Bildbeschreibung hier eingeben

Das ist das Symbol, das mein Dozent für den Josephson-Kontakt verwendet. Ich habe ein bisschen gegoogelt und es scheint das allgemein gebräuchliche Symbol für ein solches Element zu sein. Es wäre also nützlich, eine Möglichkeit zu haben, es in circuitikz zu implementieren.

Ich verwende pgfplotssowohl als auch tikzexternalize, was mich zwingt, die Circuitikz-Umgebungen mit zu starten \begin{tikzpicture}, falls das einen Unterschied macht.


EDIT (wie im Kommentar gefordert): Ich möchte das Element zwischenAUndDin folgender Schaltung:

\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}

Der Code erzeugt in meinem Dokument Folgendes: Bildbeschreibung hier eingeben

Antwort1

Verwendung eines nativen circuitikzSymbols namens barrier:

Bildbeschreibung hier eingeben

\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}

Antwort2

Sie können Ihre eigene Komponente erstellen. Hier ist ein Beispiel. Möglicherweise sind jedoch einige Anpassungen erforderlich:

Bildbeschreibung hier eingeben

Sie können die Breite und Höhe wie folgt anpassen:

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

... und die Linienbreite mit:

\pgfsetlinewidth{3\pgfstartlinewidth}

Der Code:

\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}

verwandte Informationen