4

I'd like to render the string Id as a Math Operator in upright boldface. What is the proper markup for that? \mathbf{\operatorname{Id}}? \operatorname{mathbf{Id}}? \mathop{\mathbf{Id}}?

Note; this is for code in a macro, not inline.

1
  • 3
    \operatorname{\mathbf{Id}}
    – egreg
    Jun 27, 2019 at 15:06

1 Answer 1

9

Comparison:

\documentclass{article}
\usepackage{amsmath}

\begin{document}

$\mathbf{\operatorname{Id}}$ is wrong

$\operatorname{\mathbf{Id}}$ seems good

$\mathop{\mathbf{Id}}$ seems good

$\displaystyle\operatorname{\mathbf{Id}}_{X}$ seems good

$\displaystyle\mathop{\mathbf{Id}}_X$ is wrong

\end{document}

enter image description here

Thus the right one is \operatorname{\mathbf{Id}}. Of course, if you use it more than a couple of times, you should do

\DeclareMathOperator{\Id}{\mathbf{Id}}

in your document preamble and use \Id.

7
  • This is for a macro, not inline. I've edited the question to clarify that.
    – shmuel
    Jun 27, 2019 at 18:18
  • Why should \operatorname{\mathbf{Id}} be preferred to \mathop{\mathbf{Id}}?
    – Patricio
    Mar 2 at 13:40
  • @Patricio Try \mathop{\mathbf{x}}
    – egreg
    Mar 2 at 16:07
  • I just have, but I'm unable to tell the difference.
    – Patricio
    Mar 3 at 7:12
  • Now I see, it's its handling of subindices in displays, isn't it? Sorry for bothering you with this
    – Patricio
    Mar 3 at 7:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.