Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I alias command mathbb?

Tags:

latex

I would like to alias \mathbb as simply \bb. How do I define this new command? I know how to alias mathsymbols such as:

\def\AND{\wedge} 

But I am not so sure about math commands that take parameters.

like image 686
xiaolingxiao Avatar asked Jun 14 '26 19:06

xiaolingxiao


1 Answers

You have a number of options. Firstly you could

\let\bb\mathbb

which will copy the definition of \mathbb into \bb. This means that if the definition of \mathbb changes, \bb will remain whatever it was at the time of definition. If \mathbb were to take an optional parameter as an argument (for whatever reason), then it's more appropriate to use

\usepackage{letltxmacro}% http://tex.stackexchange.com/q/88001/5764
\LetLtxMacro{\bb}{\mathbb}

Alternatively, you could use

\newcommand{\bb}{\mathbb}

which will insert \mathbb wherever you use \bb; more akin to an alias. This has the advantage that \bb will change with any changes to \mathbb. Also, there's no need to worry about defining \bb to take the same number of arguments as \mathbb, since TeX merely replaces \bb with \mathbb. That is,

\bb{<something>}

would be interpreted as

\mathbb{<something>}
like image 155
Werner Avatar answered Jun 17 '26 09:06

Werner



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!