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.

Question says it all. What is the best way to redefine the \emph command to be bold font and upright?

share|improve this question
add comment

2 Answers

up vote 21 down vote accepted

Since \emph uses \em, I would redefine \em.

Here's such a redefinition which preserves the ability to toggle between bold and normal, if nested:

\makeatletter
\DeclareRobustCommand{\em}{%
  \@nomath\em \if b\expandafter\@car\f@series\@nil
  \normalfont \else \bfseries \fi}
\makeatother

Test of nesting behavior of \emph:

Question: \emph{What is the way to redefine the \emph{\textbackslash emph} command?}

alt text

share|improve this answer
1  
@Stefan: +1 for reminding me of \em's toggling ability. –  lockstep Dec 8 '10 at 19:41
1  
I'm not sure if it makes any sense to use normal font to emphasise something inside bold text... –  Jukka Suomela Dec 8 '10 at 19:48
2  
Note that the toggling is somewhat modified by fixltx2e so that in an italic context, \em produces \eminnershape (by default this is \upshape to give the original behaviour, but it can be redefined to, eg, \scshape to give small caps). –  Lev Bishop Dec 9 '10 at 5:51
1  
@Philippe: just a thought: it is also possible to do \begingroup\def\protect{\global\let\oldem}\em\endgroup. –  Bruno Le Floch Jul 29 '11 at 1:04
1  
@Manuel \makeatletter\DeclareRobustCommand\em{\@nomath\em \ifdim \fontdimen\@ne\font >\z@\upshape \else \slshape \fi}\makeatother –  Stefan Kottwitz Nov 30 '12 at 23:37
show 7 more comments

According to p. 194 of the LaTeX2e sources, \emph is defined as

\DeclareTextFontCommand{\emph}{\em}

So I suggest to redefine it as follows:

\DeclareTextFontCommand{\emph}{\bfseries}
share|improve this answer
    
This won't toggle like \emph does, though, correct? I don't know if that's part of the OP's idea of "canonical." –  Matthew Leingang Dec 8 '10 at 20:43
    
@Matthew: It won't, and I already admitted as much. –  lockstep Dec 8 '10 at 20:44
    
@Matthew I normally use the word canonical to mean ...how do you think Lamport would have written it? Not exactly from the Oxford Dictionary :) –  Yiannis Lazarides Dec 8 '10 at 21:01
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.