符号列表不会像第一张图那样打印在“符号列表”标题后的同一页中。相反,它会像第二张图一样打印在下一页中。MWE 为:
\documentclass[a4paper,openany]{report}
\usepackage[acronym,section,nomain]{glossaries}
\usepackage{fancyhdr}
\usepackage{amssymb}
\usepackage{amsmath}
\newglossary[slg]{symbolslist}{syi}{syg}{}
\makeglossaries
\newglossaryentry{symb:C}
{name={\ensuremath{C}},description={SVM Tuning Parameter},
sort=symbolc,type=symbolslist}
\newglossaryentry{symb:c1}{name={\ensuremath{c_b}},
description={Optimal Number of Cluster Center},
sort=symbolcent, type=symbolslist}
\newglossaryentry{symb:d}{name={\ensuremath{D}},
description={Dataset},sort=symbold,type=symbolslist}
\newglossaryentry{symb:c}{name={\ensuremath{c}},
description={Number of Cluster Center},
sort=symbolcen,type=symbolslist}
\setlength{\headheight}{12pt}
\lhead[\sl\leftmark]{\sl\leftmark}
\rhead[\rm]{\rm}
\begin{document}
\chapter*{List of Symbols}
\gls{symb:c}, \gls{symb:C}, \gls{symb:d}, \gls{symb:c1}
\printglossary[type=symbolslist]
\end{document}
请帮助任何人。
答案1
使用title=
选项\printglossaries
并删除\chapter*{List of ...}
。
另外不要使用\sl
和\rm
命令,它们已经过时了。此外,如果需要,请glossaries
在此处将其作为最后一个包加载,即使在之后也是如此hyperref
。
\documentclass[a4paper,openany]{report}
\usepackage{fancyhdr}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{blindtext}
\usepackage[acronym,section,nomain]{glossaries}
\newglossary[slg]{symbolslist}{syi}{syg}{}
\makeglossaries
\newglossaryentry{symb:C}
{name={\ensuremath{C}},description={SVM Tuning Parameter},
sort=symbolc,type=symbolslist}
\newglossaryentry{symb:c1}{name={\ensuremath{c_b}},
description={Optimal Number of Cluster Center},
sort=symbolcent, type=symbolslist}
\newglossaryentry{symb:d}{name={\ensuremath{D}},
description={Dataset},sort=symbold,type=symbolslist}
\newglossaryentry{symb:c}{name={\ensuremath{c}},
description={Number of Cluster Center},
sort=symbolcen,type=symbolslist}
\setlength{\headheight}{12pt}
\lhead[\slshape\leftmark]{\slshape\leftmark}
\rhead[\rmfamily]{\rmfamily}
\begin{document}
\pagestyle{fancy}
\chapter{Foo}
\blindtext[5]
\section{Foo section}
%\chapter*{List of Symbols}
\gls{symb:c}, \gls{symb:C}, \gls{symb:d}, \gls{symb:c1}
\cleardoublepage
\printglossary[title={List of Symbols},type=symbolslist]
\end{document}