Circuitikzで特別な要素(真ん中に十字がある線)を描く

Circuitikzで特別な要素(真ん中に十字がある線)を描く

次のようなワイヤーを描く必要があります

ここに画像の説明を入力してください

これは私の講師がジョセフソン接合に使用する記号です。少しグーグルで調べたところ、このような要素によく使用される記号のようです。そのため、circuitikz でこれを実装する方法があると便利です。

pgfplotsは だけでなく も使用しますtikzexternalize。これにより、circuitikz 環境を で開始することが強制されます\begin{tikzpicture}が、それが何か違いをもたらすかどうかはわかりません。


編集(コメントでリクエストされたとおり):私は次の要素を使用したいと思います1つのそしてd次の回路では:

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

関連情報