Wikipedia talk:Manual of Style/Mathematics

From Wikipedia, the free encyclopedia
Jump to: navigation, search
WikiProject Manual of Style
WikiProject icon This page falls within the scope of WikiProject Manual of Style, a drive to identify and address contradictions and redundancies, improve language, and coordinate the pages that form the MoS guidelines.
 
Shortcut:

The use of \text in <math> in certain circumstances[edit]

Recently I've seen a use of \text in <math> tags update< incorrectly >, like Planck units#Base units:

 \frac{F}{F_\text{P}} = \frac{\left(\dfrac{m_1}{m_\text{P}}\right) \left(\dfrac{m_2}{m_\text{P}}\right)}{\left(\dfrac{r}{l_\text{P}}\right)^2}.

If you are using MathJax renderer, it doesn't look harmonious at all, as MathJax renders \text as sans-serif like the surrounding text. I've been in the process of changing some articles to use \mathrm, so it looks like this (please switch to MathJax in order to see the difference):

 \frac{F}{F_\mathrm{P}} = \frac{\left(\dfrac{m_1}{m_\mathrm{P}}\right) \left(\dfrac{m_2}{m_\mathrm{P}}\right)}{\left(\dfrac{r}{l_\mathrm{P}}\right)^2}.

For me at least it looks a lot better, so I went ahead and changed some of them. However I just want to ask here the community's opinion before proceeding further. What do you think about the tag used?

Some other options that don't work in MathJax:

\textrm

 \frac{F}{F_\textrm{P}} = \frac{\left(\dfrac{m_1}{m_\textrm{P}}\right) \left(\dfrac{m_2}{m_\textrm{P}}\right)}{\left(\dfrac{r}{l_\textrm{P}}\right)^2}.

\mathsf (shows sans serif in PNG too)

 \frac{F}{F_\mathsf{P}} = \frac{\left(\dfrac{m_1}{m_\mathsf{P}}\right) \left(\dfrac{m_2}{m_\mathsf{P}}\right)}{\left(\dfrac{r}{l_\mathsf{P}}\right)^2}.

Timothy G. from CA (talk) 02:17, 3 March 2015 (UTC)

Also not working in MathJax but working in PNG:

\mbox

 \frac{F}{F_\mbox{P}} = \frac{\left(\dfrac{m_1}{m_\mbox{P}}\right) \left(\dfrac{m_2}{m_\mbox{P}}\right)}{\left(\dfrac{r}{l_\mbox{P}}\right)^2}.

So it seems that only \mathrm works in all setups, others just look plain weird.

Timothy G. from CA (talk) 02:21, 3 March 2015 (UTC)

Also works for all layout engines: \rm

 \frac{F}{F_{\rm P}} = \frac{\left(\dfrac{m_1}{m_{\rm P}}\right) \left(\dfrac{m_2}{m_{\rm P}}\right)}{\left(\dfrac{r}{l_{\rm P}}\right)^2}.

Timothy G. from CA (talk) 23:32, 4 March 2015 (UTC)

Note that I do not want to change every single \text to \mathrm, only ones appropriate should be changed. Some of the circumstances I can think of where \text is appropriate is prose labels or anything that does not strictly need mathematical notations, like some equations on Navier–Stokes equations#Incompressible flow. Timothy G. from CA (talk) 01:10, 5 March 2015 (UTC)

Descriptive subscripts ought to be \mathrm in LaTeX. If it looks better, and it's more correct in principle, then that sounds like a double win to me. Quietbritishjim (talk) 16:58, 4 March 2015 (UTC)
@Quietbritishjim: that's what I thought. Do you think this should be added to the MoS? Timothy G. from CA (talk) 17:48, 4 March 2015 (UTC)
@Quietbritishjim: "ought to be"? I'm not saying anything either way at this point, but your rationale would be appreciated.
@Timothy Gu: \mbox is deprecated/discouraged, as I understand it. I get a "[Math processing error]" with MathJax on the machine I'm on at the moment, so difficult to comment. If \text is producing a problematic (non-harmonious) display on some browsers, it may make more sense to get to the bottom of the problem with the rendering, rather than to fix it via avoidance in the MoS. \text has been a standard part of TeX on WP for a long time. —Quondum 19:34, 4 March 2015 (UTC)
@Timothy Gu: Well, that is just my opinion and understanding of convention. But I believe such labels should be should be in the math font if it differs from the text font (as it does on Wikipedia, and a Times text / CM math document) because although the label is descriptive it's still part of some math. I also believe they should be upright regardless of whether the surrounding text is italic, either because the whole document is ( D-: ) or because this math is in emphasised text (e.g. in a theorem). \text gets both of them wrong, while \mathrm gets them right and agrees with \operatorname. Looking into it more, I notice that there is a problem though: if the math font is sans-serif then \mathrm still produces serif characters, which is not what you want. Unfortunately it seems there is no built-in math equivalent of \textup. Quietbritishjim (talk) 22:02, 4 March 2015 (UTC)
My opinion: \text and \mathrm are for two different things, both useful. \text is for when you want to include English-language prose within an equation, for instance the word "otherwise" in a \cases. \mathrm is for when you want to have short sequences of Roman alphabet letters that are themselves mathematical notation (not free-form prose); the example of a roman letter subscript is one where \mathrm is the better choice. Another alternative coding to consider is \operatorname, for mathematics notation written out as short sequences of Roman letters used as a function or operator (e.g. sin or cos) but not already built into LaTeX. The letters themselves should be formatted the same as \mathrm but the spacing around the operator should be better with \operatorname. So we should not be telling editors to prefer \text over \mathrm or vice versa, we should be using both where appropriate. —David Eppstein (talk) 22:43, 4 March 2015 (UTC)
@Quietbritishjim: I'd agree with David Eppstein here. But as LaTeX uses serif and it is unlikely to change in the future I'd stick with \mathrm. Timothy G. from CA (talk) 23:32, 4 March 2015 (UTC)
@Quondum: seems like I didn't make myself clear enough. I do not intend to do a wholesale removal of \text in all articles. I most certainly have seen cases where it is appropriate (can't find the article right now). Timothy G. from CA (talk) 23:09, 4 March 2015 (UTC)

Also I found out about a similar discussion on TeX StackExchange. It suggests to use \textnormal which is not available in MathJax at least; \mathup, but it is with a custom definition; and then \mathrm. So, I guess mathrm it is. Timothy G. from CA (talk) 23:32, 4 March 2015 (UTC)

If we do put something into the MoS, something like what David Eppstein proposes seems to make sense. The distinction between a subscripted text label and a Roman symbol is potentially semantically significant, so it would seem to me to be that \text is still semantically appropriate for labels. For example, the electron magnetic moment might be denoted \text \mu_\text{e}, where the subscript is literally a text label ("e" for "of the electron"), not a mathematical symbol such as a specific element of a set, for which I would prefer \mathrm.
@Timothy Gu: You are proposing a workaround for a rendering bug, not an issue of style. Subscripted text can be text and not symbols, so this does not contradict what David Eppstein is saying. Perhaps you should raise this at the Village pump (for fixing it), and at a place like WikiProject Mathematics (with respect to a settling on an interim workaround)? —Quondum 00:10, 5 March 2015 (UTC)
@Quondum: I agree with David's point as well. However, as I already said in my last reply, I was only referring to some specific use, not general-purpose labels. Plus, I do not consider \text being rendered as the way it is a bug, therefore I don't want to go to village pump for this. It is by definition rendered to the styles of surrounding text, which it is. It is just that many usage of \text is inappropriate on a semantic level as well. An appropriate use of \text IMO can be found on Navier-Stokes equations#Incompressible flow, reproduced below:
\overbrace {\underbrace {{\frac {\partial {\mathbf {u}}}{\partial t}}}_{{{\begin{smallmatrix}{\text{Variation}}\end{smallmatrix}}}}+\underbrace {{\mathbf {u}}\cdot \nabla {\mathbf {u}}}_{{{\begin{smallmatrix}{\text{Convection}}\end{smallmatrix}}}}}^{{{\text{Inertia (per volume)}}}}\overbrace {-\underbrace {\nu \nabla ^{2}{\mathbf {u}}}_{{{\text{Diffusion}}}}=\underbrace {-\nabla w}_{{{\begin{smallmatrix}{\text{Internal}}\\{\text{source}}\end{smallmatrix}}}}}^{{{\text{Divergence of stress}}}}+\underbrace {{\mathbf {g}}.}_{{{\begin{smallmatrix}{\text{External}}\\{\text{source}}\end{smallmatrix}}}}
The sans-serif font of the labels fits perfectly with the surrounding text.
To reiterate my point, certain if not most usage of \text is not appropriate and should be changed to \mathrm, but \text is still useful in many cases where non-mathematical/prose text is required, and I am happy with the way it is rendered as-is. Timothy G. from CA (talk) 01:10, 5 March 2015 (UTC)
In the MathML+SVG rendering mode that the developers are (IMO foolishly) standardizing on, when viewed in Chrome (which uses the SVG fallback), the labels are not sans-serif. They are a serif font that is unrelated to the body text. —David Eppstein (talk) 17:58, 24 July 2015 (UTC)
@Timothy Gu: I hear you that you do not intend to change everything. But if it renders differently in a respect that is significant in different rendering environments (and it is obviously significant, because you're making a thing of it to the point of suggesting a MoS change), it is a bug, period. \text renders as a serif font in every context that I can test at the moment (MathML and PNG), and I'll check tonight (when I have a different computer) whether it is the same on MathJax for me; this is already makes your "I am happy with the way it is rendered as-is" inapplicable. It is sounding as though your entire argument is based around rendering on a single browser+configuration+installation+MathJax. —Quondum 01:50, 5 March 2015 (UTC)
@Quondum: TBH I am surprised that you did not check the output from MathJax until this moment, which makes your argument sounds moot. This "bug" applies to all browsers using MathJax, so you can easily reproduce this. It is not depended upon your "browser+configuration+installation". Timothy G. from CA (talk) 02:28, 5 March 2015 (UTC)
Surprised? I indicated earlier that 'I get a "[Math processing error]"' on the machine I was working on when selecting MathJax (in place of every expression that MathJax was supposed to be rendering), and thus could not check. I see now that I have had the opportunity that I get the same rendering error on my other machine, though this had worked in the past. I'll accept that it might be uniform for all MathJax (when it works at all), but it still depends on whether MathJax is being used. But I have no interest in this argument; I do not support a change to the MoS along these lines, but I'll leave it to others to contribute to any consensus on this. —Quondum 03:06, 5 March 2015 (UTC)

Inappropriate italicisation of mathematical constants[edit]

In the International System of Quantities, mathematical constants, like e, i and pi are always upright. The MOS advice is to italicise, which means they can be mistaken for variables. What is the benefit of departing from the international standard? Dondervogel 2 (talk) 17:08, 24 July 2015 (UTC)

Apparently, ISO tried to standardize mathematics without any coordination with the International Mathematical Union. Therefore, there is no hope that mathematicians will change their typographical conventions for adopting ISO choices. For mathematical articles I do not see any benefit to adopt a "standard" which is not the standard in mathematics. In mathematical texts, the mathematical constants are usually italicized, as is every symbol consisting of a single letter (such as a function name). On the other hand the names consisting of several letters are upright. D.Lazard (talk) 18:35, 24 July 2015 (UTC)
I see. Remember that mathematical equations are used in physics and engineering too. What does the IMU have to say on the matter? Dondervogel 2 (talk) 18:37, 24 July 2015 (UTC)
As far as I can tell, the most definitive mathematical-society-produced style guide is still the AMS's Mathematics into Type. It uses italic for e (section 2.4.2c, p.20). I didn't see any examples with π or the imaginary unit meaning of i, but since they generally follow TeX conventions I would expect them to support italic for those as well. —David Eppstein (talk) 20:12, 24 July 2015 (UTC)
The ISO standard is almost universally ignored by mathematical sources. In no way should we mandate a proprietary convention like the ISO, which purports to be "standard", when it is in fact very much non-standard. Sławomir Biały (talk) 20:44, 24 July 2015 (UTC)
Yes. For another example of this, see binary logarithm, where the ISO's recommended notation "lb" is used far less than even the fourth-most-used alternative notation (lg, log2, log, and ld). —David Eppstein (talk) 20:59, 24 July 2015 (UTC)

Unlike what happens in chemistry, astronomy, and biology, mathematicians have no authorities who decree standards. Rather, standards evolve from conventions. And they are sophisticated and precise. Crowdsourcing vindicated yet again. Michael Hardy (talk) 20:14, 24 July 2015 (UTC)

The problem with ISO's attempt to impose a standard for this is that successful standards usually reflect existing practice (except in subjects that are completely new and have no existing practices). There are hundreds of years of mathematical typography in which d, e, and so on were italicized. Decreeing that all of it was wrong changes no one's mind, which is why people have continued writing italics just as they always did. Ozob (talk) 01:11, 25 July 2015 (UTC)
I don't see that ISO is trying to impose anything, nor decreeing anything as wrong. They are simply facilitating progress by providing a standard for people to follow should they choose to. A choice seems to have been not to and I do not yet see an answer to my question "What is the benefit in departing from the ISO standard?" Dondervogel 2 (talk) 21:43, 27 July 2015 (UTC)
The benefit is using the same notation all mathematicians elsewhere use, and thereby being more readable to people used to that notation. That is, we follow the de facto standard, not the false standard imposed by non-mathematicians and ignored by mathematicians. Other lesser but still significant benefits include much greater ease of formatting these symbols within <math> formulas (upright Roman characters are possible in <math> but not particularly easy, and I don't even know whether there is an upright π that works across all of the multiple options for rendering <math> in Wikipedia) and avoidance of edit wars with editors who prefer the usual format and have no inkling that the ISO might have suggested anything different (i.e. probably the majority of mathematics editors). —David Eppstein (talk) 23:25, 27 July 2015 (UTC)
I don't see ISO's efforts in this area as facilitating progress. There were de facto standard typographic conventions. They chose to flout them. Adoption of their notation has been limited; the upright d is seen occasionally, but it's been a variant usage for a long time; upright e and π are essentially unused. If anything, I think the appropriate questions to ask are, "Why adopt ISO notation contrary to standard usage?" and "Why does ISO persist in its non-conformity?" Ozob (talk) 00:55, 28 July 2015 (UTC)
So, in a nutshell: the familiarity of following existing (ambiguous) conventions is preferred over a standard that distinguishes between eccentricity and Euler's number? Dondervogel 2 (talk) 09:32, 28 July 2015 (UTC)
Or with the fundamental charge, or the elasticity, or the identity element of a group? I can't say that's ever been a problem. We deal all the time with possible conflicts between one variable and another. One solution is to use a different letter, or emphasize that this variable is not the same as the one that appears elsewhere if there is a real risk of confusion. A small change in typeface between \mathrm{e} and e does not seem like the best way, and it is certainly not the only way, to handle such a possible collision.
The purpose of a typesetting standard is (or should be) to enhance communication. It fails to do this if it does not already to a large extent agree with standard practices. One cannot enhance communication by insisting that the way people have been communicating for hundreds of years now needs to be changed. One still has to be able to read the papers that were published before the ISO standard went into effect. So, yes, "familiarity" is certainly a more important aspect in a standard than an illusion of unambiguity. Sławomir Biały (talk) 12:42, 28 July 2015 (UTC)
There are only 26 letters in the modern Roman alphabet; when you include capitalization and standard variations, like blackletter and calligraphic type or the Greek alphabet, you still only get a few hundred characters. The sophistication of modern mathematics and science makes it impossible to assign every concept its own symbol without using characters that nobody knows; even letters that people ought to be familiar with, like ξ, get muddled on blackboards all the time. So for purely practical reasons ambiguity is unavoidable.
Moreover, mathematics is not a collection of formulas; it's a rare math paper that has page after page of formulas (and those that do sometimes apologize to the reader). Written mathematics is done using written language, and it's both natural and expected that the writer will make statements like, "Let M be a manifold" or "Let M be a module" just so that the status of M does not have to be inferred from context. Ozob (talk) 13:56, 28 July 2015 (UTC)
@Slawekb. I agree it is not the only way. It might not be the best way either (how can one tell?), but it is better than not bothering to distinguish at all. If all changes were discarded because they lead to unfamiliarity we would still be counting with our fingers, we would not have computers, and we would certainly not be having this exchange on Wikipedia.
@Ozob. I agree that ambiguity in written language is unavoidable, if that's what you mean. I do not agree that ambiguity in mathematical equations is unavoidable, though it can require hard work. Distinguishing between variables and constants by means of italicization can only help.
Dondervogel 2 (talk) 15:14, 28 July 2015 (UTC)
"If all changes were discarded because they lead to unfamiliarity we would still be counting with our fingers, we would not have computers, and we would certainly not be having this exchange on Wikipedia." That's a strawman. I never said that all change from the familiar is bad. Instead, departing from existing standards of communication, instead of trying to codify best practices, actually leads to poorer communication rather than better communication. It's hopefully obvious why that is true. This very discussion is a living example of why. Sławomir
Biały
15:51, 28 July 2015 (UTC)
If I read you correctly, you're suggesting that we can assign each distinct mathematical constant or concept its own unique symbol. While I agree that such an assignment would eliminate ambiguity, it can't be done in practice. You are asking people to change good notation, in which M might stand for a manifold or a module or plenty of other things beginning with the letter "m", for an essentially arbitrary assignment where the symbols have no linguistic associations. Current mathematical practice may not be perfect, but it maintains some amount of order because people see the symbols as meaningful. Ozob (talk) 05:01, 29 July 2015 (UTC)
All I am saying is that I see an advantage in following the conventions of ISO 80000-2. There is nothing in ISO 80000-2 about assigning a unique symbol to each and every concept - that would be absurd. What I see there is a very sensible convention to italicise symbols that represent variables, while operators and mathematical constants are upright. Simple. I do not perceive a serious attempt to discuss the pros and cons of this convention, and therefore prefer to end this discussion. Good day. Dondervogel 2 (talk) 08:12, 29 July 2015 (UTC)

I am still concerned about the use of "π" rather than "π" in many articles (Pi not among the offenders). In the font that Wikipedia normally uses for mainspace text, π is quite ugly and does not look like π as displayed in any textbook whether it's math, physics, or engineering. Shouldn't π be replaced with π everywhere, unless the default font is somehow adjusted? 173.48.62.104 (talk) 00:02, 15 December 2015 (UTC)

I agree. π should almost always be preferred to the default sans π, and the same is true of all Greek letters when used in mathematics. I'm surprised that the MOS makes the recommendation of italic Greek sans lower case, and does not even point out the alternatives supplied by the template. 00:41, 15 December 2015 (UTC)

Scriptstyle for 'math' symbols in running text[edit]

An anon editor of Simple linear regression is under the impression that using "scriptstyle" for <math>ematical symbols in normal running text, such as \scriptstyle\hat\alpha or \scriptstyle\hat\beta, is some sort of convention in math articles. I don't see any evidence of this. Am I missing something? Interested parties may consider discussing this at Talk:Simple linear regression#Scriptstyle. - dcljr (talk) 05:50, 1 January 2016 (UTC)

Scriptstyle should ordinarily only be used to generate subscripts, superscripts, and other small type face. It should generally not be used to overcome the shortcomings in how Wikipedia renders mathematics into PNG. It is semantically incorrect for this purpose, meaning that what may look good for users with certain defaults (e.g., rendering to PNG) will not look good for others (e.g., MathML and SVG). I have seen mobile browsers where scriptstyle renders as an indecipherable blur. So it generally must be avoided in part for reasons of WP:ACCESS for the vision impaired. Sławomir
Biały
11:42, 1 January 2016 (UTC)

Are algorithms "invented" or "discovered"?[edit]

Are mathematical algorithms "inventions" or are they "discoveries"? --82.132.234.81 (talk) 18:09, 7 January 2016 (UTC)

Depends on who you ask. Paul August 21:54, 7 January 2016 (UTC)

where to find info on "equation box"?[edit]

I'm looking for some info on this equation box (for instance, parameters, etc.):

 M = E - e \sin E

I have been perusing a lot of the WP:math type articles without much luck. All I know is that it exists, obviously. Tfr000 (talk) 16:57, 31 January 2016 (UTC)

Type "template:Equation box 1" in the search field. D.Lazard (talk) 18:54, 31 January 2016 (UTC)
Yup, that did it. Thanks! Tfr000 (talk) 19:00, 31 January 2016 (UTC)
Thank you both! I never would have thought to look under Template instead of Wikipedia. — Anita5192 (talk) 20:22, 31 January 2016 (UTC)
Opening a diff allows one to click on the template (in either diff window) as well, which takes one straight there without having to use the search widget. —Quondum 23:06, 31 January 2016 (UTC)