6

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?

pomegranate
  • 193
  • 1
  • 4

1 Answers1

6

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.

egreg
  • 1,121,712
  • Why the repetition? Why not \scshape\MakeLowercase{#1\textbf{#2}#3} ? – pst Apr 21 '14 at 07:23
  • @pst Why not? I prefer \textbf{\MakeLowercase{...}} that makes clearer what's wanted. But it's just a matter of preferences. – egreg Apr 21 '14 at 08:50
  • OK! For me it's less clear when it seems like there are three texts that should be lowercases, but that is obviously not universal then. – pst Apr 21 '14 at 10:36