# [SOLVED]Mathjax and adding in our own commands

#### dwsmith

##### Well-known member
Does the site have the ability to add in its own commands to preamble Mathjax's uses on this site?

I hate having to do Latex Code:

\hat{\mathbf{r}}

.

\newcommand{\unit}[1]{\hat{\mathbf{#1}}}

to the site preamble if that is possible so we can use the command Latex Code:

\unit{r}

for unit vectors?

Also, I bet others have suggestions for commonly used code.

For bold Greek letters, we could have

Latex Code:

\newcommand{\bfg}[1]{\mbox{\boldmath\$#1\$}}

Greek unit vectors

Latex Code:

\newcommand{\bfgu}[1]{\hat{\mbox{\boldmath\$#1\$}}}

No \ in the code but \$ wouldn't show up otherwise.

Last edited:

#### Ackbach

##### Indicium Physicus
Staff member
Re: Mathjaxs and adding in our own commands
