# Guidelines for good use of MathJax in question titles

Motivation:

Every once in a while, I find myself making edits like this one, where OP (likely due to inexperience in asking questions) has used display math mode ($$ delimiters) and/or the \displaystyle or \dfrac commands in ways discouraged by the community. This issue has been around for a while, see e.g. this meta question. In line with the more-or-less universally supported initiative to be more communicative to especially new users, I have been making remarks similar to the one I just added to the comment templates thread, giving a short explanation of why not to use these functionalities of MathJax in titles. Question: In an attempt to make this all more accessible to new users without them having to commit one of these mistakes, this question intends to gather all guidelines on the use of MathJax in question titles in one place, the CW answer to this question. • To add to point 3: the MathJax menu interferes with the usual menu when right-clicking on a title that is entirely in \TeX, making it difficult to do things like opening links in new windows/tabs. May 23, 2013 at 17:12 • I don't think we should condone \left\right uses completely. One should use it with care, though. The problems occur when people write complex three-deck fractions, and it gets when when they use \dfrac in all of them! – Asaf Karagila Mod May 23, 2013 at 17:21 • @Asaf I draw your attention to the last bit of the sentence: "when this yields very large brackets". Could do with rephrasing, I guess. :) May 23, 2013 at 17:23 • @Lord_Farin: With very large brackets comes very large responsibility. (And apparently it comes five years too late... :)) – Asaf Karagila Mod Mar 12, 2018 at 21:21 • I think a picture of what \displaystyle looks like on the front page would aid in understanding what the issue is. I have never seen a \displaystyle title, so I have no idea how bad it is. May 25, 2019 at 14:20 ## 4 Answers In addition to the below title-specific $$\rm\LaTeX$$ guidelines, there is of course the MathJax tutorial and quick reference. 1. The primary rule for using $$\rm\LaTeX$$ in titles is to be vertically terse. Try to make your title take up as little vertical space as possible (the height of $$\sum\limits_{n=1}^\infty$$ is an approximate upper bound for what is admissible). In particular: • Do not use display math mode ($$ delimiters) or \displaystyle to force big integrals, sums, and other constructs. Similarly, avoid constructs like \dfrac or \dbinom which implicitly use display mode. To achieve $$\lim\limits_{n\to\infty}$$, the \limits command exists: \lim\limits_{n\to\infty};

• Do not use \left and \right (or other scaling commands) when this yields very large brackets. Furthermore, do not use environments in titles (such as the "cases" environment \begin{cases} .. \end{cases}).

What is the rationale behind these rules for limiting vertical space?

The main page contains the recent questions. Its vertical space is very limited, and therefore valuable. Using big $$\rm\LaTeX$$ in your title will push other questions outside of the visibility range of (some) visitors; because one question is not inherently better than another for using such constructs, they are to be avoided at all times.

2. Ensure that the title contains some actual words, and not only $$\rm\LaTeX$$ -- the search functionality of MSE does not interact well with typeset mathematics, making questions comprising only $$\rm\LaTeX$$ (much) harder to find. Furthermore, the MathJax context menu (which pops up when you right-click on some typeset expression) overrides the browser's link context menu, making e.g. opening the question in a new tab difficult.

3. Do not use MathJax to typeset (e.g., italicize) your title. It does not look nice in plaintext fields like users' notifications, and questions with MathJax in their titles will not be shown in the "Hot Network Questions" list.

• Please, by all means, feel free to augment this if you feel there's room for improvement. May 28, 2013 at 6:48
• Long LaTeX formulas in the title can display as "..." in users' Questions and Answers lists. An example is the entry for "How to prove ..." here (A, math.stackexchange.com/users/76172/awkward ) and here (Q, math.stackexchange.com/users/42912/user42912 ) . Maybe it can be hacked around by splitting the LaTeX into multiple sections.
– zyx
Jun 8, 2013 at 3:35
• @zyx That doesn't happen for me; the TeX is smeared out over two lines, though (perhaps your screen is not 1600x900). It would be awesome to see integration of MathJax into SE to a point where the formulas are first rendered, and then possibly partially disappear on the right. Jun 8, 2013 at 7:06
• It seems to be a function of the width of the browser window and consequent scaling of the width of the question lists. I was able to switch back and forth between "..." and displayed LaTeX by adjusting the browser width.
– zyx
Jun 8, 2013 at 13:38
• So \limits in titles is allowed? Jun 28, 2017 at 11:40
• Bumping after the umpteenth all-$\LaTeX$ title I encountered in the past few days. People, please be conscientious about this, as well as the \displaystyle issue. Mar 9, 2018 at 13:12
• I would like to reemphasize the question asked by barto: should be allow \limits in titles? My own preference would be not to...
– Xander Henderson Mod
Aug 20, 2018 at 18:43
• @XanderHenderson I think the answer should be "no", by applying the first rule: "1.The primary rule for using $\LaTeX$ in titles is to be vertically terse." Compare the heights of $\lim_{n\rightarrow\infty}f(x)$ and of $\lim\limits_{n\rightarrow\infty}f(x)$. So: use \limits in the main body, but not in the title. This is just some text to make the comment longer so that the heights can be properly compared. Aug 21, 2018 at 8:53
• "Try to make your title take up as little vertical space as possible" why? Is it just because it's a rule for using $\rm \LaTeX$? It looks better when you write $\displaystyle\sum_{n=1}^\infty$ than $\sum_{n=1}^\infty$. Also when you write in white paper you write something very similar to $\displaystyle\sum_{n=1}^\infty$ not $\sum_{n=1}^\infty$.
– user486983
Sep 14, 2018 at 1:00
• @Lord_Farin What do you mean with "the search functionality of MSE does not interact well with typeset mathematics" ? What is the search functionality?
– user486983
Dec 19, 2019 at 23:10
• @Lord_Farin Ragarding your second bullet, what can one use if not $\begin{cases}...\end{cases}$ to represent a function explicitly on the title of a question?
– user486983
Dec 19, 2019 at 23:12
• Just to add to the above comments, personally I prefer $\lim\limits_{n\to\infty} x_n$ over $\lim_{n\to\infty} x_n$. So my vote be in favor of allowing \limits in the titles. (But I agree that \displaystyle is not a good idea.) May 17 at 7:19

Markdown doesn't work in titles, so occasionally people will use MathJax as an approximation.

$quod\;erat\;demonstrandum$                   produces     $quod\;erat\;demonstrandum$

Please don't do this; honestly, trivial formatting is not necessary in a question title (and it doesn't look nice in the "hot questions" list, which does not render MathJax). You'll have the opportunity to do all sorts of fancy formatting in the question body. If you simply can't live without your title having formatting, do it right.

$\textit{quod erat demonstrandum}$     produces     $\textit{quod erat demonstrandum}$

When writing equations, LaTeX assumes that a series of letters without spaces represents a set of distinct variables and typesets them accordingly: with an extra bit of space between each of them, in order to emphasize that they are distinct entities. Therefore, if you want an actual word, use \mathit (math italics) or \mathrm (math roman): $x_\mathit{max}$, not $x_{max}$...

Similarly, $text$ is not the approved way to write italics in regular body text (for the same reason as above)...

Besides making spacing between the letters correct for text, and making the \; spaces unnecessary, the \textit command is semantically correct in my example, since the italic font is being applied to something non-mathematical.

• But I think that using MathJax for text formatting in the title is bad.
– Asaf Karagila Mod
May 23, 2013 at 18:12
• I did my best to discourage it in my post; should we just ban it outright? May 23, 2013 at 18:16
• I think so. We should say "don't use it." The titles appear in the message box, and in the "hot questions" where MathJax is not compiled, and people from outside the site see just the code. It's fine to use formulas in the title, because we really want that. But text formatting? I think we can certainly live without that. Using quotation marks to discern something from the text in the title is enough.
– Asaf Karagila Mod
May 23, 2013 at 18:21
• The only reasonable use is when you are using $\sf ZFC$ or $\sf PA$, or something like that, which is something that you'd have written in a math-mode command when writing a paper.
– Asaf Karagila Mod
May 23, 2013 at 18:22

Currently, questions with TeX markup in title are excluded from Hot Network Questions. On one hand, this removes the concern about users of other SE sites seeing unparsed markup in the sidebar. On the other hand, this raises the concern about users of other SE missing out on accessible Math.SE posts they would be interested in. I think this aspect should be considered when editing questions that can be useful to a broader audience, especially when the benefit of markup is purely cosmetic.

Concrete example: an experienced user slightly edited a question title from

can someone explain how tanx/secx = sinx?

to

Can someone explain how tan x / sec x = sin x?

but refrained from introducing TeX markup. This allowed the question to stay in Hot Questions and amass 1300+ views in less than one day. But when another user edited the title to

Can someone explain how $\frac{\tan x}{\sec x}=\sin x$

that was the end of the question's popularity: it was immediately removed from the sidebars around the network.

• This brings another question, do we want questions to receive more attention from other SE sites? Hot Questions typically gather inordinate amounts of upvotes for... less than adequate content (or at least, questions and answers that really don't deserve the 30+ upvotes as much as many other good answers and questions). Oct 4, 2014 at 14:07
• Depends on what the question is. If the answers give a good explanation of what complex numbers are, then I'd like that to be read more widely, and do not mind the reputation windfall that the authors reap. If it's some funny math-themed picture or puzzle that gets upvoted for lulz, then I do mind a bit. But even then, I try to remember this is not a zero-sum game: removing a popular post from Hot list would not bring more attention to other posts.
– user147263
Oct 4, 2014 at 21:22
• Regardless of the public appeal, $\LaTeX$ should still be used for mathematical expressions and numbers in a mathematical context (i.e. whose value is necessary to understand the specific question). See this question. Mar 9, 2019 at 10:53

I think that we should also forbid \newcommand on the title. Sure, if done right there's no harm in this, but this can be a huge slippery slope for either small mistakes that accumulate to ravage the front page, or worse.

• I haven't seen it used, but indeed. Even worse, consider \renewcommand hidden in an arbitrary title that contains no further TeX. If applied to, say, \lim or \int, that could spark some interesting stuff... May 31, 2013 at 22:39
– Asaf Karagila Mod
May 31, 2013 at 22:53
• We should of course link to this... Jun 1, 2013 at 2:04
• @J.M.isnotamathematician: And/or this. Mar 10, 2018 at 18:57
• Two relatively recent posts which show some problems that might under some circumstances be caused by macros defined in the titles: A possible bug regarding MathJax, previews, and the arctangent/tangent functions? and MathJax rendering in preview but not in actual post? Feb 7, 2019 at 17:06