目录部分中的错误页面上列出了子图(包:subcaption)

目录部分中的错误页面上列出了子图(包:subcaption)

我已经读完了http://mirrors.ibiblio.org/CTAN/macros/latex/contrib/caption/subcaption.pdf找不到答案。这里有几个标题类似的问题,但似乎没有一个与我遇到的问题有关。

我有三个子图,它们分布在一页上,其中 (a) 在第 6 页,(b) 和 (c) 在第 7 页。但是,在目录中,它说 (a) 在 6 页,但 (b) 和 (c) 在 8 页,而事实并非如此。

更新:我已编辑以下代码以包含我的整个序言。但是,我意外地修复了这个问题,因为我最终需要在本节之前添加一个额外的段落,从而将它们完美地推到一页上。但是,如果问题再次发生,我仍然不知道该如何修复,所以我将这个问题留待以后再解决。谢谢大家的帮助!

\documentclass[12pt, letterpaper]{article}

\usepackage{fontspec}
\setmainfont{Times New Roman}

\usepackage{multicol}

\usepackage{geometry}

\usepackage{float}

\usepackage{caption}
\usepackage{subcaption}
\DeclareCaptionListFormat{myfmt}{#1.#2}
\usepackage[list=true,listformat=myfmt]{subcaption}

\usepackage{graphicx}
\graphicspath{ {./Figures/} }

\usepackage{pgfplots}
\pgfplotsset{width=10cm,compat=1.9}

\usepackage[section]{placeins}

\usepackage[labelfont=bf]{caption}

\title{Phonotactic Effects on the Duration of Word-Initial Aspiration in English}
\author{\Large Noah M. Coen\\[.4cm]{Professor: Dr. Dylan Herrick}\\[.4cm]{Linguistics 3133: Phonetic Field Methods}}
\date{October 8th, 2020}

\usepackage[backend=biber,
style=authoryear]{biblatex}
\addbibresource{HW5Latex.bib}

\usepackage{libertine}

\usepackage{hyperref}

\usepackage[nottoc]{tocbibind}

\begin{document}

\addcontentsline{toc}{section}{Table of Contents}
\tableofcontents
\listoffigures
\listoftables
\maketitle

\begin{figure}[H]
\centering
\caption{\textbf{Waveform Analysis}}
\label{psmethodss}
\begin{flushleft}
\begin{subfigure}[!h]{\textwidth}
\centering
\includegraphics[scale=.5]{PSSS1}
\caption{Three Consecutive Utterances}
\label{pstcu}
\end{subfigure}
\end{flushleft}
\end{figure}
\begin{figure}[H]\ContinuedFloat
\begin{flushleft}
\centering
\begin{subfigure}[!h]{\textwidth}
\centering
\includegraphics[scale=.5]{PSSS2}
\caption{Single Utterance Selection}
\label{psnsu}
\end{subfigure}
\linebreak
\begin{subfigure}[!h]{\textwidth}
\centering
\includegraphics[scale=.5]{PSSS3}
\caption{Measurement of Aspiration}
\label{psmad}
\end{subfigure}
\end{flushleft}
\end{figure}
\FloatBarrier
\end{document}

在此处输入图片描述

提前感谢您的帮助!!

答案1

通过 \input 添加的子图在 LoF 中的页码错误无论是“空白”标题还是\phantomcaption似乎有帮助的:

\documentclass[12pt, letterpaper, demo]{article}

%\usepackage{fontspec}
%\setmainfont{Times New Roman}

\usepackage{multicol}

\usepackage{geometry}

\usepackage{float}

\usepackage{caption}
\usepackage{subcaption}
\DeclareCaptionListFormat{myfmt}{#1.#2}
\usepackage[list=true,listformat=myfmt]{subcaption}

\usepackage{graphicx}
\graphicspath{ {./Figures/} }

\usepackage{pgfplots}
\pgfplotsset{width=10cm,compat=1.9}

\usepackage[section]{placeins}

\usepackage[labelfont=bf]{caption}

\title{Phonotactic Effects on the Duration of Word-Initial Aspiration in English}
\author{\Large Noah M. Coen\\[.4cm]{Professor: Dr. Dylan Herrick}\\[.4cm]{Linguistics 3133: Phonetic Field Methods}}
\date{October 8th, 2020}

\usepackage[backend=biber,
style=authoryear]{biblatex}
\addbibresource{HW5Latex.bib}

\usepackage{libertine}

\usepackage{hyperref}

\usepackage[nottoc]{tocbibind}

\begin{document}

\addcontentsline{toc}{section}{Table of Contents}
\tableofcontents
\listoffigures
\listoftables
\maketitle

\begin{figure}[H]
\centering
\caption{\textbf{Waveform Analysis}}
\label{psmethodss}
\begin{flushleft}
\begin{subfigure}[!h]{\textwidth}
\centering
\includegraphics[scale=.5]{PSSS1}
\caption{Three Consecutive Utterances}
\label{pstcu}
\end{subfigure}
\end{flushleft}
\end{figure}
\begin{figure}[H]\ContinuedFloat
\phantomcaption  % <----- This line added
\begin{flushleft}
\centering
\begin{subfigure}[!h]{\textwidth}
\centering
\includegraphics[scale=.5]{PSSS2}
\caption{Single Utterance Selection}
\label{psnsu}
\end{subfigure}
\linebreak
\begin{subfigure}[!h]{\textwidth}
\centering
\includegraphics[scale=.5]{PSSS3}
\caption{Measurement of Aspiration}
\label{psmad}
\end{subfigure}
\end{flushleft}
\end{figure}

\clearpage
\begin{figure}
\caption{Whatever}
\end{figure}

\end{document}

如果没有,\phantomcaption子图 (b) 和 (c) 的页码为 4(不正确),但有了\phantomcaption页码则为 3(正确)。

相关内容