Template talk:Pi

Shouldn't pi, as a mathematical symbol, be italicized?
Mathematical variables are generally itaicized, and people are more used to seeing &pi; than &pi; (or $&pi;$ rather than $&pi;$. If this macro is supposed to be the mathematical variable, shouldn't it be in italics?  That matches


 * $$\pi$$

In a template like this, I'd be inclined to use, so that it's italic even in the middle of italics, while using   would toggle. E.g. The area of a circle is &pi;r2. 71.41.210.146 (talk) 04:04, 29 December 2016 (UTC)

Template-protected edit request on 3 March 2018
Change all code from current to this does 2 things. Makes sure that any potential future changes to math typesetting are automatically included and makes it very clear what this template actually does. BFG (talk) 17:49, 3 March 2018 (UTC)
 * Pictogram voting question.svg Question: is the  not required? &mdash; Martin (MSGJ · talk) 12:12, 5 March 2018 (UTC)
 * What I assume he wants to insert is $&pi;$ which outputs the same  currently; math doesn't get edited so I don't see much point there but there's not much harm I guess. could do $&pi;$ for a feature more which may be useful then. Galobtter (pingó mió) 12:55, 5 March 2018 (UTC)
 * I've been working a bit on math in Norwegian Wikipedia lately, and I copied this code from English Wikipedia, when I realized it would be simpler to do $&pi;$ . As you say, there's strictly no need to do this if math never changes. It's simply a question of a cleaner approach IMHO. BFG (talk) 13:06, 5 March 2018 (UTC)
 * When I studied the source of the request and saw the it made a lot more sense. I have made this change, and is there is any need/desire for the extra features mentioned by Galobtter then just let me know &mdash; Martin (MSGJ · talk) 16:05, 5 March 2018 (UTC)

Template-protected edit request on 14 April 2018
Change to.

This will still preserve the mathematical appearance of 𝜋 in articles, but it will also allow copy and paste of the mathematical symbol from the article to elsewhere to maintain the mathematical appearance. As it is, copy and pasting the mathematical looking 𝜋 from the first sentence in the Pi article instead produces π, which is suboptimal:


 * it's not the mathematical version of 𝜋 that can be seen in any math textbook
 * with fonts that have the top line contained within the boundaries of the vertical lines (as with Reddit's font), the character is confusable with lowercase n and doesn't really look anything like a mathematical 𝜋
 * with fonts that have the top line extending beyond the boundaries of the vertical lines (as with the font here), πr² can look like the π and r are one letter, so it's confusable with m²

𝜋 looks like it should, and 𝜋r² is much more readable. Chai T. Rex (talk) 18:19, 14 April 2018 (UTC)
 * To me, the version you have looks different from the previous version - somewhat italicized? Since the visual appearance is changed - on atleast some fonts - you'd  need some discussion and consensus for the change Galobtter (pingó mió) 18:28, 14 April 2018 (UTC)


 * Do I just create a new section on this page for the discussion? Chai T. Rex (talk) 18:44, 14 April 2018 (UTC)
 * If you want to; yeah that's all; if no one responds here you can also post on WT:MATH Galobtter (pingó mió) 19:00, 14 April 2018 (UTC)
 * I can't see the proposed new character on my phone, while the original shows up perfectly well. Double sharp (talk) 07:14, 16 April 2018 (UTC)
 * This is a good idea, but not easy to do in practice. The entity change is from 'GREEK SMALL LETTER PI' (U+03C0) to 'MATHEMATICAL ITALIC SMALL PI' (U+1D70B). The latter is usually available only on browsers which supports mathml. There is a setting Help:Preferences which might be accessed. If this setting is mathml use 'MATHEMATICAL ITALIC SMALL PI'. But this is probably not enough. I'd recommend holding off on this change until the impact is assessed. BFG (talk) 19:55, 16 April 2018 (UTC)
 * @Galobtter is there a discussion on this somewhere? - As I said before its a good idea, just not trivial. BFG (talk) 10:38, 3 June 2018 (UTC)
 * Not that I know of; WT:MATH could be a good place to start one. Galobtter (pingó mió) 10:47, 3 June 2018 (UTC)

Template-protected edit request on 9 December 2019
Please change to.

Greek variable names should be italicized, including pi. For example, one writes $&pi;r^{2}$, not $&pi;r^{2}$. Since this is already inside, the intent is that this should be used in a mathematical context, not as an ordinary Greek letter.

There are some other similar templates with inconsistent usage; I'm planning on going through and cleaning this all up, and hopefully eventually deprecating this and similar templates, but it will be a long process, and in the mean time, this will be an improvement. –Deacon Vorbis (carbon &bull; videos) 15:39, 9 December 2019 (UTC)
 * I am confused. Is pi a variable? In my math and engineering education and work, it is a symbol that represents a number. Can you link to clear guidance (in MOS or elsewhere)? I see this MOS page, which is silent on pi, and MOS:MATH, which says Italicize lower-case Greek letters when they are variables but then shows pi italicized, which confuses me. Am I misunderstanding the meaning of the word "variable" here? Is the pi symbol sometimes used to represent an unknown quantity?


 * Also, why not ? – Jonesey95 (talk) 17:17, 9 December 2019 (UTC)
 * FWIW, I posted at WT:MATH asking for guidance, and I also found this November 2016 discussion, this July 2018 discussion, and this October 2017 discussion. I remain confused by the word "variable". – Jonesey95 (talk) 17:29, 9 December 2019 (UTC)
 * Here, "variable" is almost more typographical than anything; it essentially just means a letter used in a mathematical formula, whether that's the $&pi;$ that's the constant ratio of a circle's circumference to its diameter, the $&pi;$ that's the often used to represent the projection function, the $r$ for a circle's radius, etc. As far as whether to use  or, it doesn't make much difference.  The two seem to use different styles, but as far as I know, they're functionally equivalent.  I'm just in the habit of using  whenever it's just a single, standalone variable.
 * When inside a  block, we get: $$\pi,$$ which is italic. In fact, without some extra package, vanilla LaTeX won't even permit upright lower-case Greek letters in math mode (see this SE post for some extra detail).  Thanks for taking a look at this. –Deacon Vorbis (carbon &bull; videos) 18:20, 9 December 2019 (UTC)


 * In case the participants in this discussion haven't seen it, there is highly relevant policy at Manual_of_Style/Mathematics. By my reading, it says: italicize. Mgnbar (talk) 19:26, 9 December 2019 (UTC)
 * Oh, it is linked above. I should read more carefully. Anyway, the case for &pi; is the same as the case for e. Arguably it doesn't make sense, but it's the convention. Mgnbar (talk) 19:28, 9 December 2019 (UTC)

Thanks for helping me understand, everyone. I was confused by the apparently conflicting guidance at MOS:MATH, so I made it more consistent. I have little doubt that my change will be reverted for reasons that I do not understand, because that is how MOS usually goes.

I have made the change to "mvar" requested above. Putting the italics in the span tag looked more elegant to me, and less prone to strange formatting conflicts. Here is a comparison of the rendered HTML of the two options: $π$ : π $π$    : π I will keep this page on my watchlist for a while in case there are any questions or objections. – Jonesey95 (talk) 20:26, 9 December 2019 (UTC)


 * Shouldn't we follow the rendering? $$\pi$$ produced by $$\pi$$ looks not italicized. I also wonder if pi is ever used as a variable. Can be, sure. But do people do that? (although pi may be used as a letter for a function like a projection). -- Taku (talk) 01:16, 10 December 2019 (UTC)
 * The basic behavior for LaTeX (as well as our approximation of it) is that lower case Greek letters in math mode get italicized.  Take a look at the SE link I posted above for some examples; I just found this one also that has some more.  You can especially verify it's italic because the legs meet the horizontal bar at an angle, rather than perpendicularly.  As far as its use as a variable, part of what I was saying above is that that's sort of a meaningless distinction, and it doesn't matter for rendering purposes anyway. But in either case, it surely does; see Faà di Bruno's formula for just one example. –Deacon Vorbis (carbon &bull; videos) 02:44, 10 December 2019 (UTC)

The letter $\pi$ is sometimes used as a variable, in the mathematical rather than typographical sense of the word. In some statistics books you may see the proportion of a population that belongs to a specified subset called π. At any rate, TeX and LaTeX italicize lower-case Greek letters in mathematical notation, but not capital Greek latters. Thus:
 * $$ \Pr(\Lambda < a) = \int_0^a f(\lambda) \, d\lambda. $$

Michael Hardy (talk) 00:16, 13 December 2019 (UTC)

Substing all uses
In preparation for either getting rid of this outright, or at least having AnomieBOT auto-subst this, I plan on doing an AWB run on all current transclusions for substitution. These should be fairly straightforward, but it will also give me the chance to see if anything is using it incorrectly (like inside of italics, for example). There are currently a bit under 1,000 transclusions (all namespaces).

Before starting, I wanted to see if there were any objections though. I'll post a notice at WT:WPM, and if anyone wants to post elsewhere, please feel free. –Deacon Vorbis (carbon &bull; videos) 15:51, 19 December 2019 (UTC)


 * It is not a good idea of substituting this template. Two reasons: 1/ this makes the source harder to read by adding four distracting letters for each occurence of pi. 2/ this would prevent many new editors to learn the existence of the template, because, usually, they learn this existence by encountering the template in the pages they edit. D.Lazard (talk) 16:27, 19 December 2019 (UTC)
 * . Re #1, adding a couple characters to the source doesn't make it any harder to read, especially for infrequent uses.  By that reasoning, we should have templates for every Greek letter, both upper and lower case, but this would surely be a much messier situation.  And as far as #2, we don't want new editors using this; we want them using /, which they will still learn about by examining page code.  If new users see this being used, they're much more likely to blindly place it inside  or italics incorrectly. –Deacon Vorbis (carbon &bull; videos) 16:51, 19 December 2019 (UTC)
 * See the section immediately above, where a formatting change was implemented. If the template had already been substed, it would have been impossible to change the formatting of all (former) transclusions with a single edit. The way we decide to "get rid of" templates is a formal process described at Templates for discussion. – Jonesey95 (talk) 17:56, 19 December 2019 (UTC)
 * I agree with Jonesey. The very recent formatting changes for this template make it obvious why substing is a bad idea; it would have been much more difficult and annoying to watchlist-viewers to make the same formatting change to a substed version of this template. Another reason is that we should be aiming for semantic markup in our math templates and this is a step backwards in that respect. —David Eppstein (talk) 18:34, 19 December 2019 (UTC)