1

I'm currently writing my thesis and have a lot of equations to write down. In order to make those more readable I would like to differentiate vectors and scalars by writing vectors with bold characters. As it is rather tedious to write \boldsymbol{x} every time I use the vector x, I would like to know if it is somehow possible to make those characters bold by default.

Is there a way to do that?

  • 1
    Welcome to TeX SX! How would LaTeX make the difference between x as a vector, and x as a number? Maybe you never ever use x for numbers? – Bernard Jul 9 '17 at 10:12
2

Write \newcommand{\vx}{\boldsymbol{x}} in the preamble and use \vx whenever you want x in bold font. For any other letter of interest, just replace vx with v<you letter>

  • That's usually bad practice. a) Do not use one-character command sequences (especially as there are many that already have a meaning) and b) You should usually check if you're in math or not. – TeXnician Jul 9 '17 at 10:23
  • He says that he uses \boldsymbol{x} and want something shorter or automatic. Do you have a better solution? – Al-Motasem Aldaoudeyeh Jul 9 '17 at 10:25
  • 2
    Probably \vx (for “vector x”) is better. – egreg Jul 9 '17 at 10:27
  • egreg is right. But especially you should adjust your advice so that one-character sequences are not the general idea. If you replace x with one of k,c,l,b,d,r,u,v,t,o you'll notice issues (see en.wikibooks.org/wiki/LaTeX/Special_Characters) – TeXnician Jul 9 '17 at 10:31
  • 1
    In my opinion, it's more the problem of an editor: how to have a shortcut to make it type automatically \boldsymbol{}, or \mathbf{}, with the cursor between the braces. Most modern editors let you easily define such a shortcut. – Bernard Jul 9 '17 at 11:01

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.