7
$\begingroup$

Following Mark Bennet's question on Short and helpful advice on using Mathjax on this site, I've began drafting a tutorial aimed at complete beginners. It can be found here. It is made up of $5$ sections:

  1. Getting started
  2. Understanding MathJax syntax
  3. Numbers and arithmetic
  4. Functions
  5. Chaining syntax together

(There's also a section on calculus notation, but I'm considering breaking that off from the main answer since it doesn't strike me as completely essential that a user knows those commands right off the bat.)

I've tried my best to include the syntax that comes up the most frequently, but it's almost certain that I have omitted a thing or two. Does anyone have the technical know-how to search through this site to find the MathJax commands that come up the most frequently in posts? Perhaps there is a way of finding this out using the site analytics. Thank you.

$\endgroup$
22
  • 2
    $\begingroup$ A simple way would to use the standard search with common commands. Like \frac, \sum, \int etc. This gives an idea of relative frequency. Since it's about frequent ones its not very likely that something relevant gets forgotten, especially if it is done as a group, posting results here. That said beyond absolute frequency there is also necessity. E.g., I frequently use \dots, but it's hardly essential and the the direct "..." is not that much worse. $\endgroup$
    – quid Mod
    Feb 22 at 18:18
  • 1
    $\begingroup$ \dots!? Why not the slicker, more modern \dotsc, \dotsb, and so on? :P $\endgroup$
    – Xander Henderson Mod
    Feb 22 at 18:20
  • 2
    $\begingroup$ Heretics! Embrace the superior \cdots. $\endgroup$
    – Alexander Gruber Mod
    Feb 22 at 18:45
  • $\begingroup$ The trigonomtric functions $\sin x , \cos x \tan x$ $\endgroup$
    – MtGlasser
    Feb 22 at 20:50
  • $\begingroup$ I think the comments here suggest a short section on the fact that there are alternative ways of doing the same thing, and occasionally there are people who will insist that one is better than the other ... . Elegance can be possible, but comprehensibility is essential. $\endgroup$ Feb 22 at 21:28
  • 1
    $\begingroup$ In reference to Arydeva's comment, we have \sin x, \cos x, \tan x, etc. $\endgroup$
    – amWhy
    Feb 22 at 21:56
  • $\begingroup$ @Xander How'd you forget \cdots? Also, separate from that, users should know that to write a set, using braces, then need to write \{ fee, fie, fum\}; without the backslash they will not render when surrounded with dollar signs, e.g. ${1, 2, \ldots}$ renders as ${1, 2, \ldots}$ $\endgroup$
    – amWhy
    Feb 22 at 22:03
  • 2
    $\begingroup$ Oops, I meant @AlexanderGruber: just as important as \cdots are \ldots!!! $\endgroup$
    – amWhy
    Feb 22 at 22:20
  • $\begingroup$ To @Joe, nothing in either your post suggests, and in Mark's post it is entirely overlooked the huge field that logic plays in math: implies, if and only if, and, or, not, occur throughout most areas of mathematics: In order: \rightarrow or \to, \leftrightarrow or \iff, \land or \wedge, \lor or \vee, \lnot or \neg $\endgroup$
    – amWhy
    Feb 22 at 22:26
  • $\begingroup$ @amWhy I don't use \cdots or \ldots. I use \dotsc for dots in lists (this is essentially \ldots, but with slightly more semantic information, \dotsb between binary operators (like \cdots, but with better spacing), and \dotsi between integrals (like \cdots, but with better spacing for integrals. There are several similar commands: tex.stackexchange.com/questions/122491/difference-of-the-dots . $\endgroup$
    – Xander Henderson Mod
    Feb 22 at 22:27
  • 1
    $\begingroup$ I suggest that in different fields of math, the most basic commands needed to initially post questions are far more than calculus-oriented commands. Perhaps we need to identify the primary commands needed Freshman/Sophomore/Junior level classes. $\endgroup$
    – amWhy
    Feb 22 at 22:31
  • 1
    $\begingroup$ @Xander Heretic! No seriously, that's good to know! $\endgroup$
    – amWhy
    Feb 22 at 22:33
  • $\begingroup$ Joe, has anything been mentioned about writing fractions? Instead of seeing countless examples of "how to reduce 1+x/(1-x)^2 which is entirely ambiguous, highlighting \frac {1+x}{(1-x^2} would save askers and potential answerers a whole lot of time and spare them from frustration. Similar, \gcd(foo, fie) \mid. If you want basic think basic. $\endgroup$
    – amWhy
    Feb 22 at 23:02
  • $\begingroup$ \mod, \bmod and \pmod might be worth a mention. $\endgroup$ Feb 22 at 23:38
  • $\begingroup$ \Bbb for our favourite sets, \tag for equation numbering, align environment for long chains of equations, ... $\endgroup$ Feb 23 at 2:33
12
$\begingroup$

It's possible to analyze this with help of the Stack Exchange Data Explorer if you know a bit of SQL. The procedure is as follows:

  • Split the body of the post into several chunks, splitting on the \ character
  • Check which alphabetical characters appear at the beginning of each chunk
    • Luckily, all posts starts with <p> so the first chunk, which is not a MathJax command, is ignored

Aggregate all the results, and you get this query. I'm actually surprised it didn't timeout on the volume of posts, but here are the commands which are used over a million times:

Command Times used
\frac 5248808
\mathbb 1861001
\in 1668461
\right 1552969
\left 1539656
\sqrt 1248791
\infty 1205941
\pi 1059025
\int 1042355
\sum 1036783

Of course, this does not cover the other syntaxes (e.g. curly braces), but at least it's a start.

$\endgroup$
6
  • 4
    $\begingroup$ This is precisely what I needed. Thank you very much. $\endgroup$
    – Joe
    Feb 23 at 14:46
  • 2
    $\begingroup$ How does one have \right without a matching \left? $\endgroup$ Feb 24 at 9:48
  • 3
    $\begingroup$ @TheSimpliFire no idea, but it doesn't feel \right ... $\endgroup$
    – Glorfindel
    Feb 24 at 9:52
  • 1
    $\begingroup$ I don't know SQL but perhaps can search for all posts CONTAINING \right NOT \left -- I suspect most of them will actually be examples of incorrect MathJax where the equations aren't displayed correctly. $\endgroup$ Feb 24 at 9:55
  • $\begingroup$ @TheSimpliFire Some of those occurrences might be outside MathJax. (AFAICT it would be rather difficult to include also a test whether the text is inside MathJax, because there are many various ways how one could enter MathJax.) $\endgroup$ Feb 24 at 13:12
  • 1
    $\begingroup$ If somebody wants play around a bit more, here are Posts with macro1 but not macro2. There are at least some posts which contain the string "left\right" in the text (outside MathJax). My guess would be that various similar cases might be responsible for the difference. (You might notice that there's also a different number of occurrences of \begin and \end - maybe for similar reasons.) $\endgroup$ Feb 24 at 13:26

You must log in to answer this question.

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