[Tex/LaTex] How to change the color of the short version of the acronym in the list of acronym

acronymscolorhyperref

I use the Acronym package. In the printed list of acronym (usually put at the beginning of the document) there is the short version of the acronym (in bold font) and after the full name of the acronym (in normal font).

I want to change the color of the short version of each acronym to blue (for example) and keep the color of the full name of the acronym in black.

How to do it ?

\documentclass[12pt,a4paper,english,french]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8x]{inputenc}
\usepackage[frenchb]{babel}
\usepackage{lmodern}
\usepackage{xcolor}
\usepackage[withpage]{acronym}
\usepackage[colorlinks=true, linkcolor=blue]{hyperref}
\hypersetup{colorlinks=true,citecolor=blue} 

\title{My Thesis Document}
\begin{document}
\maketitle
\newpage
{\setlength{\baselineskip}{1.2\baselineskip} 
\tableofcontents\par}
\hrule
\vspace{1cm}
\section*{List of Acronyms}  
\begin{acronym} \renewcommand{\\}{}  
\acro{TTC}{Tunisian Tourism Company} % <---- Make TTC in blue for example
\acro{CBT}{Central Bank of Tunisia}
% etc
\end{acronym}
\newpage
\begin{spacing}{1.5}
\section{First Section}
Text about the \ac{TTC}, etc
\section{Second Section}
Text about the \ac{CBT}, etc
\end{spacing}
\end{document}

Best Answer

The accepted answer would not work for me. Instead, the following would do the desired job of coloring the acronym's shorthands in their listing:

\AtBeginEnvironment{acronym}{%
  \renewcommand*{\aclabelfont}[1]{\textbf{\acsfont{\color{blue}#1}}}}

This command modifies the command \aclabelfont which is used to display the shorthands.

This example shows how to use the code above:

\documentclass{article}
\usepackage{xcolor}
\usepackage{etoolbox}
\usepackage[printonlyused]{acronym}

\AtBeginEnvironment{acronym}{%
  \renewcommand*{\aclabelfont}[1]{\textbf{\acsfont{\color{blue}#1}}}}

\begin{document}

\section{List of Acronyms}
\begin{acronym}
  \acro{ML}{Machine Learning}
  \acro{NN}{Neural Networks}
  \acro{SE}{Something Else}
\end{acronym}

\section{A Section with Acronyms}
This section uses the acronyms \ac{ML} and \ac{NN}. Notice how only the colors of the acronym shorthands in the list of acronyms changes. The acronyms' color in the text does not change.

\end{document}

enter image description here

Related Question