我正在使用词汇表包并制作首字母缩略词列表和符号列表。除了一个格式问题外,我一切都正常。上述两个列表的标题与我的图表列表和表格列表的格式不同(居中且字体较小)(左对齐且字体较大)。我希望我的首字母缩略词和符号列表的标题具有与表格和图表列表相同的格式。
下面是我想要的表格列表的示例
但我的首字母缩略词列表如下:
我的首字母缩略词的打印命令如下:
\printglossary[type=\acronymtype,style=list,title=List of Acronyms]
如果有人能在这里帮助我,我将不胜感激。我的 LaTeX 技能中等。
\documentclass[12pt]{report}
\usepackage{sectsty}
\allsectionsfont{\bfseries}
\chapterfont{\centering\Large}
\sectionfont{\normalsize}
\subsectionfont{\normalsize}
\usepackage[subfigure]{tocloft}
\usepackage{tocloft}
\renewcommand{\cftchappresnum}{Chapter }
\renewcommand{\cftchapaftersnum}{:}
\renewcommand{\cftchapnumwidth}{7em}
\newcommand*\updatechaptername{%
\addtocontents{toc}{\protect\renewcommand*\protect\cftchappresnum{Appendix }}
}
\usepackage[nogroupskip,nonumberlist,acronym]{glossaries}
\newglossary[slg]{symbolslist}{syi}{syg}{List of Symbols}
\makeglossaries
\newacronym{sa}{SA}{sample acronym}
\newglossaryentry{Pi}{
name=$\pi$,
description={A mathematical constant whose value is the ratio of any circle's circumference to its diameter.},
sort=symbpi, type=symbolslist
}
\usepackage{subfigure}
\begin{document}
\tableofcontents
\listoftables
\printglossaries
\include{Sample}
\chapter{Sample}
This is my \gls{sa} and I can use it again. This is a symbol \gls{Pi}.
\begin{table}
\caption{Sample Table}
\end{table}
\updatechaptername
\end{document}
答案1
是该tocloft
包改变了 etc 的样式\listoftables
,但它不使用标准\section
或\chapter
命令,这就是首字母缩略词列表不匹配的原因。您需要修改的定义\glossarysection
以使其匹配:
% arara: pdflatex
% arara: makeglossaries
% arara: pdflatex
% arara: pdflatex
\documentclass[12pt]{report}
\usepackage{subfigure}
\usepackage{sectsty}
\allsectionsfont{\bfseries}
\chapterfont{\centering\Large}
\sectionfont{\normalsize}
\subsectionfont{\normalsize}
\usepackage[subfigure]{tocloft}
\renewcommand{\cftchappresnum}{Chapter }
\renewcommand{\cftchapaftersnum}{:}
\renewcommand{\cftchapnumwidth}{7em}
\newcommand*\updatechaptername{%
\addtocontents{toc}{\protect\renewcommand*\protect\cftchappresnum{Appendix }}
}
\usepackage[nogroupskip,nonumberlist,acronym]{glossaries}
\newglossary[slg]{symbolslist}{syi}{syg}{List of Symbols}
\makeglossaries
\renewcommand{\glossarysection}[2][\theglstoctitle]{%
\def\theglstoctitle{#2}%
\vspace{\cftbeforelottitleskip}%
\par\noindent
{\cftlottitlefont #2}{\cftafterlottitle}%
\vskip\cftafterlottitleskip
% Uncomment the next line if you want an entry in the table of contents:
% \addcontentsline{toc}{chapter}{\numberline{}#1}%
}
\newacronym{sa}{SA}{sample acronym}
\newglossaryentry{Pi}{
name=$\pi$,
description={A mathematical constant whose value is the ratio of any circle's circumference to its diameter.},
sort=symbpi, type=symbolslist
}
\begin{document}
\tableofcontents
\listoftables
\printglossaries
\chapter{Sample}
This is my \gls{sa} and I can use it again. This is a symbol \gls{Pi}.
\begin{table}
\caption{Sample Table}
\end{table}
\updatechaptername
\end{document}
得出的结果为:
编辑:
如果您想在每个词汇表后插入分页符,您可以执行以下操作:
\renewcommand*{\glossarypostamble}{\clearpage}
或者,如果您想增加每个词汇表后的垂直空间,您可以执行以下操作:
\renewcommand*{\glossarypostamble}{\vspace*{1cm}}
(更改1cm
为适当长度。)