This is a follow-up to this question.

Suppose you want to denote vectors by upright bold letters; then \mathbf{u} works fine, except that if it's a Greek letter you have to use \boldsymbol{\omega} instead.

Question: Is it possible to define a generic vector command in LaTeX which automatically chooses between \mathbf and \boldsymbol, so that one can write just \vect{u} and \vect{\omega} without having to treat the Greek symbols specially by hand?

(Just to be clear: \newcommand{\vect}[1]{\boldsymbol{#1}} is no good in this situation, since \boldsymbol{u} gives bold italic instead of roman.)

  • 2
    \boldsymbol(\omega) -> \boldsymbol{\omega}; I couldn't edit because of some "minimum 6 character" rule...
    – equaeghe
    Commented Feb 22, 2013 at 15:35
  • 1
    @equaeghe: Fixed. Commented Feb 23, 2013 at 8:30

4 Answers 4


You can use both commands together and define something like


which should work for most cases.


The macro


does not work with mathtime pro lite fonts (and from the comments it appears that it does not work with mathpazo either). Another approach is to simply check if the argument is A-Za-z.



This is inefficient since it performs the substring check for each execution. One could define macros \VEC@A, \VEC@B etc (using a simple loop), and then check do

    {\ifcsname VEC@#1\endcsname

Although this doesn't answer your question, have you tried using the bm package? Then $\bm{\omega}$ gives a bold omega, $\bm{u}$ gives a bold (math italic) u, and $\bm{\mathrm{u}}$ a bold roman u.

  • 3
    Indeed, defining something like \newcommand{\vect}[1]{\boldsymbol{\mathbf{#1}}} would do the trick. Commented Sep 27, 2010 at 18:55
  • @Juan: why not make an answer out of your comment? Commented Sep 27, 2010 at 19:02
  • Hmm.. because I thought it was pretty much the same (i.e. use both commands together), but maybe not? Commented Sep 27, 2010 at 19:07
  • @Juan: Thanks, that works! Except that I'm getting weird errors from an \underbrace in a file where I tried it: "Use of \reserved@a doesn't match its definition." and " LaTeX Error: Too many math alphabets used in version bold." Unfortunately that particular formula works fine in a file on its own, so I'm having trouble producing a minimal example where it fails... Commented Sep 27, 2010 at 19:41
  • \newcommand*\vect[1]{\mathbf{\bm{#1}}} works.
    – TH.
    Commented Sep 27, 2010 at 20:36

I just wanted to add: if you want upright greek characters, use


Combining this with the above answers, you can then e.g. do


to get a bold upright mu.

(sourced from here)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .