我需要将图片列表和表格列表添加到目录中,并根据大学撰写论文的要求调整一些规范。我这样做了
\documentclass[a4paper, 12pt, oneside, openany]{book}
\usepackage{setspace}
\onehalfspacing
\usepackage{geometry}
\geometry{
paperwidth=210mm, paperheight=297mm,
left=35mm, right=35mm, top=25mm, bottom=25mm}
\parskip=12pt
\parindent=0pt
\usepackage{float}
\usepackage{datetime}
\newdateformat{monthyeardate}{%
\monthname[\THEMONTH], \THEYEAR}
\usepackage{tabularray}
\UseTblrLibrary{booktabs, siunitx}
\usepackage{ makecell}
%LONG TABLE FEATURES
\DefTblrTemplate{contfoot-text}{normal}{}
\SetTblrTemplate{contfoot-text}{normal}
%%%%%%%%%%%% CAPTION %%%%%%%%%%%%%%%%%
\usepackage{caption}
\captionsetup{labelfont=bf}
\RequirePackage[labelfont=bf, labelsep=space]{caption}
\usepackage[justification=centering]{caption}
\NewTblrTheme{captionof}% % <---
{\DefTblrTemplate{caption}{default}%
{\addtocounter{table}{-1}%
\captionof{table}{\InsertTblrText{caption}}%
}
\DefTblrTemplate{capcont}{default}%
{\addtocounter{table}{-1}%
\captionof{table}{\InsertTblrText{caption} "continue..."}
}%
}
%%%%%%%%%%%%%%%
\usepackage{adjustbox}
\usepackage{longtable}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\usepackage{mathptmx}
\usepackage{mathtools}
\usepackage{subcaption}
\usepackage{graphicx}
\usepackage{hyperref}
\usepackage{fancyhdr}
\fancyhf{}
\cfoot{\thepage}
\renewcommand{\headrulewidth}{0pt}
\setcounter{secnumdepth}{4}
\pagestyle{plain}
\usepackage{emptypage}
\renewcommand{\chaptername}{}
\usepackage{titlesec}
\titleformat{\chapter}[display]
{\bfseries\Large}
{\chaptername~\filleft\bfseries\fontsize{30}
{00}\selectfont\thechapter}{14pt}
{\vspace{-2em}\filleft\Large}
[\vspace{0.5em}\titlerule]
\titleformat{\section}{\bfseries\large}{\thesection}{1em}{}
[\vspace{-1.5em}]
\titleformat{\subsection}{\bfseries\normalsize{\thesubsection}
{1em}{}[\vspace{-1.5em}]
\titleformat{\subsubsection}{\bfseries\normalsize
{\thesubsubsection}{1em}{}[\vspace{-1.5em}]
\graphicspath{figure/}
\usepackage{array}
\renewcommand*{\arraystretch}{0.6}
\usepackage[nottoc]{tocbibind}
\usepackage{glossaries}
\usepackage{enumitem}
\usepackage{multirow}
\usepackage{ragged2e}
\usepackage{blindtext}
\renewcommand{\bibname}{REFERENCES}
\usepackage{setspace}
\usepackage{titlesec}
\newcommand*{\justifyheading}{\raggedleft}
\pagenumbering{roman}
\usepackage{marginnote}
\renewcommand*\contentsname{\null\hfill {TABLE OF
CONTENTS}}
\usepackage{tocbibind}
\let\oldaddcontentsline\addcontentsline
\newcommand{\ADDCONTENTSLINE}[3]{%
\oldaddcontentsline{#1}{#2}{\MakeUppercase{#3}}%
}
\newcommand{\CAPinToC}
{\let\addcontentsline\ADDCONTENTSLINE}
\newcommand{\noCAPinToC}
{\let\addcontentsline\oldaddcontentsline}
\let\cleardoublepage=\clearpage %remove blank page
\usepackage{nomencl}%%%% LIST OF SYMBOLS
\makenomenclature
\begin{document}
\input{frontpage.tex}
\chapter*{\null\hfill{ACKNOWLEDGEMENTS}}
\newpage
\chapter*{TABLE OF CONTENTS}
\renewcommand\contentsname{\vspace{-3.6em}}
\tableofcontents
\newlist{sym}{itemize}{1} %TABLE OF SYMBOLS
\setlist[sym]
{label=,labelwidth=1in,align=parleft,
itemsep=0.1\baselineskip,leftmargin=!}
\chapter*{\null\hfill{LIST OF SYMBOLS}}
\addcontentsline{toc}{chapter}{LIST OF SYMBOLS}
\chaptermark{List of Symbols}
\begin{sys}
\end{sys}
\newlength{\mylen}
\newlength{\tempp}
\setlength{\tempp}{\cftfignumwidth}
%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%% FIGURE %%%%%%%%%%%
\setlength{\cftfigindent}{0pt}
\renewcommand{\figurename}{Figure}
\renewcommand\cftfigpresnum{\bfseries \figurename~}
\renewcommand\cftfigaftersnum{\normalfont}
\settowidth{\mylen}{\cftfigpresnum\cftfigaftersnum}
\addtolength{\cftfignumwidth}{\mylen}
\chapter*{LIST OF FIGURES}
\renewcommand\listfigurename{\vspace{-3.2em}}
\addcontentsline{toc}{chapter}{LIST OF FIGURES}
\listoffigures
\clearpage
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%% TABLE %%%%%%%%%%%%%%%%%%%
\setlength{\cfttabindent}{0pt}
\renewcommand{\tablename}{Table}
\renewcommand\cfttabpresnum{\bfseries \tablename~}
\renewcommand\cfttabaftersnum{\normalfont}
\settowidth{\mylen}{\cfttabpresnum\cfttabaftersnum}
\addtolength{\cfttabnumwidth}{\mylen}
\chapter*{LIST OF TABLES}
\renewcommand\listtablename{\vspace{-3.2em}}
\addcontentsline{toc}{chapter}{LIST OF TABLES}
\listoftables
\clearpage
\chapter*{\null\hfill{ABSTRACT}} %ABSTRACT
\addcontentsline{toc}{chapter}{ABSTRACT}
\chapter{INTRODUCTION}
\section{section one} the text starts from here.
\section{section tow} the text starts from here.
\section{section three} the text starts from here.
\chapter{OVERVIEW}
\begin{figure}
\centering
\includegraphics[width=0.5\textwidth]{example}
\caption{A sample figure}
\end{figure}
\begin{table}
\centering
\begin{tabular}{|c|c|}
\hline
A & B \\
\hline
1 & 2 \\
\hline
\end{tabular}
\caption{A sample table}
\end{table}
\end{document}
所以我不确定我做错了什么,有什么帮助吗?顺便说一句,我在编译时收到了这个警告消息hyperref 包已插入序言中。顺便说一下,表格和图片的列表应该是这样的
答案1
使用此模板。在 sec 文件夹中,您将找到必要的 tex 文件,您需要做的就是用自己的文件填充它们。运行 main.tex 进行输出。这是我为自己调整的内容
\documentclass[12pt]{article}
\usepackage{report}
\usepackage[acronym]{glossaries}
\usepackage{rotating}
\usepackage{float}
\usepackage{siunitx}
\usepackage{array}
\usepackage[justification=centering]{caption}
\usepackage{booktabs}
\usepackage[table,xcdraw]{xcolor}
\usepackage{chngcntr}
\usepackage[utf8]{inputenc}
\usepackage{ragged2e}
\usepackage{blindtext}
\usepackage{subcaption}
\usepackage{sectsty}
\usepackage{fancyhdr}
\usepackage{lipsum}
\usepackage{sectsty}
\usepackage{geometry}
\usepackage{tocloft}
\usepackage{setspace}
\usepackage{parskip}
\graphicspath{{./sec/image/}}
\geometry{
left=3cm,
right=2.5cm,
bottom=2.5cm,
a4paper
}
\title{Thesis}
\author{John MacTavish}
\date{\today}
\sectionfont{\centering}
\makeatletter
\renewcommand{\@seccntformat}[1]{}
\makeatother
\onehalfspacing
\begin{document}
\fancyhead{}
\fancyfoot[C]{\thepage}
\pagenumbering{roman} % roman page numbers
\input{sec/titlepage}
%\input{sec/letter_of_approval} % not required for proposal
%\input{sec/copyright} % not required for proposal
%\input{sec/acknowledgment} % not required for proposal
%\input{sec/abstract}
%Table of contents
\newpage
{
\setlength{\parskip}{0em}
\renewcommand\contentsname{\centering TABLE OF CONTENTS} % This will change heading text
\tableofcontents
\addcontentsline{toc}{section}{TABLE OF CONTENTS}
}
% List of figures - if any
\newpage
\listoffigures
\addcontentsline{toc}{section}{LIST OF FIGURES}
% List of tables- if any
\newpage
\listoftables
\addcontentsline{toc}{section}{LIST OF TABLES}
% List of Abbreviation- if any
\newpage
\input{sec/list_of_abbrev}
\input{sec/introduction}
\input{sec/literature_review}
%\input{sec/theoretical_background}
%\input{sec/methodology}
%\input{sec/system_design}
% \input{sec/system_implementation.tex}
%\input{sec/tools_technologies}
% \input{sec/observations}
% \input{sec/result}
%\input{sec/conclusion}
% \input{sec/limitations}
\input{sec/references}
% \input{sec/appendix} %optional
\end{document}
但是,您可以删除 37-39 行,然后您将获得一个数字部分和小节...
答案2
我找到了我的问题的解决方案。我必须删除这些软件包才能正常工作\usepackage{tocbibind}
。\usepackage[nottoc]{tocbibind}
感谢所有试图帮助我的人。