我想将我的参考书目添加到目录中。我这样做了,\addcontentsline{toc}{subsection}{\protect\numberline{2.2}Literature}
但似乎章节编号只显示在目录中,而不显示在文章中,请参阅:
此外,将参考书目添加到目录中后,以下小节(Acronyms
)的编号被损坏。
以下是 MWE 的内容:
\documentclass[11pt]{article}
\usepackage{url}
\usepackage[toc, acronym, numberedsection, section=subsection]{glossaries}
\makeglossaries
\newacronym{cpu}{CPU}{Central Processing Unit}
\newacronym{isp}{ISP}{Internet Service Provider}
\newacronym{dss}{DSS}{Decision Support System}
\newacronym{aes}{AES}{Advanced Encryption Standard}
\begin{document}
\tableofcontents
\section{A1}
\subsection{A1}
\gls{aes}
\subsection{A2}
\gls{cpu}, \gls{aes}
\subsection{A3}
\cite{whatisiot}
\section{B}
\subsection{B1}
\renewcommand\refname{Literature}
\addcontentsline{toc}{subsection}{\protect\numberline{2.2}Literature}
\bibliographystyle{plain}
\bibliography{mybibfile}
\printglossaries
\end{document}
答案1
一个解决方法是打印参考书目subsection
Literature
并留空\refname
。像这样:
\documentclass[11pt]{article}
\usepackage{url}
\usepackage[toc, acronym, numberedsection, section=subsection]{glossaries}
\makeglossaries
\newacronym{cpu}{CPU}{Central Processing Unit}
\newacronym{isp}{ISP}{Internet Service Provider}
\newacronym{dss}{DSS}{Decision Support System}
\newacronym{aes}{AES}{Advanced Encryption Standard}
\begin{document}
\tableofcontents
\section{A1}
\subsection{A1}
\gls{aes}
\subsection{A2}
\gls{cpu}, \gls{aes}
\subsection{A3}
\cite{whatisiot}
\section{B}
\subsection{B1}
\renewcommand\refname{\vspace{-1.5\baselineskip}}
%\addcontentsline{toc}{subsection}{\protect\numberline{2.2}Literature}
\subsection{Literature}
\bibliographystyle{plain}
\bibliography{mybibfile}
\printglossaries
\end{document}