1

Following is my MWE of my thesis, using to create a LIST OF ACRONYMS.

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

I am getting the following output

enter image description here

What I want is, to underline the heading of LIST OF ACRONYMS just like the following

enter image description here

Moreover, how could I get the same font as LIST OF FIGURES. Any help would be highly appreciated.

Below is the code, I believe, would have been used to generate LOF including some of the other code in the preamble.

\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}
4
  • Could you please also include the code used to generate the lof-heading?
    – Skillmon
    Dec 27, 2019 at 10:59
  • @Skillmon Thank you for your response, I am editing my question to post the code. Please take a look.
    – Anees
    Dec 27, 2019 at 11:03
  • Your first MWE uses article, your second code block sets the style of the \chapter headings. Which class are you actually using?
    – Skillmon
    Dec 27, 2019 at 11:09
  • I asked two questions here tex.stackexchange.com/questions/521956/… . I got answered to one. I asked the 2nd one here. My apologies if I was not able to clearly mention the question. This post includes my whole preamble and the class I am using.
    – Anees
    Dec 27, 2019 at 11:12

1 Answer 1

1

To influence the appearance of the heading, such as adding a line, you can use the \DeclareAcroListHeading macro from the acro package as described on page 39 of the manual. In the MWE below a line is added that fills the text space, i.e., the same width and position as the text. A negative space of 1Em is added to shift the line a bit up.

\DeclareAcroListHeading is intended to format the header text itself, and the text is autmoatically given as an argument for the macro that is defined. Here \section* is used for that, which is the default for list headings and results in the same appearance as the original list heading.

You can adjust the width and position of the line and/or the entries in the list of acronyms to make them match the appearance of the list of figures more closely, if required.

MWE:

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

Result:

enter image description here

1
  • Thank you so much. Much appreciated.
    – Anees
    Dec 27, 2019 at 11:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .