I often use vector operation, and normally vector is written by Bold font, e.g.
$$ \boldsymbol x = \boldsymbol a \times \boldsymbol b + \boldsymbol c $$
which is somehow too long, so I like to define some new commands \bx, \ba, \bb first,
$$
\newcommand{\bx}{\boldsymbol x}
\newcommand{\ba}{\boldsymbol a}
\newcommand{\bb}{\boldsymbol b}
\newcommand{\bc}{\boldsymbol c}
$$
then above equation can be written shortly as:
$$ \bx = \ba \times \bb + \bc $$
----------
Because I use these Bold fonts so often, I don't want to type them time by time, I plan to define them as macro in a file: boldfont.js , when I need to type vector, I just require boldfont.js.
I write file as follows (save the file as: /config/TeX/boldfont.js, other file (such as color.js) under the same directory):
MathJax.Hub.Config({
TeX: {
Macros: {
ba: '{\\boldsymbol a}',
bb: '{\\boldsymbol b}',
bc: '{\\boldsymbol c}',
bd: '{\\boldsymbol d}',
be: '{\\boldsymbol e}',
bf: '{\\boldsymbol f}',
bg: '{\\boldsymbol g}',
bh: '{\\boldsymbol h}',
bi: '{\\boldsymbol i}',
bj: '{\\boldsymbol j}',
bk: '{\\boldsymbol k}',
bl: '{\\boldsymbol l}',
bm: '{\\boldsymbol m}',
bn: '{\\boldsymbol n}',
bo: '{\\boldsymbol o}',
bp: '{\\boldsymbol p}',
bq: '{\\boldsymbol q}',
br: '{\\boldsymbol r}',
bs: '{\\boldsymbol s}',
bt: '{\\boldsymbol t}',
bu: '{\\boldsymbol u}',
bv: '{\\boldsymbol v}',
bw: '{\\boldsymbol w}',
bx: '{\\boldsymbol x}',
by: '{\\boldsymbol y}',
bz: '{\\boldsymbol z}',
}
}
});
And I try to use the file (using \require command) as
$$
\require{boldfont}
\bf=\bu+\bv-\bw
$$
But it doesn't work, what's wrong? How to define macro and use it?
Help me, please.