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 am using \usepackage[printonlyused,withpage]{acronym} to use acronyms in my thesis But I want to get

enter image description here

instead of

enter image description here

I am using the following code:

\documentclass{article}
\usepackage[colorlinks]{hyperref}
\usepackage[printonlyused,withpage]{acronym}
\begin{document}

\section{Intro}
Analisis de Componentes Principales (\em{\ac{PCA}}). \ac {PCA}.

\section{Acronyms}
\begin{acronym}
\acro{PCA}{Principal Component Analysis}
\end{acronym}

\end{document}
share|improve this question
add comment

1 Answer 1

up vote 4 down vote accepted

You'll need to redefine the internal command that typesets the first appearance of an acronym, \@acf. This will change all first appearances of acronyms, though. If you only want it for the one instance it's easier just to place \acs and \acl manually.

\documentclass{article}
\usepackage[colorlinks]{hyperref}
\usepackage[printonlyused,withpage]{acronym}

\makeatletter
\renewcommand*{\@acf}[1]{%
  \ifAC@footnote
    \acsfont{\AC@acs{#1}}%
    \footnote{\AC@placelabel{#1}\hskip\z@\AC@acl{#1}{}}%
  \else
    \acffont{%
      \acfsfont{\acsfont{\AC@acs{#1}}}% I removed the brackets and switched this line ...
      \nolinebreak[3] %
      \AC@placelabel{#1}\hskip\z@\AC@acl{#1}% ... with this one
    }%
  \fi
  \ifAC@starred\else\AC@logged{#1}\fi}
\makeatother

\begin{document}

\section{Intro}
Analisis de Componentes Principales (\emph{\ac{PCA}}). \ac {PCA}.

\section{Acronyms}
\begin{acronym}
\acro{PCA}{Principal Component Analysis}
\end{acronym}

\end{document}

enter image description here

Note that I also replaced \em with \emph, see “What is the difference between \em and \emph?” for a discussion of the differences.

share|improve this answer
add comment

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.