When one provides an answer that requires LaTeX, which is almost any answer, every time a set is used, it is necessary to fully type \mathbb{Z}. For example, $\mathbb{Z},\mathbb{Q},\mathbb{R}$ are used often, and I believe that the notations \Z , \Q, \R are quite common and do not have any use in LaTeX mode as $\Z$, $\Q$, $\R$ are not define.

Could it be added to the definitions in LaTeX mode on the page?

I do not know if this is something that can be done, but I believe it would make the solutions more readable when editing and a little quicker to type.

  • 3
    $\begingroup$ Add $\newcommand{\Z}{\mathbb{Z}}$$\newcommand{\Z}{\mathbb{Z}}$ to the start of a post. On that page, $\Z$ will be rendered as $\Z$ (as has been done here). $\endgroup$
    – Xander Henderson Mod
    Commented Jan 2 at 23:56
  • 5
  • 5
    $\begingroup$ I vote NO. Define your own macros if you like, but do not add them to everyone else's LaTeX . $\endgroup$
    – GEdgar
    Commented Jan 3 at 17:49
  • $\begingroup$ Consider instead (for example) $\Bbb{Z}$, which presents as $~\Bbb{Z}.$ $\endgroup$ Commented Jan 3 at 21:31
  • 1
    $\begingroup$ Regarding the previous discussions: one common suggestion is to save a collection of macros "in your clipboard" or "on your desktop" and paste it in whenever you need them. This now strikes me as old-fashioned. It works if I'm always posting from the same computer, but if I'm using several different computers plus a tablet plus a phone, it's not so convenient anymore. Is there a solution that easily lets users save their own macros somewhere attached to their math.stackexchange account, rather than a physical device? $\endgroup$ Commented Jan 8 at 19:24
  • $\begingroup$ Google docs and other cloud based documents will solve the "I want access from multiple devices" problem. I use it frequently with my wife. $\endgroup$
    – nickalh
    Commented Jan 24 at 19:29

1 Answer 1


It is possible to define a macro in the answer


$\newcommand{\Z}{\mathbb{Z}}$ And it would work as usual in latex ( Example: $\Z$ ).

thanks to mod Xander Henderson for the comment to known this

  • $\begingroup$ There is (or used to be) some problems with defining my own macros ... my macros would apply to your answer if your answer appears after mine on the page. Has this been fixed? $\endgroup$
    – GEdgar
    Commented Jan 9 at 16:26
  • $\begingroup$ @GEdgar as per this link macros in answers and comments are scoped, e.g. this should not render as $\mathbb Z$ despite appearing after the above answer: $\Z$. But from comments to this answer I think titles are different. In addition it will affect how the question appears in search, if the quoted part of the question does not have the macro then it will appear like $\Z$. $\endgroup$ Commented Jan 10 at 11:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .