8

In most fonts, the small caps are as tall as the x-height, but this looks weird when you want to tack an 's' onto the end of an abbreviation to make it plural (discussed in depth on typophile).

I can create a new command \textmc (for moyen caps) to do this easily:

\usepackage{scalefnt}
\newcommand{\textmc}[1]{\textsc{\scalefont{1.1}#1}}

But I'd prefer to just redefine \textsc. The approach that I was taking, however, seems to give me an infinite loop as it flips back and forth between defintions:

\newcommand{\oldtextsc}[1]{\textsc{#1}}
\renewcommand{\textsc}[1]{\oldtextsc{\scalefont{1.1}#1}}

Any advice on how to redefine a command which calls the original definition?

1 Answer 1

9

A straightforward way is to use \let to store the current definition of \textsc.

\let\oldtextsc\textsc
\renewcommand{\textsc}[1]{\oldtextsc{\scalefont{1.1}#1}}

(See Patching existing commands from the TeX FAQ for details.)

However, this can fail if \textsc happens to be in some place that gets written in the aux file (a section title, for instance), so a safer version is

\usepackage{letltxmacro}
\LetLtxMacro{\oldtextsc}{\textsc}
\renewcommand{\textsc}[1]{\oldtextsc{\scalefont{1.1}#1}}

(see the documentation of letltxmacro for more information).

The problem is that \textsc is a "robusted" command, so that LaTeX will write a special form of it in the aux file; something like \section{\textsc{a}} would result in LaTeX writing

\textsc  {\scalefont  {1.1}a}

and when interpreting it for the table of contents this would become

\oldtextsc{\scalefont{1.1}\scalefont{1.1}a}

and eventually to a scaling factor of 1.21.

2
  • 1
    There is a problem in this redefinition if \textsc happens to be written in the .aux file: \textsc{a} would become \textsc{\scalefont{1.1}a} which would result in a scaling factor of 1.21.
    – egreg
    Mar 17, 2012 at 14:36
  • @egreg My answer was mainly about \let and didn't touch the substance of the OP's definition. Please point out any changes needed (or feel free to edit my answer).
    – lockstep
    Mar 17, 2012 at 14:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .