Do you think it would be feasible / possible to put together a basic header file of "standard" LaTeX macros that we might be able to use when typing up MO questions or answers? I mean, basic objects like $\mathbb{R}$, or $\mathbb{C}$, or $\| \cdot \|$ (as a macro '\norm'), or you think that this idea is doomed due to the large variety in the way people use LaTeX on MO?

I think it might simplify the typing for several regular MO'ers, while keeping the markup of their post shorter and cleaner?

  • 5
    $\begingroup$ I guess you are aware that you can use \newcommand. So if you start you post by $\newcommand{\R}{\mathbb R}\newcommand{\C}{\mathbb C}$$\newcommand{\R}{\mathbb R}\newcommand{\C}{\mathbb C}$ you can use \R and \C for $\R$ and $\C$ in your post. (One should be a little careful when using newcommand, for example, you should avoid using it in the title. Apart from making the title less readable, it could cause other problems, see here and here.) $\endgroup$ Commented Oct 10, 2013 at 14:10
  • 1
    $\begingroup$ Yes, yes, I am aware of that! But wanted to avoid bloating each post by this standard header each time, so I asked this question. The specific symbols I listed above were just an example. Thanks! $\endgroup$
    – Suvrit
    Commented Oct 10, 2013 at 15:57

1 Answer 1


As Martin pointed out in the comments, a workable solution is to begin your post with something like:


Perhaps you even want to save a preamble somewhere that you can easily cut and paste in your post.

The problem, of course, is that different people use different macros that often clash with each other so coming up with a universal set is impossible. The above customizes new macros for each page according to the user's preferences.

There are some problems with this solution too since these macros will then affect the entire page. It's best only define the macros you need and to never use them in the title of a question.

  • 2
    $\begingroup$ I do not like this "solution" and chances are OP was aware of it anyway. I would much prefer we could agree on a couple of very common macros, document them somewhere, and thus minimize this "newcommand" stuff, which personally I find unfortunate. One reason I find it unfortunate is that if MO is "slow" it is quite disturbing to see posts start with all the MJ-preamble stuff that then greys out to then dissapear and make the entire text 'jump' a bit. $\endgroup$
    – user9072
    Commented Oct 10, 2013 at 14:56
  • 6
    $\begingroup$ @quid: "... we could agree on ..." that's a tough one (even on projects involving just two people). We did have a few custom macros in MO 1.0 that nobody complained about, but none of them were useful to me. $\endgroup$ Commented Oct 10, 2013 at 15:13
  • $\begingroup$ @quid: There are also other ways of timing MathJax processing. The current one works relatively well, I don't know if there is some flexibility. You would need to make a discussion describing your experience and ask whether improvements are possible. $\endgroup$ Commented Oct 10, 2013 at 15:16
  • $\begingroup$ I have to confess I did not even know of these macros on MO 1.0. Yes I know it is not easy to agree on this, but for some basic things one might still find some sort of consensus. I for one would not mind so much wheter I type \R or \RR or whatever for a blackboardbold R. So I infer it would be technically feasible. Why not try if it is sociologically feasible? Meta question: which macros would you like? Things that are somewhat popular and rather uncontroversial would be taken the rest not. $\endgroup$
    – user9072
    Commented Oct 10, 2013 at 15:28
  • $\begingroup$ The experience is simply that it takes a long time until the MJ is processed. So first one sees the code and then the instances are processed one by one to become what they should be (or at some browsers the become the source again, but this is a very old browser so let us forget that). I am quite sure thi is basically a hardware issue; that is the site is somewhat demanding on the resources, and if the system you use is 'weak' it takes a long time to process MJ. But this came up already over and over again, eg, in discussion on MJ in titles here and on math.SE (not only from me). $\endgroup$
    – user9072
    Commented Oct 10, 2013 at 15:34
  • $\begingroup$ @quid: One way to see which macros might be good to put in a standard backend might be to download the sitedump from MO, process it somehow to "determine equivalents" (this is the most non-trivial part), and then take the top 100 from this list...hmm..sounds like too much work, but perhaps worth doing... $\endgroup$
    – Suvrit
    Commented Oct 10, 2013 at 16:00
  • $\begingroup$ @suv....rit I am rather sceptical regarding automating this. Why not let people just suggest things? If people should continue to disagree about unreasonable details then, well, nobody will get any macro. If nothing else, a good learning experience. (OT: what happens to your user name all the time?) $\endgroup$
    – user9072
    Commented Oct 10, 2013 at 16:12
  • 1
    $\begingroup$ Ok, I agree, while automating it may be a good student project, it might not be a great thing to do, and just trying to attain partial consensus directly might be good. (as for the username, I keep getting sick of people misspelling it as 'survit'---so keep trying to change its appearance to dissuade mis-spellers) $\endgroup$
    – Suvrit
    Commented Oct 10, 2013 at 16:56
  • $\begingroup$ Now, would you or wouldn't you include standard macros if we were to find some quasi-consensus for them? $\endgroup$
    – user9072
    Commented Oct 11, 2013 at 14:35
  • $\begingroup$ @quid: SE staff would be in charge of that but MathJax is built to make that possible. $\endgroup$ Commented Oct 11, 2013 at 14:49
  • $\begingroup$ Thanks for the info! Do you know if this can be done 'per site' or would this have to be uniform across all MJ enabled sites (so also math.SE and some others). $\endgroup$
    – user9072
    Commented Oct 11, 2013 at 14:53
  • $\begingroup$ @quid: I'd guess that this should be possible 'per-site'---MJ is used by various websites (also outside the SE network), and local configs that enhance its macro power, should be possible. On a related note, such macros would be useful for typing some nontrivial LaTeX in comments :-) $\endgroup$
    – Suvrit
    Commented Oct 11, 2013 at 19:09

You must log in to answer this question.

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