Sébastien Peterson-Boudreau <[email protected]> wrote:
>
> In technical writing, it is a well-understood practice to expand the meaning
> of
> an abbreviation/acronym on its first usage. It is also sometimes
> recommended to additionally expand it after some stretch of text (I've
> seen suggestions as frequently as each paragraph, to infrequently as
> each section/chapter; I am a fan of re-expansion after a page break), to
> remind the reader in case they forgot since they first saw it.
>
> I was wondering if anyone had ever written a macro to automate this? I
> haven't actually made any attempts myself, which I know is a little
> rude, but I don't really have need of one right now, and am moreso
> curious about the techniques that could be used to accomplish this.
I’ve seen some attempts at this. Often, they’re centered around a central
library. So the library might be a tab-delimited text file:
EU European Union
IBM International Business Machines
HTML HyperText Markup Language
SGML Standard Generalized Markup Language
USA United States of America
XML eXtended Markup Language
If you want to include the expanded text only with the first instance of the
acronym, you might be better off creating a preprocessor and a macro that
the preprocessor keys on… say, `.ACRO`. The preprocessor would read in
the library, then search for `.ACRO` lines. The first time it encounters:
.ACRO HTML
It might output `HTML (HyperText Markup Language)`, but subsequent
macros would only output its argument. You should extend your macro
package to output the argument if you don’t invoke the preprocessor.
If you want to start over with each chapter, a simple macro could clear the
“we saw this” variables.
— Larry