41
$\begingroup$

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 $\rm\LaTeX$ in question titles in one place, the CW answer to this question.

$\endgroup$
  • 7
    $\begingroup$ 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. $\endgroup$ – J. M. is a poor mathematician May 23 '13 at 17:12
  • $\begingroup$ 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! $\endgroup$ – Asaf Karagila May 23 '13 at 17:21
  • 1
    $\begingroup$ @Asaf I draw your attention to the last bit of the sentence: "when this yields very large brackets". Could do with rephrasing, I guess. :) $\endgroup$ – Lord_Farin May 23 '13 at 17:23
  • 1
    $\begingroup$ @Lord_Farin: With very large brackets comes very large responsibility. (And apparently it comes five years too late... :)) $\endgroup$ – Asaf Karagila Mar 12 '18 at 21:21
  • $\begingroup$ 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. $\endgroup$ – Calculemus May 25 at 14:20
31
$\begingroup$

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.

$\endgroup$
  • $\begingroup$ Please, by all means, feel free to augment this if you feel there's room for improvement. $\endgroup$ – Lord_Farin May 28 '13 at 6:48
  • $\begingroup$ 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. $\endgroup$ – zyx Jun 8 '13 at 3:35
  • $\begingroup$ @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. $\endgroup$ – Lord_Farin Jun 8 '13 at 7:06
  • $\begingroup$ 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. $\endgroup$ – zyx Jun 8 '13 at 13:38
  • 1
    $\begingroup$ So \limits in titles is allowed? $\endgroup$ – punctured dusk Jun 28 '17 at 11:40
  • $\begingroup$ 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. $\endgroup$ – J. M. is a poor mathematician Mar 9 '18 at 13:12
  • $\begingroup$ I would like to reemphasize the question asked by barto: should be allow \limits in titles? My own preference would be not to... $\endgroup$ – Xander Henderson Aug 20 '18 at 18:43
  • $\begingroup$ @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. $\endgroup$ – user1729 Aug 21 '18 at 8:53
  • $\begingroup$ "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$. $\endgroup$ – user486983 Sep 14 '18 at 1:00
  • 1
    $\begingroup$ @Isa Please read the answer: "what is the rationale..." $\endgroup$ – Lord_Farin Sep 14 '18 at 6:05
9
$\begingroup$

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}$

There's a difference. From this page:

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.

$\endgroup$
  • 11
    $\begingroup$ But I think that using MathJax for text formatting in the title is bad. $\endgroup$ – Asaf Karagila May 23 '13 at 18:12
  • $\begingroup$ I did my best to discourage it in my post; should we just ban it outright? $\endgroup$ – Zev Chonoles May 23 '13 at 18:16
  • 4
    $\begingroup$ 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. $\endgroup$ – Asaf Karagila May 23 '13 at 18:21
  • 2
    $\begingroup$ 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. $\endgroup$ – Asaf Karagila May 23 '13 at 18:22
7
$\begingroup$

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.

$\endgroup$
  • 2
    $\begingroup$ 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). $\endgroup$ – Najib Idrissi Oct 4 '14 at 14:07
  • $\begingroup$ 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. $\endgroup$ – user147263 Oct 4 '14 at 21:22
  • $\begingroup$ 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. $\endgroup$ – Parcly Taxel Mar 9 at 10:53
6
$\begingroup$

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.

$\endgroup$

You must log in to answer this question.

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