Skip to content

Macros: trouble defining them

Davide P. Cervone edited this page May 27, 2013 · 2 revisions

I defined the following macro:

tg: "{\\mathop{\\mathrm{tg}}\\nolimits}",

the problem is that if I use $\tg x$, then there is no space between tg and x.

However if I write straightforward $\mathop{\mathrm{tg}}\nolimits x$, then there is a space between them :S

Has anyone any idea what causes this problem, and how can I fix it?


The problem is the extra braces around the macro definition, which means that $\tg x$ is really ${\mathop{\mathrm{tg}}\nolimits} x$ rather than $\mathop{\rm{tg}}\nolimits x$ as you desire. So define

tg: "\\mathop{\\mathrm{tg}}\\nolimits"

instead.


Thanks :)

Clone this wiki locally