我需要在两列文档的一列中水平插入两个数字。我尝试了下面的代码
\begin{figure}[h!]
\centering
\begin{subfigure}[h]{0.1\linewidth}
\centering
\includegraphics[width=\linewidth]{coffee.jpg}
\caption{Coffee.}
\end{subfigure}
\begin{subfigure}[h]{0.1\linewidth}
\centering
\includegraphics[width=\linewidth]{coffee.jpg}
\caption{More coffee.}
\end{subfigure}
\caption{The same cup of coffee. Two times.}
\label{fig:coffee}
\end{figure*}
我得到了这样的数字
但我需要水平方向的数字。我怎样才能修改我的代码来得到这个
答案1
\documentclass[twocolumn]{article}
\usepackage{graphicx, subcaption}
\usepackage{lipsum}
\begin{document}
\lipsum[1-2]
\begin{figure}[h]
\begin{subfigure}[h]{0.24\textwidth}
\centering
\includegraphics[width=\linewidth]{example-image-a}
\caption{Coffee.}
\end{subfigure}
\hfill
\begin{subfigure}[h]{0.24\textwidth}
\centering
\includegraphics[width=\linewidth]{example-image-b}
\caption{More coffee.}
\end{subfigure}
\caption{The same cup of coffee. Two times.}
\label{fig:coffee}
\end{figure}
\lipsum[3-6]
\end{document}