Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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}
share|improve this question

1 Answer 1

up vote 4 down vote accepted

With your current settings, the List of Acronyms is typeset using a description environment, so you can change \descriptionlabel for the acronym environment using, for example:

\usepackage{etoolbox}
\AtBeginEnvironment{acronym}{%
  \renewcommand*\descriptionlabel[1]{\hspace\labelsep
                                \normalfont\bfseries\color{blue} #1}}

A complete example:

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

\AtBeginEnvironment{acronym}{%
  \renewcommand*\descriptionlabel[1]{\hspace\labelsep
                                \normalfont\bfseries\color{blue} #1}}

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

enter image description here

If you were using the optional argument for acronym with a value different than 1, then one simply would have to change \bflabel

\def\bflabel#1{{\textbf{\textsf{\color{blue}#1}}\hfill}}
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.