我正在尝试为我的论文生成一个列表。学校没有标准的 LaTeX 模板,但之前生成了一个相当不错的模板,可以满足我的要求。唯一的问题是它没有包含列表功能,所以我继续修改了图表列表(如下所示)的定义,以定义一个新的列表。
% LIST OF TABLES
%
% Single-space list of tables, add it to the table of contents.
\def\listoftables{%
\@restonecolfalse%
\if@twocolumn\@restonecoltrue\onecolumn\fi%
\newpage%
\centerline{\expandafter\uppercase\expandafter{\listtablename}}%
\bigskip%
\phantomsection%
\addcontentsline{toc}{frontmatter}{\protect\numberline{}\listtablename }%
% This group overloads \numberline to output ``Table 1.3'' instead of ``1.3''
\begingroup%
\let\ORIG@numberline\numberline%
\renewcommand*{\numberline}[1]{\ORIG@numberline{\tablename~##1:}}%
{\ssp\@starttoc{lot}}%
\if@restonecol\twocolumn\fi%
\endgroup %
}
\newlength{\@tablelength}
\settowidth{\@tablelength}{\tablename }
% Magic value, but consistent with the standard table length.
\addtolength{\@tablelength}{2.8em}
\def\l@table{\normalfont\@dottedtocline{1}{0em}{\@tablelength}}
这就是我想出的...
% LIST OF LISTINGS
%
% Single-space list of listings, add it to the table of contents.
\def\listoflistings{%
\@restonecolfalse%
\if@twocolumn\@restonecoltrue\onecolumn\fi%
\newpage%
\centerline{\expandafter\uppercase\expandafter{\listlistingname}}%
\bigskip%
\phantomsection%
\addcontentsline{toc}{frontmatter}{\protect\numberline{}\listlistingname }%
%This group overloads \numberline to output ``Source Code 1.3'' instead of ``1.3''
\begingroup%
\let\ORIG@numberline\numberline%
\renewcommand*{\numberline}[1]{\ORIG@numberline{\listingname~##1:}}%
{\ssp\@starttoc{lol}}%
\if@restonecol\twocolumn\fi%
\endgroup %
}
\newlength{\@listinglength}
\settowidth{\@listinglength}{\listingname }
% Magic value, but consistent with the standard listing length
\addtolength{\@listinglength}{2.8em}
\def\l@listing{\normalfont\@dottedtocline{1}{0em}{\@listinglength}}
唯一的问题是文本\listingname
(源代码)和列表的简短标题重叠(见下文),但它们不应该重叠(见下面图表列表的示例)。
我相信我已经确定问题源于 .lot 和 .lol 文件的生成方式,即 .lol 文件缺少关键字\ignorespaces
。
.lot 文件
\boolfalse {citerequest}\boolfalse {citetracker}\boolfalse {pagetracker}\boolfalse {backtracker}\relax
\defcounter {refsection}{0}\relax
\addvspace {10\p@ }
\defcounter {refsection}{0}\relax
\addvspace {10\p@ }
\defcounter {refsection}{0}\relax
\contentsline {table}{\numberline {2.S1}{\ignorespaces Pedigree 1 Candidate Variants}}{33}{table.2.1}
\defcounter {refsection}{0}\relax
\contentsline {table}{\numberline {2.S2}{\ignorespaces Pedigree 2 Candidate Variants}}{33}{table.2.2}
\defcounter {refsection}{0}\relax
\addvspace {10\p@ }
\defcounter {refsection}{0}\relax
\contentsline {table}{\numberline {3.1}{\ignorespaces Variants identified.}}{43}{table.3.1}
\defcounter {refsection}{0}\relax
\contentsline {table}{\numberline {3.S1}{\ignorespaces Capture and Variant Calling Statistics.}}{44}{table.3.1}
\defcounter {refsection}{0}\relax
\contentsline {table}{\numberline {3.S2}{\ignorespaces Variant Filtering Statistics.}}{44}{table.3.2}
\defcounter {refsection}{0}\relax
\contentsline {table}{\numberline {3.S3}{\ignorespaces Primers.}}{45}{table.3.3}
\defcounter {refsection}{0}\relax
\contentsline {table}{\numberline {3.S4}{\ignorespaces Candidate variants.}}{46}{table.3.4}
\defcounter {refsection}{0}\relax
\contentsline {table}{\numberline {3.S5}{\ignorespaces Novel SNVs identified at a high rate in the Pakistani population.}}{47}{table.3.5}
\defcounter {refsection}{0}\relax
\addvspace {10\p@ }
\defcounter {refsection}{0}\relax
\contentsline {table}{\numberline {4.1}{\ignorespaces Dual index y-adaptors}}{64}{table.4.1}
\defcounter {refsection}{0}\relax
\contentsline {table}{\numberline {4.S1}{\ignorespaces SNVs used for homozygosity mapping}}{74}{table.4.1}
\defcounter {refsection}{0}\relax
\addvspace {10\p@ }
\defcounter {refsection}{0}\relax
\contentsline {table}{\numberline {A.1}{\ignorespaces Example Read Depth Functions.}}{145}{table.A.1}
\defcounter {refsection}{0}\relax
\addvspace {10\p@ }
.lol 文件
\defcounter {refsection}{0}\relax
\contentsline {lstlisting}{\numberline {B.1}annotateVariants.cpp}{157}{lstlisting.B.1}
\defcounter {refsection}{0}\relax
\contentsline {lstlisting}{\numberline {B.2}macPC.h}{200}{lstlisting.B.2}
\defcounter {refsection}{0}\relax
\contentsline {lstlisting}{\numberline {B.3}patterns.h}{200}{lstlisting.B.3}
\defcounter {refsection}{0}\relax
\contentsline {lstlisting}{\numberline {B.4}patterns.cpp}{200}{lstlisting.B.4}
\defcounter {refsection}{0}\relax
\contentsline {lstlisting}{\numberline {B.5}genomeCDNAProtein.h}{207}{lstlisting.B.5}
\defcounter {refsection}{0}\relax
\contentsline {lstlisting}{\numberline {B.6}genomeCDNAProtein.cpp}{208}{lstlisting.B.6}