如何给缩略词列表的标题加下划线?

如何给缩略词列表的标题加下划线?

以下是我的平均能量损失我的论文,用来创建一个缩略词列表

\documentclass{article}
\usepackage{acro}
\usepackage{mfirstuc}


\acsetup{
  index = false,
  list-long-format = \makefirstuc ,
  list-name={LIST OF ACRONYMS},
  list-style = lof , %because I want the list to be similar as LOF
  list-heading = lof,
  extra-style = comma, 
  list-short-width =6em
}

\DeclareAcronym{DBSCAN}{
  short = DBSCAN ,
  long = Density-Based Spatial Clustering of Applications with Noise ,
  short-plural ={s} ,
  long-plural = {s},
  class = general ,
  short-format = \scshape ,
  index = DBSCAN
}

\begin{document}

\ac{DBSCAN}

\printacronyms[sort=true]

\end{document}

我得到以下输出

在此处输入图片描述

我想要的是,强调标题缩略词列表就像下面这样

在此处输入图片描述

此外,我怎样才能获得与图片列表. 任何帮助都将不胜感激。

下面是我相信会用来生成 LOF 的代码,包括序言中的一些其他代码。

\titleformat{\chapter}[display]   
{\normalfont\huge\bfseries}{\chaptertitlename\ \thechapter}{20pt}{\Huge}   
\titlespacing*{\chapter}{0pt}{0pt}{30pt}

\setlength\cftbeforechapskip{10pt}
\renewcommand\cftfigafterpnum{\vskip8pt\par}
\renewcommand\cfttabafterpnum{\vskip8pt\par}
\renewcommand\cftchapafterpnum{\vskip8pt}
\renewcommand\cftsecafterpnum{\vskip8pt}

\makeatletter
\pretocmd{\chapter}{\addtocontents{toc}{\protect\addvspace{15\p@}}}{}{}
\pretocmd{\section}{\addtocontents{toc}{\protect\addvspace{15\p@}}}{}{}
\makeatother


\makeatletter
\def\BState{\State\hskip-\ALG@thistlm}
\newenvironment{figurehere}{\def\@captype{figure}}{}
\makeatother

\renewcommand\cftchapfont{\textbf\normalfont}
\renewcommand\cftchappagefont{{\normalfont}}
\AtBeginDocument{\renewcommand\contentsname{TABLE OF CONTENTS}}
\AtBeginDocument{\renewcommand\contentsname{\leftline{LIST OF FIGURES}}}
\titleformat{\chapter}[display]
{\bfseries\Large}
{\vspace{0.005cm}\centering \Large\bfseries{Chapter \thechapter}}
{1ex}
{\bfseries\Large\centering}
\begin{document}
\pagestyle{fancy}
\fancyhf{}
\rhead{\textbf{\textit{Annex M1}}}
\lhead{}
\rfoot{ \thepage}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}

\fancypagestyle{plain}{
\fancyhf{}
\fancyfoot[OR]{\thepage}
\fancyfoot[EL]{\thepage}
\renewcommand{\headrulewidth}{0pt} 
}
\tableofcontents
\include{tables}
\include{figures}
\addcontentsline{toc}{chapter}{List of Acronyms}
\setlength\cftparskip{-2pt}
\setlength\cftbeforechapskip{0pt}
\printacronyms[sort=true]
\clearpage
\end{document}

答案1

要影响标题的外观,例如添加一行,可以使用包\DeclareAcroListHeading中的宏acro,如第 39 页所述手动的。在下面的 MWE 中,添加了一条填充文本空间的线,即与文本具有相同的宽度和位置。1Em添加了一个负空间,以将线稍微向上移动。

\DeclareAcroListHeading用于格式化标题文本本身,文本将自动作为定义的宏的参数给出。Here\section*用于此目的,它是列表标题的默认设置,结果与原始列表标题的外观相同。

如果需要,您可以调整线条的宽度和位置和/或首字母缩略词列表中的条目,以使它们与图形列表的外观更加匹配。

梅威瑟:

\documentclass{article}
\usepackage{acro}
\usepackage{mfirstuc}

\newcommand{\sectionuline}[1]{%
\section*{#1}
\vspace{-1Em}
\noindent\hrulefill
}
\DeclareAcroListHeading{loa}{\sectionuline}

\acsetup{
  index = false,
  list-long-format = \makefirstuc ,
  list-name={LIST OF ACRONYMS},
  list-style = lof , %because I want the list to be similar as LOF
  list-heading = loa, % note that the new macro is used here
  extra-style = comma, 
  list-short-width =6em
}

\DeclareAcronym{DBSCAN}{
  short = DBSCAN ,
  long = Density-Based Spatial Clustering of Applications with Noise ,
  short-plural ={s} ,
  long-plural = {s},
  class = general ,
  short-format = \scshape ,
  index = DBSCAN
}

\begin{document}

\ac{DBSCAN}

\printacronyms[sort=true]

\end{document} 

结果:

在此处输入图片描述

相关内容