I want to define a command that takes a sentence, a word or several words as input and bolds the first letter of each word. I need this mostly for abbreviations and so far I have done it manually in this way:
\documentclass[a4paper]{article}
\begin{document}
GNU is a recursive acronym for ``\emph{\bf{G}\normalfont{nu's} \bf{N}\normalfont{ot} \bf{U}\normalfont{nix}}'', chosen because GNU's design is Unix-like, but differs from Unix by being free software and containing no Unix code.
\end{document}
What I want to do, is to define a command like \BoldAbbrv
that does the job. In other words:
\documentclass[a4paper]{article}
%\newcommand{\BoldAbbrv}...IMPLEMENTATION
\begin{document}
GNU is a recursive acronym for ``\BoldAbbrv{Gnu's Not Unix}'', chosen because GNU's design is Unix-like, but differs from Unix by being free software and containing no Unix code.
\end{document}
How can I do that? Moreover, a related question that came to my mind while thinking about this problem, is there such concept as wildcard in latex (e.g. "*" as zero or more characters and "_" as a single one)?
Best Answer
Here's an idea using
expl3
: