Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Redefine command in latex

  1. Feb 5, 2013 #1
    I want to redefine \mathbf to have a different font. I can't seem to make \newcommand work since it says "already defined". Help?
  2. jcsd
  3. Feb 5, 2013 #2

    D H

    User Avatar
    Staff Emeritus
    Science Advisor

    It's \renewcommand.

    Don't use it lightly. It's usually much better to define your own macros as opposed to overriding macros whose definitions have deep meaning.

    This looks like an "XY" problem. Underneath the hood you are facing problem X, something about which you haven't told us a single word. You somehow see that approach Y is a solution to your underlying problem, so you ask how to do Y. It's usually much better is to ask us about X directly.

    So, what's your real problem, and what is motivating you to want to change \mathbf?
  4. Feb 5, 2013 #3
    I've used \mathbf throughout a very long work, and I want to change the font from what it is to textsf+textbf, which looks less... aggressive. I suppose I could just change every \mathbf instead redefining them.
  5. Feb 5, 2013 #4


    User Avatar
    Gold Member

    I'd make a custom LaTeX command to get the desired formatting and then use an editor command or sed or something to replace mathbf.
  6. Feb 6, 2013 #5


    User Avatar
    Science Advisor
    Homework Helper

    What jhae said. But if you really want to do this, it would be better to do it the same way that LaTeX sets the default, i.e. override the command
    Code (Text):

    \DeclareMathAlphabet      {\mathbf}{OT1}{cmr}{bx}{n}
    with your preferred font definition.
  7. Feb 9, 2013 #6
    Alright, thanks everyone.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook