我想将两张图片并排放置在双列模板中,如下所示。
这是当前的代码:
\documentclass[journal]{IEEEtran}
\begin{document}
\begin{figure}
\centering
\includegraphics[width=1.5 in]{square.jpg}
\caption{the square is blue}
\label{fig:square}
\end{figure}
\begin{figure}
\centering
\includegraphics[width=1.5 in]{circle.jpg}
\caption{the circle is orange}
\label{fig:circle}
\end{figure}
\end{document}
那么,结果如下。
谢谢。
答案1
另一种方法是使用tabularx
包:
\documentclass[journal]{IEEEtran}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{tabularx}
\newcolumntype{C}{>{\centering\arraybackslash}X}
\usepackage{lipsum}
\begin{document}
\lipsum[1]
\begin{figure}[ht]
\begin{tabularx}{\linewidth}{@{} CC @{}}
\includegraphics[width=1.5 in]{example-image-duck}%{square.jpg}
\caption{the square is blue}
\label{fig:square}
& \includegraphics[width=1.5 in]{example-image-duck}%{circle.jpg}
\caption{the circle is orange}
\label{fig:circle}
\end{tabularx}
\end{figure}
\lipsum[2-7]
\end{document}
答案2
希望这能满足要求:
\documentclass[journal]{IEEEtran}
\usepackage{graphicx}
\usepackage{float}
\usepackage{adjustbox}
\begin{document}
\hbox{\adjustbox{valign=t}{%
\begin{minipage}{0.5\textwidth}
\begin{figure}[H]
\includegraphics[width=0.25in]{example-image} \caption{the
square is blue} \label{fig:square}
\end{figure}
\end{minipage}}\hspace{12pt}
\adjustbox{valign=t}{%
\begin{minipage}{0.5\textwidth}
\begin{figure}[H]
\includegraphics[width=0.25in]{example-image} \caption{the
circle is orange} \label{fig:circle}
\end{figure}
\end{minipage}}
}
\end{document}