![我有三个数字想排成一行](https://linux22.com/image/312236/%E6%88%91%E6%9C%89%E4%B8%89%E4%B8%AA%E6%95%B0%E5%AD%97%E6%83%B3%E6%8E%92%E6%88%90%E4%B8%80%E8%A1%8C.png)
我有 3 个数字,我想将它们排成一行。我修剪了这些数字,因为原始数字有很多空白。两个数字排成一行,但一个数字移动到下一行。有没有办法修改代码,将所有三个数字放在同一行?代码如下。
\usepackage{graphicx}
\usepackage{subfig}
\begin{figure*}[ht!]
\subfloat[\label{genworkflow}]{%
\includegraphics[trim=20 40 50 30,clip, height=2.8 in]{./figures/fig1.png}}
\quad
\subfloat[\label{pyramidprocess} ]{%
\includegraphics[trim=10 40 10 30,clip, height=2.8 in]{./figures/fig2.png}}
\quad
\subfloat[\label{mt-simtask}]{%
\includegraphics[trim=30 40 30 30,clip, height=2.8 in]{./figures/fig3.png}}\\
\caption{\label{workflow}The overall approach. (a) figa; (b) Workflow for figb; (c) Workflow for figc.}
\end{figure*}
答案1
要将所有三个子图并排放在一行中,每个子图的宽度必须小于0.333\textwidth
。如果您选择0.3\textwidth
作为子图的宽度,请使用\hspace{\fill}
(或\hfill
)子图之间的间距指令,以获得0.05\textwidth
子图之间最大可能的间隔( )。
\documentclass[twocolumn]{article}
\usepackage[demo]{graphicx} % omit 'demo' option in real document
\usepackage{subfig}
\begin{document}
\begin{figure*}[ht!]
\subfloat[\label{genworkflow}]{%
\includegraphics[trim=20 40 50 30,clip, width=0.3\textwidth]{./figures/fig1.png}}
\hspace{\fill}
\subfloat[\label{pyramidprocess} ]{%
\includegraphics[trim=10 40 10 30,clip, width=0.3\textwidth]{./figures/fig2.png}}
\hspace{\fill}
\subfloat[\label{mt-simtask}]{%
\includegraphics[trim=30 40 30 30,clip, width=0.3\textwidth]{./figures/fig3.png}}\\
\caption{\label{workflow}The overall approach. (a) figa; (b) Workflow for figb; (c) Workflow for figc.}
\end{figure*}
\end{document}