尝试同时添加图像、绘图和电路,但出错了

尝试同时添加图像、绘图和电路,但出错了

在这里,我尝试绘制一个电路,并绘制一张各层看起来的样子的图像,还添加了一个元素的图像,但它们看起来很丑。它们彼此太近了,不在同一水平。

  1. 想要彼此保持距离并使其平衡。
  2. 将它们重命名为“a”、“b”和“c”
  3. 给第二幅图上色,并将图层放入框内。我只能在它们之间画线,并尝试了“\vline”,但它没有按我想要的方式工作。在此处输入图片描述

而且我认为我的包裹也弄乱了,我尝试了着色,但包裹彼此不喜欢 :( 请帮忙!

\documentclass[10pt,letterpaper,twocolumn,aps,pra, superscriptaddress,longbibliography]{revtex4-1}
\pdfoutput=1
%\usepackage[utf8x]{inputenc}

\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{bm}
\usepackage{braket}
\usepackage{cellspace,booktabs}
\usepackage{circuitikz}
\usepackage{hyperref}
\usepackage[capitalise]{cleveref} % has to be after hyperref !
\usepackage{layouts}
\usepackage{makeidx}
\usepackage{microtype}
\usepackage{natbib}
\usepackage{physics}
%\usepackage{stfloats} % for positioning of figure* on the same page
\usepackage{subcaption,graphicx}
\captionsetup{
  subrefformat=parens
}
%\usepackage{graphicx} % http://ctan.org/pkg/graphicx
\usepackage{multirow}
\usepackage{rotating}
\usepackage{ucs}
\usepackage{url}
\usepackage{xcolor}

\usepackage[noindentafter]{titlesec}
\usepackage{lipsum}


\begin{figure}[h]
\begin{center}
\begin{circuitikz}[american]
 \draw 
(0,0)to [barrier](0,1)
(0,1) to [short, -*](0,0)
(0,1) to [short, -*](0,1);
\end{circuitikz}

\begin{tabular}{c} % <-- Alignments: 1st column left, 2nd middle and 3rd right, with vertical lines in between
     \hline
      Al\\
      \hline
      AlOx\\
      \hline
      Al\\
      \hline
\end{tabular}

    \centering % Horizontally center the figure
    \includegraphics[width=0.15\textwidth]{JJCrosssectionFalsecolours} % Include the figure
\caption{a) circuit ... b) A fabr ...}
\label{JJcircuit}
\end{center}
\end{figure}

答案1

正如我的评论所述:

MikTeX 仅提供 revtex4-2。我还根据一般原则删除了 MWE 中未使用的所有软件包(最常见的问题根源是加载了太多软件包)。

\documentclass[10pt,letterpaper,twocolumn,aps,pra, superscriptaddress,longbibliography]{revtex4-2}
%\pdfoutput=1
%\usepackage[utf8x]{inputenc}
\usepackage{xcolor}
%\usepackage{amsmath}
%\usepackage{amsfonts}
%\usepackage{amssymb}
%\usepackage{amsthm}
%\usepackage{bm}
%\usepackage{braket}
%\usepackage{cellspace,booktabs}
\usepackage{circuitikz}
%\usepackage{layouts}
%\usepackage{makeidx}
%\usepackage{microtype}
%\usepackage{natbib}
%\usepackage{physics}
%\usepackage{stfloats} % for positioning of figure* on the same page
\usepackage[export]{adjustbox}
\usepackage{subcaption,graphicx}
\captionsetup{
  subrefformat=parens
}
%\usepackage{multirow}
%\usepackage{rotating}
%\usepackage{ucs}
%\usepackage{url}


%\usepackage[noindentafter]{titlesec}
%\usepackage{hyperref}
%\usepackage[capitalise]{cleveref} % has to be after hyperref !
%\usepackage{lipsum}

\begin{document}

\begin{figure}[h]
\centering
\begin{circuitikz}[american,baseline=(current bounding box.center)]
 \draw 
(0,0)to [barrier](0,1)
(0,1) to [short, -*](0,0)
(0,1) to [short, -*](0,1);
\end{circuitikz}
\hfil
\raisebox{\dimexpr 0.5\depth-0.5\height}{% align geometric center
\begin{tabular}{c} % <-- Alignments: 1st column left, 2nd middle and 3rd right, with vertical lines in between
     \hline
      Al\\
      \hline
      AlOx\\
      \hline
      Al\\
      \hline
\end{tabular}
}
\hfil
    \includegraphics[width=0.15\textwidth, valign=c]{example-image}%{JJCrosssectionFalsecolours} % Include the figure
%\llap{\textcolor{red}{\rule{\columnwidth}{.4pt}}}% show baseline

\caption{a) circuit ... b) A fabr ...}
\label{JJcircuit}

\end{figure}
\end{document}

演示


这使用表格来对齐中心子标题。\tabcolsep这里使用了 6 个;每列之间两个,每端各一个。

\documentclass[10pt,letterpaper,twocolumn,aps,pra,
  superscriptaddress,longbibliography]{revtex4-2}
%\pdfoutput=1
%\usepackage[utf8x]{inputenc}
\usepackage{xcolor}
%\usepackage{amsmath}
%\usepackage{amsfonts}
%\usepackage{amssymb}
%\usepackage{amsthm}
%\usepackage{bm}
%\usepackage{braket}
%\usepackage{cellspace,booktabs}
\usepackage{circuitikz}
%\usepackage{layouts}
%\usepackage{makeidx}
%\usepackage{microtype}
%\usepackage{natbib}
%\usepackage{physics}
%\usepackage{stfloats} % for positioning of figure* on the same page
\usepackage[export]{adjustbox}
\usepackage{subcaption,graphicx}
\captionsetup{
  subrefformat=parens
}
%\usepackage{multirow}
%\usepackage{rotating}
%\usepackage{ucs}
%\usepackage{url}


%\usepackage[noindentafter]{titlesec}
%\usepackage{hyperref}
%\usepackage[capitalise]{cleveref} % has to be after hyperref !
%\usepackage{lipsum}

\begin{document}

\begin{figure}[h]
\sbox0{\begin{circuitikz}[american,baseline=(current bounding box.center)]
 \draw 
(0,0)to [barrier](0,1)
(0,1) to [short, -*](0,0)
(0,1) to [short, -*](0,1);
\end{circuitikz}}% measure width
\sbox1{\raisebox{\dimexpr 0.5\depth-0.5\height}{% align geometric center
\begin{tabular}{c} % <-- Alignments: 1st column left, 2nd middle and 3rd right, with vertical lines in between
     \hline
      Al\\
      \hline
      AlOx\\
      \hline
      Al\\
      \hline
\end{tabular}}}%
\sbox2{\includegraphics[width=0.15\textwidth, valign=c]{example-image}}%{JJCrosssectionFalsecolours} % Include the figure
\centering
\setlength{\tabcolsep}{\dimexpr \columnwidth-\wd0-\wd1-\wd2}%
\divide\tabcolsep by 6
\begin{tabular}{p{\wd0} p{\wd1} p{\wd2}}
  \usebox0 & \usebox1 & \usebox2 \\
  \subcaption{} & \subcaption{} & \subcaption{}
\end{tabular}%

\caption{a) circuit ... b) A fabr ...}
\label{JJcircuit}

\end{figure}
\end{document}

演示

相关内容