[Tex/LaTex] New command to bold within small caps

fonts

I'd like to have a command to write a word in all small caps of equal size (no initial large capital letter), with a specified central portion in bold.

\mkboldcaps{Aver}{ag}{e}

would produce the output
AVER AG E (no spaces)

So far, I have the following command, which makes a word into all small caps of the small size:

\newcommand{\smallcaps}[1]{\textsc{\MakeLowercase{#1}}}

The trouble comes when I try to combine these. In the following command,

\newcommand{\makeboldcaps}[3]{\smallcaps{#1}{\textbf{#2}}\smallcaps{#3}}

the middle portion is successfully made bold, but it is not in small caps. Adding a \textsc to the central portion messes up the rest of the command. Any suggestions?

Best Answer

You have to ensure that the font family used has boldface small caps. The standard Computer Modern font family hasn't them, but the European Modern fonts do.

\documentclass{article}
\usepackage[T1]{fontenc}

\newcommand{\mkboldcaps}[3]{%
 {% keep the font change local
  \scshape\MakeLowercase{#1}\textbf{\MakeLowercase{#2}}\MakeLowercase{#3}%
 }%
}

\begin{document}
\mkboldcaps{Aver}{ag}{e}
\end{document}

enter image description here

Note that you need that your TeX distribution includes the CMSuper font package, or you'll get the fonts in bitmap form.