Not signed in (Sign In)

Vanilla 1.1.9 is a product of Lussumo. More Information: Documentation, Community Support.

  1.  
    Because of my interests, most of my answers/comments at MO seem to talk about things like \mathbf{Z}_p or \mathbf{Z}/p\mathbf{Z}. Is there any way of making it so I can just type \Z_p or \Z/p\Z like I do in all my LaTeX files? Z/pZ is particularly annoying :-) I would happily have some macro at my end, or perhaps, if possible, one might consider globally defining \Z, \Q, \R, \C to be the things that most people use them to mean, if this is possible. Is it?
  2.  
    +1 Kevin. I've been thinking the same thing, but was too lazy to complain :)
  3.  

    +1 as well. This is certainly possible with MathJax... I have been meaning to ask for this feature, but I was undecided since everyone has their favourite macros -- I certainly have mine -- and chances are they are all different. So it's not clear what is bestter: keep typing \mathbb{Z} or having to get used to some other non-canonical abbreviation. (Mine, for the record, is \ZZ.)

    • CommentAuthorCSiegel
    • CommentTimeNov 20th 2010
     
    Here's another +1, and also, I use the same macros as José, but could deal with anything, so long as it's standardized for the site.
    • CommentAuthorHarry Gindi
    • CommentTimeNov 20th 2010 edited
     

    \bf, \cal, \bb, \frak, \scr?

    Also, could we have an alias for \operatorname? Every time I type it, my soul is crushed a little more.

    • CommentAuthorWillieWong
    • CommentTimeNov 20th 2010
     

    I think this maybe a good idea, but if our benevolent overlords decide to do this, can they also please document the short-hands in the FAQ? Like Jose said, everyone has his favourite abbreviations. I use \Intgr \Nat \Real for what Kevin would probably call \Z, \N, and \R.

    Also +1 Harry's suggestion, as long as those don't collide with something already defined. (\bf of course is problematic in plain LaTeX, but maybe okay within the limited confines of MathJax?)

  4.  

    And one more +1. It's funny that it took more than a year to get to this point!

  5.  

    Here's the relevant MathJax documentation page: http://www.mathjax.org/resources/docs/?options/TeX.html#configure-tex

  6.  
    If you are typing on a computer, why not arrange for him to do these expansions for you? Who is the master, you or him?
  7.  

    The instructions for doing so are here. It seems we can write simple macros easily enough.

    I'm happy enough with Harry's suggestion. Another possiblity is to define whole alphabets of abbreviations, e.g. \bbA for a blackboard bold A, \cB for a caligraphic B, etc.

  8.  

    If we decide to define macros for letters one at a time, maybe we should have a poll on which one we choose?

    In this particular case, another question would be what to output: \mathbf{Z} or \mathbb{Z} (I use \Z for \mathbb{Z}). Maybe only shortening the commands, as per Harry's suggestion, would be fairer - neither \mathbf nor \mathbb would be given preference by having the macro use it.

    Also: \opn for \operatorname ?

  9.  

    How about \Z for \mathbf{Z} and \ZZ for \mathbb{Z}, etc... ?

    • CommentAuthorTom Church
    • CommentTimeNov 20th 2010
     
    It seems that everyone agrees that \Z should mean what it always means -- the problem is there's no consensus on whether it should mean \mathbf{Z} or \mathbb{Z}. (Personally, I'd prefer \mathbb{Z}.) So a bit reluctantly, I think it would be best to just shorten them to \bf{Z} and \bb{Z}. Scott Morrison's suggestion of \bfZ and \bbZ would also be nice (and can coexist with the previous macros).
  10.  

    Actually, since I use Chrome with the "Edit with Emacs" extension most of the time, I could do this client-side as well, as suggested by Gerald Edgar above. So, whereas selfishly I would like to push my own macros, in reality I'm happy for any (short) macros to be implemented.

  11.  

    I never liked whole alphabets of abbreviations, but I do think it makes sense to define at least a handful of standard macros.

    In addition to that, I'll let you in on a secret: you can define your own macros within a post. For example, if you're typing a lot of \mathbb{Z}'s in a given question/answer, you can do it like this:

    $\newcommand{\Z}{\mathbb{Z}}$ Now I can type things like $\Z$ and $\Z/p\Z$ easily!

  12.  

    Is that new with MathJax? If I remember correctly, that wasn't possible in jsMath.

  13.  
    Thanks for all the responses! Here are some comments.

    (1) This was certainly not meant to become some debate about whether \Z should mean bbZ or bfZ! Of course that is an issue if things are resolved server-side, but it's not a big one: I would still be much happier typing \ZZ or \bfZ than \mathbf{Z}.

    (2) Jose/Scott: I wish I understood your answer. I can see that MathJax will "let me do what I want", but I know nothing about mathjax so do not understand whether the page you point to is saying "type this at the start of every comment" or "put these lines into a magic configuration file" or what. If you could clarify this for me I would be very happy! If I'm supposed to cut and paste an incantation before every comment (which I think is what Anton is suggesting) then that's all well and good, but it might eat in to my precious 600 characters in an unpleasant way---I already find myself missingoutspacesandabbrvtngwrds when trying to squeeze my thoughts into those 600 chars sometimes.

    (3) Gerald: I am precisely asking the details of a sensible way of how to do this :-) [rather than muddling along trying to solve the problem myself]

    (4) Harry gives a suggestion which I don't understand, and Scott says he's happy enough with it. Can someone clarify what the suggestion is? Aah---is Harry suggesting more potential server-side macros, rather than telling me another way of doing mathbf? And Scott is suggesting that these macros seem uncontroversially-named?
  14.  
    PS once I can use macros in comments, there is a chance that I'll be able to write comments that are over 600 chars :-) This of course gives me a great opportunity to try and create buffer overflows and crash the site. I should get Andrew Stacey on the case!
    • CommentAuthorHarry Gindi
    • CommentTimeNov 21st 2010 edited
     

    @Kevin: Regarding number four on your list, that's about right.

    I was suggesting shorthand names for the fonts (which are essentially the same as before, just without the math- prefix). I think I got most of the important ones, but if I remember correctly, for some reason, we don't have rsfs installed (I think Andrew Stacey complained when we discussed it because it might increase loading times or something). Could we also have rsfs, Anton?

  15.  

    Okay, sorry, to clarify the points above:

    As Anton points out, you can just use \newcommand{} as you please, at a per post level. Beyond that, we can install macros in a magic configuration file (that is, when the HTML that we serve tells your browser to load the MathJax library, we can pass it some configuration information, including new macros).

    Now, there are I think three main proposals for what those macros should be:

    1. Only a handful of macros, for the most common bold face letters, e.g. \Z for \mathbb{Z}.
    2. Abbreviations for the commands \mathbb, etc. so you could type \bb Z instead of \mathbb{Z}. We'd also do this for \mathbf, \mathcal, and a few others.
    3. Abbreviations for the whole alphabet in various variations, so you could type \bbZ instead of \mathbb{Z}.

    Some comments:

    1. is super easy to implement, but might contradict "the principle of least surprise", as people won't know which letters are provided.
    2. is also easy to implement. There's slight danger here, as some of the obvious contractions, e.g. \bf, might not play well with TeX (as opposed to LaTeX). (I don't actually know whether this is really a problem or not.)
    3. is slightly more complicated to implement; we need to either list lots of new macros, or include a macro that lets you apply a function to everything in a list, e.g. here, and then use that.

    One advantage of 2) over 3) is that you can see type \bb{AB}, whereas for 3) you'd have to type \bbA\bbB.

    Nevertheless, 3) is my preferred option, mostly because it's what I'm used to at home! :-)

    • CommentAuthorWillieWong
    • CommentTimeNov 21st 2010
     

    I vote for a mixture of 1) and 2), but against 3).

  16.  
    @Scott: from what you say it sounds like it might be possible at my end to actually edit my own mathjax library---aah, I see, but that doesn't work, because then what I write displays beautifully at my end but not at anyone else's.

    But to be honest, knowing that newcommand works is already a great help, because at least I can use that on long answers where I was in the past typing mathbf lots and lots of times.

    Thanks (esp to Anton)!
  17.  
    PS on Scott's suggestions, I think that (3) is the one most likely to conform of the "principle of least surprise", becuase it's unlikely that anyone will type \bbZ by accident, or (worse but even more unlikely) type it genuinely believing that it will do something other than mathbb{Z}. I still remember when looking at someone else's TeX source being quite surprised that they had defined \bbA to \bbZ right at the beginning of their document (not least because I could verify that they had not even used some of these abbreviations) but now I see some logic in it...
  18.  
    PPS <on high horse> Hendrik Lenstra once told me that he didn't like seeing mathbb in maths texts. He said that the "correct" abbreviation for the reals was mathbf{R}, and had been for hundreds of years, and that the only reason people use blackboard bold on a blackboard is because writing it correctly, in bold face, on a blackboard, is too hard. He maintained that in written text mathbf{R} should be used, and if you think about it this way then it does indeed sound like using mathbb{R} for the reals in e.g. LaTeX is actually plain wrong! Ever since he explained this to me I have used mathbf{R} for the reals in my papers. I initially didn't believe him, so went out and dug up some old texts and surprise surprise he was dead right.<off high horse>
  19.  

    @Kevin: I heard the story before -- but I just happen to like blackboard bold!

  20.  

    @Kevin: Didn't Weil or Dieudonné say something similar (and that's why Bourbaki uses boldface instead)?

  21.  

    @Kevin, Harry: I don't believe that there is anything 'canonical' about \mathbf{R} for the real numbers. This choice might simply be a reflection of the available technology: perhaps it was easier to use \mathbf{R} than \mathbb{R} in the days before computer typography simply because bold face fonts existed, whereas blackboard bold fonts did not. (Recall that fonts then were pieces of metal, not computer files!)

    I see no reason to remain faithful to compromises made because of inadequate technology. It's enough that I have to type on a QWERTY keyboard :)

  22.  

    Unless it will slow down page loading times, I vote for 3 on the grounds of principle of least surprise. Think how annoying it will be if you've successfully typed \bbZ, \bbQ, \bbC and \bbN, only to discover that our admins thought \bbA wouldn't be needed.

  23.  
    I also like Scott's option #3, for the reasons David gives.

    And I agree with José about \mathbb{R} vs \mathbf{R}. There aren't enough symbols to go around, so using \mathbb{R} for the reals frees up \mathbf{R} for other purposes. On the rare occasions I come across \mathbf{R} for the reals, it strikes me as old-fashioned and a little jarring.
  24.  
    I think blackboard bold is for blackboards only, but I also think arguing bb vs bf is arguing religion. On another matter, is it correct that those of us who never made the transition from Plain TeX to LaTeX can use \def where it has been suggested to use \newcommand?
  25.  

    @José: I'm saying that I read that Bourbaki was opposed (for the reason Kevin Buzzard noted) to writing \bf{R} as \bb{R} in print. It wasn't at all a matter of technology.

  26.  

    On another matter, is it correct that those of us who never made the transition from Plain TeX to LaTeX can use \def where it has been suggested to use \newcommand?

    Nope, \def won't work. The preview is accurate, so you should be able to determine what will work before actually posting.

  27.  

    Lenstra is certainly right about the historical origin of mathbb, but I don't think \mathbf{R} was ever really standard for the reals. I've seen a number of old texts and papers that denoted them by (italic) R, E^1, or even X.

    Incidentally, it seems we've already moved past any suggestion of defining meanings for all of \A,...,\Z, but in case it comes up it should be pointed out that some of those (\P and \L for at least) are already defined in LaTeX.

    • CommentAuthorHarry Gindi
    • CommentTimeNov 21st 2010 edited
     

    Mark, Bourbaki used \bf{R} for the reals in 1930-something. That's standard enough for me!

    • CommentAuthorAgCl_
    • CommentTimeNov 21st 2010
     
    This is off topic but I just wanted to let you know of something if you don't already: curly braces in \mathbb{Z} are not necessary. They are used to group multiple characters, and don't have any function if there is only a single character inside. You may just type \mathbb Z or \mathbb Z_p, \mahtbb R^n etc. It saves a lot of time, since the curly braces require shift key and consume the most amount of time.
  28.  

    Thanks, AgCl! That's really useful to know, actually.

    • CommentAuthorAgCl_
    • CommentTimeNov 21st 2010
     
    You're welcome! Hope it helps until the macro issue is solved.
  29.  

    +1 AgCl!

    Also, agree with #3 for David's reason.

  30.  

    My name was invoked and, like the incantation, draws me hence.

    I'd like a speed test before the decision between 2 and 3 is made. I suspect that either possible implementation of 3 (that Scott mentions) will be significantly slower than 2. MathJaX is not so fast that it is unnoticeable, I still load a page, watch all the squiggles disappear, and slowly reappear as rendered mathematics. If the shortcuts significantly add to the page load, I would argue against them. Assuming that MathJaX behaves like LaTeX and that braces are not required except for grouping (can someone confirm that this is indeed the case? And point to the relevant piece of MathJaX documentation? Apologies to AgCl for doubting, but given that I doubt he/she was named "Silver Chloride" then I would like more evidence than anon's word.), then there is hardly any difference between \bb Z and \bbZ. One could avoid the confusion over \bf by defining it to be \mbf, but I wouldn't worry about the confusion too much as there are enough differences between what one types here and normal LaTeX that everyone should be on their guard for discrepancies. It's not as if you can take an answer here and send it straight to tex without any post-processing.

    (Not that typing braces should be of any discombobulation. Doesn't everyone have their keyboard configured to make TeX easier to type?)

    As to the debate between 𝑹 and ℝ, I find the latter much easier to distinguish from surrounding text. It is much easier for me to see that ℝ is something special, especially if I want to emphasise that it is the reals 𝑹 and not the integers 𝒁 (compare with: reals ℝ and not the integers ℤ.)

  31.  

    If we go for #3, I think I'd prefer the \ZZ style for blackboard bold, since it mimics the way we write these. (I have recently switched from \bbZ in my own writing.)

    • CommentAuthorAgCl_
    • CommentTimeNov 22nd 2010 edited
     
    Andrew Stacey: No problem, sorry about the anonymity. I didn't see any note about this in MathJax's documentation, but a quick search revealed that many users on MO are already using \mathbb without braces, so there is plenty of empirical evidence:

    http://mathoverflow.net/questions/20144/
    http://mathoverflow.net/questions/36976
    http://mathoverflow.net/questions/23098/
    http://mathoverflow.net/questions/22140/

    (These questions have instances of this in their titles. Latex sources can be seen by right clicking on the equations.)
  32.  

    I'd still like to have something from the official documentation since (unlikely though this is) if it's undocumented then it might disappear in a future version.

    • CommentAuthorAgCl_
    • CommentTimeNov 22nd 2010 edited
     
    But there isn't anything in the documentation that says braces are required, either. I think some syntax which is standard in Latex doesn't require additional documentation.
  33.  

    I am pretty sure I have been typing stuff like \frac 1n on MO without thinking much about it. And I suspect that enough people are used to such shortcuts that for mathjax to ignore this aspect of TeX's macro argument parsing would border on the perverse. Any documentation on mathjax should focus on the differences between mathjax and latex, not the similarities.

    • CommentAuthorWillieWong
    • CommentTimeNov 22nd 2010
     

    To second Harald's remark: while I've never typed \mathbb without braces, I've always typed \frac1p without the braces. And also usually $\hat\alpha$ etc when it comes to Greek letters. So at least anecdotally the MathJax behaviour reflects normal LaTeX usage.

    I do think Andrew's point about speed is a very valid one. Every once in a while MathJax hangs so long that Firefox wonders aloud whether the script has stopped responding; I really don't want it to happen even more often.

  34.  

    (I'm going to have a look at the MathJaX documentation before commenting any further. It depends on whether the documentation is, as Harald suggests, focussed on the differences between MJ and LaTeX, or is purely about MathJaX as a standalone application. I freely admit that I know very little about MathJaX, being convinced that the best solutions are server-side, not client-side - one of the reasons being that feature-creap (such as adding extra macros) makes a big difference when done client-side but almost no difference server-side.)

  35.  

    Doesn't everyone have their keyboard configured to make TeX easier to type?

    The problem is not configuring the keyboard, but reconfiguring the neural synapses after years of using QWERTY keyboards. Having said that, Emacs makes it virtually painless to type (LaTeX) code and luckily I have emacs hardwired in the brain :)

    • CommentAuthorWillieWong
    • CommentTimeNov 22nd 2010
     

    Well, having emacs hardwired in the brain is not that difficult, you just need to hit C-x M-c M-cybernetic_implant...

  36.  

    @Willie: I would link to the obligatory xkcd comic now, but I think that particular comic has been "overlinked" already...

  37.  

    Since xkcd is unlinkable, I'll go to the opposite extreme and link to this tex.SX question just in case anyone seriously wants to know about reconfiguring their keyboard more appropriately for TeX. And I would say that Jose's comment about QWERTY-synapses isn't so relevant as most reconfigurations don't touch the letter keys, just the numbers and symbols which (I found) aren't so hard-wired into the brain.