pdf輸出中子圖的隨機編號和間距

pdf輸出中子圖的隨機編號和間距

我的 pdf 輸出中子圖的編號是隨機的,但在編輯器中編號是應有的。

其中子圖從 (a) 到 (d) 的編號正確,但是當匯出到 pdf 時,這就是我得到的:

在此輸入影像描述

我還想問為什麼第一行數字的水平間距不一樣?每行的設定相同,但第一行不跟隨。

我不知道如何解決這個問題。這是LaTeX圖中的程式碼:

%% LyX 2.3.2-2 created this file.  For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[english]{IEEEtran}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage{graphicx}

\makeatletter
\@ifundefined{showcaptionsetup}{}{%
 \PassOptionsToPackage{caption=false}{subfig}}
\usepackage{subfig}
\makeatother

\usepackage{babel}
\begin{document}
\begin{figure*}
\subfloat[]{\subfloat{\includegraphics[width=0.28\paperwidth]{volume_4_0_ground_truth}}\enskip{}\subfloat{\includegraphics[width=0.28\paperwidth]{volume_4_1_ground_truth}}\enskip{}\subfloat{\includegraphics[width=0.28\paperwidth]{volume_4_2_ground_truth}}}

\subfloat[]{\subfloat{\includegraphics[width=0.28\paperwidth]{volume_4_0_ground_truth}}\enskip{}\subfloat{\includegraphics[width=0.28\paperwidth]{volume_4_1_ground_truth}}\enskip{}\subfloat{\includegraphics[width=0.28\paperwidth]{volume_4_2_ground_truth}}}

\subfloat[]{\subfloat{\includegraphics[width=0.28\paperwidth]{volume_4_0_ground_truth}}\enskip{}\subfloat{\includegraphics[width=0.28\paperwidth]{volume_4_1_ground_truth}}\enskip{}\subfloat{\includegraphics[width=0.28\paperwidth]{volume_4_2_ground_truth}}}

\subfloat[]{\subfloat{\includegraphics[width=0.28\paperwidth]{volume_4_0_ground_truth}}\enskip{}\subfloat{\includegraphics[width=0.28\paperwidth]{volume_4_1_ground_truth}}\enskip{}\subfloat{\includegraphics[width=0.28\paperwidth]{volume_4_2_ground_truth}}}

\caption{Comparison}
\end{figure*}

\end{document}

答案1

如果我理解正確,您只需要四個標題(從(a)到(d),每行一個),您可以簡單地刪除嵌套的\subfloat

\documentclass[english]{IEEEtran}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage{graphicx}

\makeatletter
\@ifundefined{showcaptionsetup}{}{%
 \PassOptionsToPackage{caption=false}{subfig}}
\usepackage{subfig}
\makeatother

\usepackage{babel}
\begin{document}
\begin{figure*}
\centering
\subfloat[]{%
    \includegraphics[width=0.25\paperwidth]{example-image}\enskip
    \includegraphics[width=0.25\paperwidth]{example-image}\enskip
    \includegraphics[width=0.25\paperwidth]{example-image}%
}

\subfloat[]{%
    \includegraphics[width=0.25\paperwidth]{example-image}\enskip
    \includegraphics[width=0.25\paperwidth]{example-image}\enskip
    \includegraphics[width=0.25\paperwidth]{example-image}%
}

\subfloat[]{%
    \includegraphics[width=0.25\paperwidth]{example-image}\enskip
    \includegraphics[width=0.25\paperwidth]{example-image}\enskip
    \includegraphics[width=0.25\paperwidth]{example-image}%
}

\subfloat[]{%
    \includegraphics[width=0.25\paperwidth]{example-image}\enskip
    \includegraphics[width=0.25\paperwidth]{example-image}\enskip
    \includegraphics[width=0.25\paperwidth]{example-image}%
}

\caption{Comparison}
\end{figure*}

\end{document}

在此輸入影像描述

答案2

\includegraphics在所需寬度的小頁面內使用指令。

\documentclass[english]{article}
\usepackage[T1]{fontenc}
\usepackage{graphicx}
\usepackage{subcaption}
\begin{document}

\begin{figure*}
\begin{minipage}{0.3\textwidth}
\includegraphics[width=\linewidth]{volume_4_0_ground_truth}
\end{minipage}\hspace*{\fill}
\begin{minipage}{0.3\textwidth}
\includegraphics[width=\linewidth]{volume_4_1_ground_truth}
\end{minipage}\hspace*{\fill}
\begin{minipage}{0.3\textwidth}
\includegraphics[width=\linewidth]{volume_4_2_ground_truth}
\end{minipage}\vspace{15pt}

\begin{minipage}{0.3\textwidth}
\includegraphics[width=\linewidth]{volume_4_0_ground_truth}
\end{minipage}\hspace*{\fill}
\begin{minipage}{0.3\textwidth}
\includegraphics[width=\linewidth]{volume_4_1_ground_truth}
\end{minipage}\hspace*{\fill}
\begin{minipage}{0.3\textwidth}
\includegraphics[width=\linewidth]{volume_4_2_ground_truth}
\end{minipage}
\caption{Comparison}
\end{figure*}

\end{document}

如果您願意,可以使用以下命令包含標題:\captionof{subfigure}{Caption (a)}

相關內容