This is an essay. It contains the advice or opinions of one or more Wikipedia contributors. This page is not an encyclopedia article, nor is it one of Wikipedia's policies or guidelines, as it has not been thoroughly vetted by the community. Some essays represent widespread norms; others only represent minority viewpoints. |
In the early days of the use of TeX on Wikipedia (in about 2003), \text and \mathrm were not available, but \mbox was used as a workaround to set things in text style within math tags, and for some years, that was even suggested in the mathematics style manual. The less important reason for not doing that is that it does not always yield the same results that \text or \mathrm yield. For example:
The subscript text in the first integral above, using \mbox, is conspicuously bigger than in the second, which uses \text (on some browsers, you might not see this effect if you're using mathJax, and on others you will, and it may also depend on how you have set your preferences). \text, on the other hand, uses sizes appropriate to the particular context in which it is used.
The more important reason is that it misleads people about the correct use of \mbox when LaTeX is used in the normal way, as opposed to the way it's used on web pages. Vast numbers of people seem to have learned this from Wikipedia and taken it to other internet forums, since it continued to be suggested at WP:MOSMATH for years after it was no longer needed.
When LaTeX is used in the normal way, as opposed to being used on web pages, \mbox does not have the effect of causing things to appear in text mode; nor is that its purpose. Its purpose is to prevent infelicitous line-breaks. Thus, suppose you write
It may be considered undesirable for the digit "3" to appear alone on the next line, especially at the end of a paragraph:
That can be prevented by writing
The sentence may then appear thus:
but if further editing of material earlier in the document should cause the sentence to get too long to fit on the line, then it will appear thus:
This works regardless of whether text-mode or math-mode is used. Thus suppose you type
so that the reader sees something like this:
(the two "$"s cause x + y to appear in math mode, including the italicization and spacing conventions). But a line-break could result in the reader seeing any of these:
If you type instead
then any line-break in will appear no later than just after the word "more":
None of this works within Wikipedia. This is how LaTeX behaves when used in the normal way as typesetting software, as opposed to its use on web pages. Using \mbox as a substitute for \text within math tags on Wikipedia misleads users about the behavior and intended purpose of \mbox in normal LaTeX documents.