tabulartikzsubcaption

trying to add subcaption or subfloat with circuitikz or tabular but could not succeed


I've been trying to add subcaption under the circuit drawing but could not succeed yet. I do not know how to add \subcaption or \subfloat. I only know how to do that with images but not with \circuitikz or \tabular

\documentclass[10pt,letterpaper,twocolumn,aps,pra, superscriptaddress,longbibliography]{revtex4-2}

\usepackage{xcolor}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{braket}
\usepackage{circuitikz}
\usepackage{tikz}
\usetikzlibrary{quantikz}
\usepackage[export]{adjustbox}
\usepackage{subcaption,graphicx}
\captionsetup{
  subrefformat=parens
}

\begin{document}

\begin{figure}[h]
\centering
\begin{circuitikz}[american,baseline=(current bounding box.center) ]
\draw 
(0,1) to [short, -*](0,1)
to [inductor](0,-1)
to [short, -*](0,-1);
\end{circuitikz}
\subcaptionbox{}[.4\linewidth][c]
\hfil  
\subcaptionbox{}[.4\linewidth][c]{
    \includegraphics[width=\linewidth]{Array-Falsecolour}}
\caption{The kinetic inductor a) A circuit diagram of an inductor. b) A fabricated JJ array with Manhattan-style.}
\label{array}
\end{figure}

\end{document}

enter image description here

My expectation is to have the subcaption 'a' under the inductor element, not in the middle of the whole figure.


Solution

  • You can use the circuitikz the same way you use \includegraphics inside the \subcaptionbox:

    \documentclass[10pt,letterpaper,twocolumn,aps,pra, superscriptaddress,longbibliography]{revtex4-2}
    
    \usepackage{xcolor}
    \usepackage{amsmath}
    \usepackage{amssymb}
    \usepackage{braket}
    \usepackage{circuitikz}
    \usepackage{tikz}
    \usetikzlibrary{quantikz}
    \usepackage[export]{adjustbox}
    \usepackage{subcaption,graphicx}
    \captionsetup{
      subrefformat=parens
    }
    
    \begin{document}
    
    \begin{figure}[h]
    \centering
    \subcaptionbox{}[.4\linewidth][c]{%
    \begin{circuitikz}[american,baseline=(current bounding box.center) ]
    \draw 
    (0,1) to [short, -*](0,1)
    to [inductor](0,-1)
    to [short, -*](0,-1);
    \end{circuitikz}%
    }
    \hfil  
    \subcaptionbox{}[.4\linewidth][c]{%
        \includegraphics[width=\linewidth]{example-image-duck}%
    }
    \caption{The kinetic inductor a) A circuit diagram of an inductor. b) A fabricated JJ array with Manhattan-style.}
    \label{array}
    \end{figure}
    
    \end{document}
    

    enter image description here