Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

share|improve this question
add comment

1 Answer

up vote 7 down vote accepted

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 UK 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.

share|improve this answer
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 '12 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 '12 at 14:40
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.