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.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This question already has an answer here:

I want it to capitalize the first letter of an expanded acronym used at the start of a sentence, like:

Application programming interfaces (APIs) are ...

I tried to define a new command \Acp for that purpose:

\usepackage[smaller,nohyperlinks]{acronym}
\acro{API}{application programming interface}
\newcommand{\Acp}[1]{\MakeUppercase\expandafter\acp{#1}}

However when I use it, it doesn't work as desired:

\Acp{API} are ...

produces

application programming interfaces (APIs) are ...

Unfortunately I can not use the glossaries package which accomplishes exactly that due to interpackate-incompatibilities.


I had a similar desire in the list of acronyms where I also wanted to capitalize all first letters. There I redefined a different command as suggested in Capitalize the first letter in acronym list:

\makeatletter
\patchcmd{\AC@@acro}{] #3}{] \MakeUppercase #3}{}{}
\patchcmd{\AC@@acro}{] #3}{] \MakeUppercase #3}{}{}
\makeatother

That works.

share|improve this question

marked as duplicate by clemens, Mico, Zarko, Thruston, ienissei May 3 at 11:33

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1  
What packages are you having a problem with in combination with glossaries? (I think glossaries is probably the best solution to this problem, so I am hoping that one can identify and fix the incompatibilities.) – mforbes Aug 22 '12 at 16:22
    
A duplicate to this question got more attention, and has an answer that might help, which I extended: tex.stackexchange.com/a/150798/28808 – Chris H Jan 10 '14 at 9:32

If you don't mind switching to a relatively new package you could use acro. It naturally provides the command you want:

\documentclass{article}
\usepackage{acro}
\usepackage{relsize}

\acsetup{short-format=\textsmaller}

\DeclareAcronym{API}{
  short = API ,
  long  = application programming interface
}

\begin{document}

\Acp{API}

\printacronyms

\end{document}

enter image description here

Disclaimer: I am the author

share|improve this answer

Since I did not want to change from acronym, for me the simple solution was as mentioned in this answer. Simply write the full acronym in your tet and then use the \acused{API} to mark it as used. See MWE:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[printonlyused,withpage]{acronym}

\title{Minimal Working Example}

\begin{document}
\maketitle

\section{Some Section}
 Application programming interface \acused{API} (\ac{API}).

\section*{List of Acronyms}
\begin{acronym}[MWE]
    \acro{API}{application programming interface}
\end{acronym}

\end{document}
share|improve this answer

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