1

I am using the following code to create List of Acronyms in my thesis. But the index and its description are overlapping. How to add suitable space between them?

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

And I am using \ac{DBSCAN} for example in Abstract. The list is printing fine, but I dont know how to adjust the space between acronym index and its description. It is giving me the following ouput. Index and Description of Acronym are overlapping Also, I want to underline LIST OF ACRONYMS heading using \textwidth.

Kindly help.

Anees
  • 157
  • Welcome to TeX.SX! Could you please make sure, your example is a self contained minimal working example (MWE) that others can compile and get the same output you show? Currently others can't since your MWE includes external files others don't have access to. Also, there is only one \DeclareAcronym command in your preamble. Lastly, the documentclass is also missing. – leandriis Dec 27 '19 at 09:58
  • Please also clarify: \acsetup and \DeclareAcronym are commands fro the acro package. You don't load this package in your preamble but you load glossaries instead. The latter has its own commands. Please clarify which package you actually want to use. You will also need \usepackage{mfirstuc} in order to use \makefirstuc. – leandriis Dec 27 '19 at 10:01
  • @leandriis my apologies for not providing the MWE earlier. Edited the question, kindly check it now. – Anees Dec 27 '19 at 10:07
  • Thanks for your edit. Some general comments regarding your preamble: Please go through it and reevaluate if you really need all of the packages you load. There is acro, nomencl and glossaries. Do you really use all of them? Lastly, also make sure, that hyperref is the last package in your preamble. (There are only a few exceptions to that.) You can also remove graphics and replace \usepackage{xcolor}\usepackage{color, colortble} with a simple \usepackage[table]{xcolor}. – leandriis Dec 27 '19 at 10:12
  • 1
    Finally, CIITThesissV1 is not a standard class. Please check if the problem persists if you use a standard class. If so, your MWE can use this standard class (such as article). If not, please include a link to the CIITThesissV1.cls file. – leandriis Dec 27 '19 at 10:14
  • @leandriis Thank you for pointing out those packages. Will be re-evaluating them first thing. https://1drv.ms/u/s!An78Os52ggAHhCSO6zHz0WNM9lDF?e=Zi0Fe8 I have uploaded my cls file here, please do take a look, if it helps. – Anees Dec 27 '19 at 10:23

3 Answers3

2

According to the acro package documentation, list-short-width should be the option you need to change:

This option controls the width reserved for the short forms of the acronyms in the lof list style.

According the the manual, the default is 3em. If you use 6em instead, as shown in the following MWE, the overlap should be removed:

enter image description here

\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} 
leandriis
  • 62,593
  • Thank you so much. Seriously cant thank you enough. You are a life saver. – Anees Dec 27 '19 at 10:35
  • @leandriss Could you please be able to tell me how to underline the heading List of Acronyms up to text width? As my LOF and LOT headings are underlined. – Anees Dec 27 '19 at 10:37
  • @Anees: Please ask this as a nwe, separate follow-up-question to this one. – leandriis Dec 27 '19 at 10:42
2

The way how list templates are defined in acro changed completely with version 3. With this change the option list-short-width has disappeared. But since the question already loads tocloft a possibility is to change the numwidth at the beginning of the lof template with \SetupAcroTemplate.

For the lof template acro simply copies the definition of \l@figure so we

  1. need to load acro after tocloft and
  2. change \cftfignumwidth.

An example could be as follows:

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

enter image description here

cgnieder
  • 66,645
0

I can't find leandriis list-short-width in the acro 3.2 documentation. It must have been removed since 2.10c.

Inspired by Miko I suggest using tocloft:

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

Change 3.5em until you have enough space for the short form. Keep in mind this will change all figures and tables so they are in sync. But you could just reset it the standard value after \printacronyms:

\cftsetindents{figure}{0em}{2.3em}
\cftsetindents{table}{0em}{2.3em}
Hauke
  • 1