[Tex/LaTex] Can small-caps be automated for abbreviations and acronyms

acronymsautomationsmall-caps

Is there a way to force LaTeX to automatically use small-caps for abbreviations and acronyms (or more specifically, strings of two or more uppercase letters)?

Best Answer

I think it's difficult to implement such macros. However, we can do it with help from some preprocess. It easy to write a script to do this. For example, an one-line script of sed:

sed -e "s/\(\s\)\([A-Z]\+\)\([^A-Z]\)/\1\\\textsc{\2}\3/g" foo.tex

You may modify it as your wish.

On windows platform sed have to be installed manually, from GNUWin32 or MingW. Just write a batch file and configure the editor to call it.