我无法让词汇表在目录中的正确位置显示。它需要放在致谢之前,并且与图表列表等使用相同的字体。
\documentclass[12pt]{report}
\pagestyle{plain}
\usepackage[acronym,toc]{glossaries} %Allows creation of a glossary page
\makeglossaries
\newglossaryentry{Ppump}
{
name=$P_{Pump}$,
description={Pump wavelength (W)}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Begin document %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\thispagestyle{empty}
\pagenumbering{roman}
\doublespacing
\include{abstract}
\include{table_of_contents}
\singlespacing
\include{acknowledgements}
\end{document}
有关更多信息,这是我的目录 (table_of_contents.tex) 的代码。
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Sets up Table of Contents %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\addcontentsline{toc}{section}{Table of Contents}
\tableofcontents
\newpage
\addcontentsline{toc}{section}{List of Figures}
\listoffigures
\newpage
\addcontentsline{toc}{section}{List of Tables}
\listoftables
\addcontentsline{toc}{section}{Glossary of Terms}
\printglossaries
\newpage
\addcontentsline{toc}{section}{Acknowledgements}
我正在写论文,所以我确实有不少用于不同部分的 .tex 文件,以便于调试(至少对我来说),因为它们大多数只是不同的章节,然后我可以稍后将它们包含在主文档中。无论如何,如果这个问题已经有人问过了,有人可以给我推荐链接吗?
答案1
您目前正在两次将词汇表添加到目录中。第一次是当您手动添加目录行时。第二次是当您将选项\printglossaries
传递toc
给时glossaries
。
方法 1
不要传递toc
给glossaries
:
\documentclass[12pt]{report}
\usepackage{filecontents}
\begin{filecontents}{table_of_contents.tex}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Sets up Table of Contents %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\addcontentsline{toc}{section}{Table of Contents}
\tableofcontents
\newpage
\addcontentsline{toc}{section}{List of Figures}
\listoffigures
\newpage
\addcontentsline{toc}{section}{List of Tables}
\listoftables
\addcontentsline{toc}{section}{Glossary of Terms}
\printglossaries
\newpage
\addcontentsline{toc}{section}{Acknowledgements}
\end{filecontents}
\begin{filecontents}{abstract.tex}
abstract
\end{filecontents}
\begin{filecontents}{acknowledgements.tex}
acknowledgements
\end{filecontents}
\pagestyle{plain}
\usepackage[acronym]{glossaries} %Allows creation of a glossary page
\makeglossaries
\newglossaryentry{Ppump}
{
name=$P_{Pump}$,
description={Pump wavelength (W)}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Begin document %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\thispagestyle{empty}
\pagenumbering{roman}
\include{abstract}
\include{table_of_contents}
\include{acknowledgements}
\gls{Ppump}
\begin{figure}
my figure
\caption{exciting figure}
\end{figure}
\begin{table}
\begin{tabular}{cc}
a & table
\end{tabular}
\caption{exciting table}
\end{table}
\end{document}
方法 2
配置toc
为按您的意愿运行:
\documentclass[12pt]{report}
\usepackage{filecontents}
\begin{filecontents}{table_of_contents.tex}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Sets up Table of Contents %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\addcontentsline{toc}{section}{Table of Contents}
\tableofcontents
\newpage
\addcontentsline{toc}{section}{List of Figures}
\listoffigures
\newpage
\addcontentsline{toc}{section}{List of Tables}
\listoftables
\clearpage
\printglossary[title={Glossary of Terms}]
\newpage
\addcontentsline{toc}{section}{Acknowledgements}
\end{filecontents}
\begin{filecontents}{abstract.tex}
abstract
\end{filecontents}
\begin{filecontents}{acknowledgements.tex}
acknowledgements
\end{filecontents}
\pagestyle{plain}
\usepackage[acronym, toc, section=section]{glossaries} %Allows creation of a glossary page
\makeglossaries
\newglossaryentry{Ppump}
{
name=$P_{Pump}$,
description={Pump wavelength (W)}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Begin document %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\thispagestyle{empty}
\pagenumbering{roman}
\include{abstract}
\include{table_of_contents}
\include{acknowledgements}
\gls{Ppump}
\begin{figure}
my figure
\caption{exciting figure}
\end{figure}
\begin{table}
\begin{tabular}{cc}
a & table
\end{tabular}
\caption{exciting table}
\end{table}
\end{document}