저는 Latex로 논문을 작성하고 있는데 모든 섹션을 함께 추가할 때 문제가 있습니다. 원하는 순서대로 나열할 수 없고 목차에 표시됩니다. 여기에 비결이 있나요? 나는 이것에 대해 상당히 새로운 것이므로 어떤 힌트나 수정이라도 좋을 것입니다.
다음과 같은 목차를 갖고 싶습니다.
추상적인
테이블 목록 등(번호가 매겨지지 않음)
장(번호)
부록(번호가 매겨지지 않음)
참고문헌(번호가 매겨지지 않음)
모든 섹션을 이 순서로 인쇄할 수 있습니다. 즉, PDF는 올바른 순서로 컴파일되지만 참고문헌은 목차에 표시되지 않습니다. 참고문헌이 부록 앞에 인쇄되도록 코드를 바꾸면 모든 내용이 목차에 나타납니다.
여기 MWE가 있습니다. 참고문헌을 부록 앞과 뒤로 전환하면 결과를 볼 수 있습니다.
\documentclass[12pt,a4paper,hidelinks,twoside]{report}
\raggedbottom
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[greek,spanish,english]{babel}
\usepackage{textgreek}
\usepackage[version=3]{mhchem}
\usepackage[a4paper,width=150mm,top=25mm,bottom=25mm,bindingoffset=6mm]{geometry}
\usepackage{amsmath, amsfonts, amssymb, pifont, float, color, url}
\usepackage[pdftex]{graphicx}
\usepackage[style=nature,backend=biber,sorting=none]{biblatex}
\addbibresource{references.bib}
\usepackage[pdftex, plainpages=false, pdfpagelabels, bookmarks=true]{hyperref}
\usepackage{fancyhdr}
\usepackage[center,font={it,small},skip=5pt]{caption}
\usepackage{parskip}
\usepackage{tikz}
\usepackage{afterpage}
\usepackage{siunitx}
\usepackage{tabularx}
\usepackage{lscape}
\usepackage{textcomp}
\usepackage{listings}
\lstset{basicstyle=\scriptsize\ttfamily,
frame=tb,
aboveskip=3mm,
belowskip=3mm,
showstringspaces=false,
commentstyle=\color{red},
keywordstyle=\color{blue}
}
\usepackage{datetime}
\usepackage{longtable}
\usepackage{lipsum}
\usepackage{dcolumn}
\newcolumntype{d}{D{.}{.}{2}}
\usepackage{makeidx}
\makeindex
\usepackage{nomencl}
\makenomenclature
\usepackage{tocloft}
\usepackage{soul}
\pretolerance=10000 %% prevents words from being hyphenated when the line splits.
\usepackage{todonotes}
\pdfpageattr {/Group << /S /Transparency /I true /CS /DeviceRGB>>} %correct viewing in adobe reader
\DeclareUnicodeCharacter{FB01}{fi}
\DeclareUnicodeCharacter{00A0}{~}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%% Use packages above and set them up %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagestyle{fancy} %\pagestyle{plain} to have just page numbers restate fancy afterwards or all pages from that point will be plain.
\fancyhf{}
\cfoot{\thepage}
\graphicspath{ {Pictures/} }
\renewcommand{\headrulewidth}{0.4pt}
\newcommand{\etal}{\textit{et al. }}
\renewcommand{\nomname}{List of Abbreviations}
%% an equation caption solution from the web by Heiko Oberdiek
\newcommand{\capequ}[1]{\begin{center} #1 \end{center}}
\usepackage{aliascnt}
\newaliascnt{eqfloat}{equation}
\newfloat{eqfloat}{h}{eqflts}
\floatname{eqfloat}{Equation}
\newcommand*{\ORGeqfloat}{}
\let\ORGeqfloat\eqfloat
\def\eqfloat{%
\let\ORIGINALcaption\caption
\def\caption{%
\addtocounter{equation}{-1}%
\ORIGINALcaption
}%
\ORGeqfloat
}
\newenvironment{tightcenter}{%
\setlength\topsep{0pt}
\setlength\parskip{0pt}
\begin{center}
}{%
\end{center}
}
\newcommand{\listequationsname}{List of Equations}
\newlistof{myequations}{equ}{\listequationsname}
\newcommand{\myequations}[1]{%
\addcontentsline{equ}{myequations}{\protect\numberline{\theequation}#1}\par}
\setlength{\cftmyequationsnumwidth}{2.5em}% Width of equation number in List of Equations
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%% Document variables above and user defined commands %%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% BEGIN THE DOCUMENT %
\sloppy
\color{black}
\begin{document}
\begin{titlepage}
\begin{center}
\vspace*{0.25cm}
\Huge
\textbf{Thesis}
\vspace{0.5cm}
%\LARGE
%Thesis Subtitle
\vspace{1.0cm}
A logo
\vspace{1.0cm}
\textbf{}
\normalsize This thesis is submitted in partial fulfilment for the degree of\\ Doctor of Philosophy\\
\vspace{0.3cm}
\today
%%\vspace{0.5cm}
\Large
School of Chemistry\\
University of St Andrews\\
\end{center}
\end{titlepage}
\pagestyle{headings}
\setcounter{page}{1}
\pagenumbering{roman}
\addcontentsline{toc}{chapter}{\protect\numberline{}Contents}\tableofcontents
\newpage
\chapter*{\centerline{Abstract}}\label{Abstract}
\addcontentsline{toc}{chapter}{\protect\numberline{}Abstract}
In this thesis
\newpage
\chapter*{\centerline{Dedication}}\label{dedication}
\addcontentsline{toc}{chapter}{\protect\numberline{}Dedication}
\begin{center}
\large
\vspace*{\fill}
For my Family and Friends
\vspace*{\fill}
\end{center}
\newpage
\chapter*{\centerline{Declaration}}\label{Declaration}
\addcontentsline{toc}{chapter}{\protect\numberline{}Declaration}
........... Declares that ......
\newpage
\chapter*{\centerline{Acknowledgements}}\label{Acknowledgements}
\addcontentsline{toc}{chapter}{\protect\numberline{}Acknowledgements}
I would like to thank ......
\newpage
\chapter*{\centerline{Publications}}\label{Publications}
\addcontentsline{toc}{chapter}{\protect\numberline{}Publications}
Publication 1 ......
\newpage
\clearpage
\phantomsection\addcontentsline{toc}{chapter}{\protect\numberline{}List of Figures}
\listoffigures
\newpage
\clearpage
\phantomsection\addcontentsline{toc}{chapter}{\protect\numberline{}List of Tables}
\listoftables
\newpage
\clearpage
\phantomsection\addcontentsline{toc}{chapter}{\protect\numberline{}List of Equations}
\listofmyequations
\newpage
\printnomenclature[5cm]
\addcontentsline{toc}{chapter}{\protect\numberline{}List of Abbreviations}
\newpage
\thispagestyle{plain}
\begin{center}
\large
\vspace*{\fill}
\textit{Quote}
\vspace*{\fill}
\end{center}
\newpage
\setcounter{page}{1}
\pagenumbering{arabic}
\chapter{Introduction}
\label{chap:introduction}
\input{Chapters/Introduction}
\chapter{Theory and Methods}
\label{chap:Theory and Methods}
\input{Chapters/Chapter_2}
%\cleardoublepage
%\phantomsection
%\addcontentsline{toc}{chapter}{\protect\numberline{}Bibliography}
%\printbibliography
\appendix
\clearpage
\phantomsection\addcontentsline{toc}{chapter}{\protect\numberline{}Appendices}
\addtocontents{toc}{\protect\setcounter{tocdepth}{-1}}
\input{chapters/appendix}
\cleardoublepage
\phantomsection
\addcontentsline{toc}{chapter}{\protect\numberline{}Bibliography}
\printbibliography
%\newpage
\end{document}
아래에 몇 가지 빠른 변경과 유용한 설명을 추가한 후 \addtocontents{toc}{\protect\setcounter{tocdepth}{0}}
참고문헌을 인쇄하기 전에 간단히 추가하면 이 문제를 해결할 수 있습니다.
답변1
Johannes_B의 조언을 듣고 내 질문에 답해서 죄송합니다. toc뎁스를 0으로 재설정하여 코드를 수정했습니다. 의견을 보내주신 Johannes_B에게 감사드립니다. 변경사항은,
\appendix
\clearpage
\phantomsection\addcontentsline{toc}{chapter}{\protect\numberline{}Appendices}
\addtocontents{toc}{\protect\setcounter{tocdepth}{-1}}
\input{chapters/appendix}
\addtocontents{toc}{\protect\setcounter{tocdepth}{0}}
\cleardoublepage
\phantomsection
\addcontentsline{toc}{chapter}{\protect\numberline{}Bibliography}
\printbibliography
\end{Document}