Welcome to our community

Be a part of something great, join today!

[SOLVED] Mathjax and adding in our own commands

dwsmith

Well-known member
Feb 1, 2012
1,673
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}}

.

Can we add Latex Code:

\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
Jan 26, 2012
4,197
Re: Mathjaxs and adding in our own commands

As mentioned somewhere else, \newcommand and \renewcommand work on a post-by-post basis.