使用 LOF 样式列出首字母缩略词列表时,首字母缩略词与其描述之间的空格

使用 LOF 样式列出首字母缩略词列表时,首字母缩略词与其描述之间的空格

我使用以下代码在我的论文中创建首字母缩略词列表。但索引和其描述重叠。如何在它们之间添加合适的空间?

\documentclass[12pt, a4paper, oneside]{CIITThesissV1}
\usepackage{placeins}
\usepackage{soul}
\usepackage{acro}
\usepackage{mfirstuc}
\usepackage{tcolorbox}
\usepackage{etoolbox}
\usepackage{subdepth}
\usepackage{multirow}
\usepackage{framed}
\usepackage{sectsty}
\usepackage{graphicx}
\usepackage{graphics}
%\usepackage[table]{xcolor}
\usepackage{lscape}
\usepackage{amsfonts}
\usepackage{amstext}
\usepackage{amssymb}
\usepackage[english]{babel}
\usepackage{parskip}
\usepackage[export]{adjustbox}
\usepackage{pbox}
\usepackage{hhline}%%%
\usepackage{pdfpages}
\usepackage{rotating}
\usepackage{times}
\usepackage{epsfig}
\usepackage{booktabs}
\usepackage{float}
\usepackage{url}
\usepackage{nomencl}
\usepackage{amsmath}
\usepackage[utf8]{inputenc}
\usepackage{xcolor}
\usepackage{color, colortbl}
\usepackage{lipsum}
\usepackage{setspace}
\usepackage{afterpage}
\usepackage{pdflscape}
\usepackage{pstricks}
\usepackage{subfigure}
\usepackage{titlesec}
\usepackage{cases}
\usepackage[titles,subfigure]{tocloft}
\usepackage{apacite}
\usepackage{amsmath}
\usepackage[hypcap=false]{caption}
\usepackage{authblk}
\usepackage{rotating}
\usepackage{pifont}
\usepackage{url}
\usepackage{array}
\usepackage{enumitem}
\usepackage{bookmark}
\usepackage{arydshln}
\usepackage{booktabs}
%\usepackage[ruled,linesnumbered]{algorithm2e}
\usepackage{hyperref}
\usepackage{algorithm}
\usepackage{algpseudocode}
%\usepackage[noend]{algpseudocode}
\usepackage{longtable}
\usepackage[toc,page]{appendix}
\usepackage{matlab}
\usepackage{listings}
\lstset{breaklines=true}
\usepackage{lineno}
\usepackage[acronym]{glossaries}
\usepackage{titlesec}
\usepackage{tikz,pgfplots}
\def\BibTeX{{\rm B\kern-.05em{\sc i\kern-.025em b}\kern-.08em
    T\kern-.1667em\lower.7ex\hbox{E}\kern-.125emX}}

\acsetup{
  index = false,
  list-long-format = \makefirstuc ,
  list-name={LIST OF ACRONYMS},
  list-style = lof ,
  list-heading = lof, %because I want the list with same style as LOF
  extra-style = toc
}

\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
}

\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} 
}
\include{cover9_abstract} %please consider that I am writing some text here, and using \ac{DBSCAN} to include acronym
\renewcommand{\contentsname}{TABLE OF CONTENTS}
\tableofcontents
\include{tables}
\include{figures}
\addcontentsline{toc}{chapter}{List of Acronyms}
\setlength\cftparskip{-2pt}
\setlength\cftbeforechapskip{0pt}
\printacronyms[sort=true]
\clearpage

\end{document} 

\ac{DBSCAN}在摘要中使用了示例。列表打印得很好,但我不知道如何调整首字母缩略词索引和其描述之间的间距。它给了我以下输出。 索引和缩写描述重叠 另外,我想使用 为首字母缩略词列表标题加下划线\textwidth

请帮忙。

答案1

根据acro软件包文档,list-short-width您需要更改的选项应该是:

此选项控制 lof 列表样式中首字母缩略词的缩写形式保留的宽度。

根据手册,默认值为3em。如果使用6em,如下面的 MWE 所示,应删除重叠部分:

在此处输入图片描述

\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} 

答案2

acro版本 3 中列表模板的定义方式已完全改变。随着这一变化,该选项list-short-width已消失。但由于问题已经加载,因此可以使用 更改模板tocloft开头的数字宽度。lof\SetupAcroTemplate

对于lof模板,我们acro只需复制定义即可\l@figure

  1. 需要加载acro tocloft
  2. 改变\cftfignumwidth

例如:

\documentclass{article}
\usepackage{tocloft,acro}

\acsetup{ list/template = lof }

\SetupAcroTemplate[list]{lof}{%
  \setlength\cftfignumwidth{6em}%
}

\DeclareAcronym{DBSCAN}{
  short = DBSCAN ,
  long = Density-Based Spatial Clustering of Applications with Noise ,
  index = DBSCAN
}

\begin{document}

\ac{DBSCAN}

\printacronyms

\end{document}

在此处输入图片描述

答案3

我找不到莱安德里斯 list-short-width在里面acro 3.2 文档。它肯定从 2.10c 开始就被删除了。

灵感来自米科我建议使用托克洛夫特

\usepackage[titles]{tocloft}
\cftsetindents{figure}{0em}{3.5em}
\cftsetindents{table}{0em}{3.5em}
\printacronyms

更改3.5em直到您有足够的空间容纳简短形式。请记住,这将更改所有图形和表格,以便它们同步。但您可以在之后将其重置为标准值\printacronyms

\cftsetindents{figure}{0em}{2.3em}
\cftsetindents{table}{0em}{2.3em}

相关内容