目录中图表列表和表格列表的页码错误!

目录中图表列表和表格列表的页码错误!

我知道其他人也问过这个问题,但浏览了答案后发现似乎有两个解决方案:编译 3 或 4 次并尝试一些涉及 \markboth 命令的代码片段。我都试过了,但似乎无法修复它。

在我看来(以我对 Latex 的肤浅理解),这是一个前向引用的问题,编译的次数越多,指针就越准确。我重新编译了 7 次,但这个问题还是没能解决。

这是我的主文件,我在其中调用每个其他组件:

\documentclass[12pt, a4paper,twoside]{./a4LaTex/tesi_upf}
\input{Latex/Macros/Macrofile}
\usepackage[latin1]{inputenc}
\usepackage[english,french]{babel}
\usepackage{textgreek} %%%%% greek letters in text mode
\usepackage{fixltx2e} %%%%%% sub/superscript type face in text mode
\usepackage[a4paper]{geometry}
\usepackage{graphicx}%%%%% including figures
\usepackage[Bjarne]{fncychap}%%%%% fancy chapter names
\pagestyle{plain} %UPF DONT CHANGE

\usepackage{makeidx}
\usepackage{hyperref}%%%%% for links to references
\usepackage{textcomp}
\usepackage{natbib}%%%%% for bibliography
\renewcommand{\bibsection}{\chapter{\bibname}}
\usepackage{verbatim}
\usepackage[LGR,OT1]{fontenc}%%%%% font
\usepackage{epigrafica}%%%%% font
\usepackage{fancyhdr}
\usepackage{multirow}
\usepackage{fancybox}
\usepackage{lettrine} % for the beginning of chapters
\usepackage{hyphenat} %%%making life easier with hyphenation
\usepackage{amsmath}  %%%making life easier writing math equations
\usepackage{array}
\usepackage{pdfpages}
\usepackage{boxedminipage}
\usepackage{subfigure}
\usepackage{floatrow}
\usepackage{longtable}
\usepackage{pdfpages}  % for inserting PDF files into Latex
\usepackage{morefloats}


%%%%% Colors of the links
\hypersetup{colorlinks=true,citecolor=black,menucolor=black,linkcolor=black}

\makeindex
\selectlanguage{english}



%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\hyphenation{biology}
\selectlanguage{english}
\frontmatter % UPF
\maketitle
\clearpage % UPF

% sets line spacing
\renewcommand{\baselinestretch}{1.0}
\baselineskip=18pt

\chapter*{Glossary} % top level followed by section, subsection
\label{glossary}
\addcontentsline{toc}{chapter}{Glossary}


\begin{center}
\begin{longtable}{ll}

%Here is the caption, the stuff in [] is the table of contents entry
\caption{List of abbreviations} \label{gloss} \\

%This is the header for the first page of the table...
\hline \hline \\[-2ex]
\multicolumn{1}{l}{\textbf{Abbreviation}} &
\multicolumn{1}{l}{\textbf{Description}} \\[0.5ex] \hline
\\[-1.8ex]
\endfirsthead

%This is the header for the remaining page(s) of the table...
\multicolumn{2}{c}{{\tablename} \thetable{} -- Continued} \\[0.5ex]
\hline \hline \\[-2ex]
\multicolumn{1}{l}{\textbf{Abbreviation}} &
\multicolumn{1}{l}{\textbf{Description}} \\[0.5ex] \hline
\\[-1.8ex]
\endhead

%This is the footer for the last page of the table...
\\[-1.8ex] \hline \hline
\endlastfoot

% now the data
AF &  affinity purification\\
AP2 &  apetala 2\\
ARNTL &  aryl hydrocarbon receptor nuclear translocator-like\\
BMAL1 & brain and muscle ARNT-like 1\\
BMP & bone morphogenetic protein\\
BrdU & bromodeoxyuridine\\
C/EBP & CCAAT/enhancer binding protein\\
CLOCK & circadian locomoter output cycles protein kaput\\
ECM & extracellular matrix\\
EGF & epidermal growth factor\\
FGF & fibroblast growth factor\\
GRHL3 & grainyhead-like 3\\
HF & hair follicle\\
HT & high-throughput\\
HPLC & high-pressure liquid chromatogrphy\\
IEX-HPLC & ion exchange high-pressure liquid chromatography\\
IF & interfollicular\\
IFE & interfollicular epidermis\\
\end{longtable}
\end{center}
\cleardoublepage

%%%%% List of Figures
\listoffigures
\addcontentsline{toc}{chapter}{List of Figures}
\cleardoublepage

%%%%% List Of Tables
\listoftables
\addcontentsline{toc}{chapter}{List of Tables}
\cleardoublepage

% Define what levels to number in the TOC
\setcounter{secnumdepth}{3} % organisational level that receives a number
\setcounter{tocdepth}{2}    % print table of contents for level 3vb e

%%%%% Table of Contents UPF
\tableofcontents
\addcontentsline{toc}{chapter}{Contents}
\markboth{Contents}{\textbf{Contents}}
\cleardoublepage


%%%%% no indentation
\setlength{\parindent}{0pt}

\mainmatter
\pagenumbering{arabic}
\clearpage


\cleardoublepage

%%%%% Bibliography
\bibliographystyle{/Users/kianatoufighi/Dropbox/Thesis/ThesisLatex/BibStyles/jmb}
\bibliography{/Users/kianatoufighi/Dropbox/Thesis/ThesisLatex/BibLib/mylibrary}
\end{document} 

答案1

使用您的代码, 的最后一页的页码\listoffigures和 的最后一页\listoftables将显示在 中\tableofcontents

将命令的顺序更改为

\cleardoublepage
\addcontentsline{toc}{chapter}{List fo Tables}
\listoftables

答案2

要删除某个部分中不需要的“表格列表”标题,可以使用\addtocontents该特定部分的 toc 文件命令。在要隐藏“表格列表”标题的部分中的实际表格之前添加以下几行: \addtocontents{lot}{\protect\setcounter{tocdepth}{-2}}

完整代码;

\chapter{Your Chapter Title}
\section{Section Title}
\addtocontents{lot}{\protect\setcounter{tocdepth}{-2}} % Suppress List of Tables in this section
\begin{table}
  \caption{Your Table Caption}
  % Table content goes here
\end{table}

相关内容