I'm using a type family that supports a semi-bold (sb) face, and I'd like to use that whenever \textbf is called for. How can I redefine \textbf to do this? Can I do it on a per family basis, or only for all families in my document at once?


Fonts are identified by five attributes:

  1. encoding
  2. family
  3. series (weight)
  4. shape
  5. size

For the first four attributes, LaTeX maintains "default" definitions, contained in

  1. \encodingdefault
  2. \familydefault
  3. \seriesdefault
  4. \shapedefault

but also other commands

  • Family defaults: \rmdefault, \sfdefault, \ttdefault
  • Series defaults: \mddefault, \bfdefault
  • Shape defaults: \updefault, \itdefault, \sldefault, \scdefault

When you call \bfseries (or \textbf, which calls \bfseries internally), LaTeX looks at \bfdefault, whose normal definition is


and doesn't change any of the other attributes.

At a lower level LaTeX maintains also

  1. \f@encoding
  2. \f@family
  3. \f@series
  4. \f@shape
  5. \f@size and \f@baselineskip

Your problem seems to be in the fact that the sans serif family has a "semibold" shape that you want to be selected in case \bfseries is called, but the roman and typewriter families don't.

A definition such as

\renewcommand{\bfdefault}{\ifx\f@family\sfdefault sb\else bx\fi}

will do the right thing unless you call a family changing command after the switch for bold face. So


would work, while \textbf{\textrm{x}} wouldn't.

Another way is to use \DeclareFontShape as explained by David Carlisle


and similarly for the typewriter type family.

In case you're using fontspec the situation is completely different, as you can fix the boldface variant on a family basis, as explained by rdhs.

  • I set my sans family (which is the one I'm trying to change) with \usepackage[defaultsans]{open sans} and both methods above behave as if they don't recognize \sfdefault. The first method does nothing, while the second fails with "Font family `T1+fos' unknown". – orome Mar 13 '12 at 18:06
  • I've modified the examples to reflect the new info – egreg Mar 13 '12 at 18:17
  • Thanks, the \DeclareFontShape method now works; the \ifx\f@family\sfdefault has no effect. – orome Mar 13 '12 at 18:40
  • @raxacoricofallapatorius It doesn't because opensans doesn't act as expected. – egreg Mar 13 '12 at 18:47
  • @egreg for applying this change globally, I imagine \renewcommand\bfdefault{sb} would do the trick — would you then have any idea why pastebin.com/W7q2LNdn doesn't seem to work? – tecosaur Jul 8 '19 at 15:28

If you're already using fontspec, just adjust the BoldFont setting for each family:

\setmainfont[BoldFont="Minion Pro Semibold"]{Minion Pro}
\setsansfont[BoldFont="Myriad Pro Semibold"]{Myriad Pro}
  • 5
    I had to omit the quotes to get it working, but apart from this it is a nice solution. – matth Oct 16 '12 at 12:09

Globally you can override the default definition of




To do it for a single face, probably the easiest is to have a command like this one (from the base ot1cmtt.fd file)


which substitutes non bold tt font for the bold version, just adjust the arguments for the font family you want to change.

  • 1
    could you please explain the arguments here? (like, what is "n"? is it an integer parameter?) – Daniel Apr 30 '20 at 0:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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