I'm using the acronym
package in my document and in several instances I want to start a sentence with the expanded acronym. Is there any way of telling the package to capitalise the first letter?
For example:
\acrodef{TLA}{three-letter acronym}
\acrodefplural{TLA}{three-letter acronyms}
...end of one sentence. \aclp{TLA} are acronyms with three letters...
This will yield:
…end of one sentence. three-letter acronyms are acronyms with three letters…
Best Answer
This is a follow-up to Egreg's answer, basically the full set of
\Ac??
commands. Two points to note first:Somewhere was a stray trailing space that affected
\Acfp
(and the first use of\Acp
) - There was a space before the closing bracket. Oddly, it broke the original\acfp
and\acp
as well, which I'm sure to a finer mind than mine would indicate roughly where in the redefinitions it is. I just terminated pretty much all the lines with a % without paying any attention to what they did.Note the use of
\robustify
(frometoolbox
), which is required if you want to use acronyms in headings (perhaps more likely now they can start with caps)I don't pretend to understand the code, just that having done Egreg's "exercise for the reader" and found a couple of extra complexities along the way I thought I'd share.
EDIT: If you want to define your acronyms using
\acro
in anacronym
environment, the above code doesn't give you the caps, because the line that stores the acronym is in a different macro and doesn't get replaced with the rather neat definition that Egreg came up with.The solution is to also patch (well, overwrite)
acro
:Edit 2: Note that this 2nd block needs to be inserted into the first block before the last (
\makeatother
) line.