MakeIndex, Nomenclature, Glossaries and AcronymsHow to add a horizontal rule after "List of Acronyms" using glossaries package?

Information and discussion about MakeIndex - the tool to generate subject indices for LaTeX documents.
Post Reply
Septic6110
Posts: 2
Joined: Thu Mar 06, 2025 2:06 pm

How to add a horizontal rule after "List of Acronyms" using glossaries package?

Post by Septic6110 »

I am writing my thesis using the `report` class in LaTeX. The Table of Contents (`\tableofcontents`) includes a horizontal rule below its title, using the

Code: Select all

\renewcommand\cftaftertoctitle
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
command. However, when I generate the List of Acronyms using `\printnoidxglossary[type=\acronymtype]` from the `glossaries` package, there is no horizontal rule below its title, and I do not know how to do this. I have included the MWE below using a standard thesis template and other packages.

Code: Select all

Code, edit and compile here:
\documentclass[a4paper,12pt,twoside,openright]{report}
\usepackage[a4paper]{geometry}
\geometry{verbose,tmargin=1in,bmargin=1in,lmargin=1.25in,rmargin=1in}
\usepackage{authblk,lineno,url,sectsty}
\usepackage[dvipsnames]{xcolor}
\usepackage{lipsum}
\usepackage{emptypage}
\renewcommand{\bibname}{References}
\usepackage{array,float,multirow,graphicx,setspace,cite,url,titlesec,tocloft}
\usepackage{datetime}
\usepackage{amsmath,amsfonts,mathtools,notoccite}
\usepackage{chngcntr,pdflscape,enumitem,algorithm,algorithmic, subcaption}
\usepackage{bm}
\usepackage[colorlinks=true, urlcolor=cyan, citecolor=blue]{hyperref}
\usepackage{cleveref}
\usepackage[acronym,nogroupskip,style=long3col]{glossaries}
\makenoidxglossaries
\setacronymstyle{long-sc-short}
%%%%%%% Header-Footer %%%%%%%%%%%%%%%
\usepackage{fancyhdr}\pagestyle{fancy}
\fancyhf{}
\fancyhead[LE]{\rightmark}
\fancyhead[RO]{\leftmark}
\fancyfoot[C]{\thepage}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\renewcommand{\chaptermark}[1]{\markboth{#1}{}}
\renewcommand{\sectionmark}[1]{\markright{#1}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\numberwithin{equation}{section}
\linespread{1.3}
\titleformat{\chapter}[display]
{\normalfont \huge \filleft \bfseries}{\chaptertitlename\ \thechapter}{8pt}{\LARGE}
\titlespacing*{\chapter}{0pt}{0pt}{10pt}
 
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
I want to achieve the following:
1. A horizontal rule appears below "**List of Acronyms**", just like it does for the **Table of Contents**.
2. Similarly, a horizontal rule appears below **References**.

Efforts: I have included the following line

Code: Select all

\printnoidxglossary[type=\acronymtype, title=\vspace{-1mm}{\vspace{0.7\baselineskip} \huge List of Acronyms \vspace{-0.3\baselineskip} \rule{\linewidth}{2pt}}]
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
But this is a very hacky way, and it still has not achieved the effect, as there is some vertical space (when you run the MWE), and the visual appearance is not similar to the List of tables or List of figures—any better way of doing this.
Last edited by Septic6110 on Sat Mar 08, 2025 5:54 am, edited 7 times in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Bartman
Posts: 369
Joined: Fri Jan 03, 2020 2:39 pm

Re: How to add a horizontal rule after "List of Acronyms" using glossaries package?

Post by Bartman »

Please remove the (two) obstacles that prevent your example from running without errors. It is also welcomed if you share your crossposts.

Have a look at the last optional argument of the \titleformat command in the titlesec package manual.
Septic6110
Posts: 2
Joined: Thu Mar 06, 2025 2:06 pm

Re: How to add a horizontal rule after "List of Acronyms" using glossaries package?

Post by Septic6110 »

Thank you for your response. I have removed the obstacles, and the code is running fine now. My bad for not testing in the first place. This is my first post in this forum. Here is a similar question that I have asked in a similar forum.
https://tex.stackexchange.com/questions ... of-conten
I could produce a horizontal rule, but the white space between the rule and the titles is excessive when you compare it with another listing like "List of Figures" and "List of Tables" (as you can see in the output pdf).

The horizontal rule is achieved using command.

Code: Select all

\cftafterloftitle
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
I could not find any similar command in the glossaries package.
I have partially achieved my objective, and it probably works fine, but if there is any other method that can give me the stated output, it would be nice.

Please share if there is any way to use glossaries or another package.
Post Reply