Do we want to add shortcuts for common $\rm\LaTeX$ commands? Examples:

  • \ra, \la, \Ra etc. for \rightarrow, \leftarrow, \Rightarrow etc.
  • \N or \|N for \mathbb N etc.
  • \tr for \operatorname{tr} and other commend math operators

Having shortcuts available has at least three benefits:

  1. Writing formulas becomes more efficient.
  2. The source code becomes clearer and easier to read (stuff like \operatorname{tr} is pretty long).
  3. Depending on your local $\rm\LaTeX$-setup using MathJax is nearly the same as writing formulas with $\rm\LaTeX$. (I assume many mathematicans have set up a commands.tex file defining shortcuts which is often imported.)

Is this technically possible? If one adds some \newcommands or \DeclareMathOperators in their text, the shortcuts can be used later on. So one possible implementation would be to just add all these commands to a text (while not making them visible in the editor of course). However I am not sure whether this would slow down $\rm\LaTeX$ compilation a lot.

Another idea would be to alter MathJax.

At one point we need to decide which shortcuts we want, but for now I am just asking

  1. Do we want such shortcuts?
  2. Is it technically possible?
  • 7
    $\begingroup$ This sort of proposal was brought up before. But it's problematic, since mostly you're going to nudge people into a standard that you've created. It's somewhat fine, if nobody has any shortcuts they are used to, but otherwise, it's just preferring some shortcuts over others. I, for example, use \NN (and other double letters) for the blackboard bold, \fN for frakur letters, \cN for calligraphic, \sN for script, \bN for boldface. Why is this inferior or superior to \|N or \N for blackboard bold? $\endgroup$ – Asaf Karagila Nov 12 '16 at 20:41
  • 3
    $\begingroup$ @AsafKaragila But do people really care? Personally, I use \Z for the integers, but I wouldn't mind at all if I had to type \ZZ or some other variation instead. Right now it seems like I have to use the worst possible option \mathbb{Z} or \Bbb{Z}, which is much longer than any shortcut anyone would propose. $\endgroup$ – Viktor Vaughn Nov 12 '16 at 23:35
  • 1
    $\begingroup$ Also, some related links: 1, 2, 3, 4 $\endgroup$ – Viktor Vaughn Nov 12 '16 at 23:36
  • 5
    $\begingroup$ @SpamIAm: The current situation, however, is standard. You can open a $\rm\LaTeX$ document and write \mathbb{R} and see the result just fine. You cannot write \R and see the same result. (Not to mention, if you ever use babel with Hebrew loaded, you cannot use \R. ) So while it's longer, it's also standard. And while I have my list of macros, as the OP suggests, it is my standard, and not your standard. And while you don't mind following my standard, I mind following others, and people who don't know $\rm\LaTeX$ will end up confused. $\endgroup$ – Asaf Karagila Nov 13 '16 at 5:30
  • $\begingroup$ It seems worth mentioning; you can shave 1 character off of \Bbb{Z} by typing \Bbb Z. E.g. \Bbb Z^d $\Bbb Z^d$ also \frac12 $\frac12$ $\endgroup$ – Calvin Khor Oct 8 '20 at 10:18

A problem is who gets to decide which shortcuts should be used? Some denote the natural numbers by $\mathbf{N}$ others by $\mathbb{N}$. Presumably in both groups there are some that use \N as shortcut and then would want their shortcut on here.

In my experience it can already be a problem with a couple of co-authors to agree on a set of macros. I do not expect this to be feasible here.

I actually disagree regarding your point 2, at least partially. It does not become easier by this: \rightarrow is pretty self-explanatory by contrast \ra could mean all kinds of things.

For those that need a specific bulky command frequently, in a specific post, there is the option to have their own short-cuts defined in there. One can also write things using ones macros locally and expand locally to 'normal form' before posting. This is sufficient, I think.

  • $\begingroup$ I nominate you to decide, quid! Seriously though, couldn't we have several people make proposals for a standard set of shortcuts, and then vote on them in meta? As for your $\mathbf{N}$ vs. $\mathbb{N}$ comment: why not make the first \N and the second \NN? $\endgroup$ – Viktor Vaughn Nov 12 '16 at 23:49
  • 2
    $\begingroup$ What do you propose to do if a macro gets introduced and then a year later opinions on the macro drastically change? $\endgroup$ – quid Nov 13 '16 at 15:05
  • $\begingroup$ We could always have a referendum and another meta thread after a year to see if opinions had changed. Anyway, this thread has quite a few downvotes (even though the past threads on this topic are positively voted), so maybe it's not an interesting idea to most users. $\endgroup$ – Viktor Vaughn Nov 13 '16 at 21:17
  • 6
    $\begingroup$ Perhaps my point was not quite clear: the problem is we will not be able to simply change it back after a year for then we will break the posts where it was used while it worked. (Somebody would have to fix them.) There is likely little to be said against having say \lcm to work, but generally I think we should resist to go down the road of customization. Also consider that we are not even the only SE site that uses MathJax. So we might need or at least want to coordinate with other sites. $\endgroup$ – quid Nov 13 '16 at 21:33
  • $\begingroup$ Why would a change break posts, as long as the macros were purely semantic? For example, if \N were re-defined from \boldmath N to \mathbb N, then all that would happen would be that a bunch of posts would look different. I would almost argue that this would be an advantage, enforcing uniformity of notation, in the same way as a big software project enforces uniformity of code styles. $\endgroup$ – LSpice Mar 21 '18 at 17:12
  • $\begingroup$ (Can I use this as my opportunity to plead that the SO software should also re-render @-notifications per view? I hate reading old comments and trying to guess what user has changed his or her name since the discussion took place.) $\endgroup$ – LSpice Mar 21 '18 at 17:13
  1. No, we don't. It makes little sense to do such a thing: we have a universal list of codes, and we gain nothing in changing them into shorter ones. Part of the usefulness of some of the codes is the fact they are self explanatory, and shortening them destroys this. You can always put a preamble in your post with some redefinitions of operators if it suits you, like you can do in any TeX file. To illustrate, look at this. I strongly encourage not to overuse this feature, like the linked answer does. If we all start doing this, pages will begin to break and have ridiculous long load times.
  2. It probably is, but in view of the first item, we shouldn't care about this.
  • $\begingroup$ It "makes little sense to do such a thing." I agree with you that shortening \rightarrow to \ra is not very useful (plus you can just use \to), but I think it would be very sensible to implement some of the common ones, such as \Z \Q \R \C (or some variant thereof). The \operatorname ones are the worst: if I want to type \GL \SL \U \SU \O \SO or \Hom \Aut \End or even \lcm, I need to write a newcommand or spend my life typing \operatorname over and over. $\endgroup$ – Viktor Vaughn Nov 12 '16 at 23:47
  • $\begingroup$ Thanks for pointing out that \newcommand works here. I wasn't aware of this. Can you clarify what you mean by "pages will break" if the feature is overused? I can understand additional loading times, but not outright breakage. $\endgroup$ – Bungo Nov 13 '16 at 3:59
  • 2
    $\begingroup$ @Bungo a problem is that the effect of such definitions is, contrary to what one might expect, not confined to the post. (Except that got changed at some point.) Thus there can be interactions. Especially an unwise renewcommand could cause real problems easily. $\endgroup$ – quid Nov 13 '16 at 14:49
  • $\begingroup$ For example @Bungo try to reply $\cos x \le 1$ to me here. And see what it gives. Now this is obviously an extreme troll case but there could be good-faith uses that cause problems. $\renewcommand{cos}{\textbf{MUAHAHHA }}$ $\endgroup$ – quid Nov 13 '16 at 15:02
  • 1
    $\begingroup$ Testing: $\cos x \leq 1$ $\endgroup$ – Bungo Nov 13 '16 at 17:47
  • 1
    $\begingroup$ @quid Ha, thanks for the explanation and illustration! (In case it's not clear to others what happened, I typed \cos but got MUAHAHHA instead.) $\endgroup$ – Bungo Nov 13 '16 at 17:52
  • 1
    $\begingroup$ @quid That's very evil. People shouldn't know about this. Oh, dear. Seems my edit changed your cosine too. $\endgroup$ – Pedro Tamaroff Nov 13 '16 at 20:17
  • $\begingroup$ Haha, this is fantastic. Now I can have a macro for an evil laugh whenever I want. $\cos$! $\endgroup$ – Viktor Vaughn Nov 13 '16 at 21:18
  • 3
    $\begingroup$ @quid Four years later, your trolling attempts are now a miserable failure! $\textbf{MUAHAHHA}$. $\endgroup$ – Asaf Karagila Oct 7 '20 at 10:50
  • 2
    $\begingroup$ @Asaf indeed but it was fun while it lasted. $\endgroup$ – quid Oct 7 '20 at 17:27

You must log in to answer this question.

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