I'd like to have a conditional macro that emboldens symbols, using different commands depending on whether the argument is a math symbol or text. Specifically, I'd like to use \bm for math symbols and \mathbf for alphanumeric characters. Thus it would look something like


Problem is I don't know of a test such as \ismathsymbol. Obviously, it would be just fine if there were a test for alphanumeric characters.

Thanks for any advice!

marked as duplicate by AboAmmar, user13907, Sean Allred, Jesse, Community Jul 17 '15 at 5:35

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 1
    \newcommand\vec[1]{\mathbf{\bm{#1}}} – David Carlisle Jul 17 '15 at 0:56
  • @DavidCarlisle And don't load amssymb? – cfr Jul 17 '15 at 1:35
  • Math symbol vs text? You mean v, \nu, AB are math symbols but shift is text? How can TeX Tell the difference between the last two? – Symbol 1 Jul 17 '15 at 3:32

Browse other questions tagged or ask your own question.