Template talk:Physics particle

{{WikiProject banner shell|

{{WikiProject Physics|importance=NA}}

}}

Forced bold?

I applaud the idea of having standardized templates for all subatomic particles, but it looks like the current version of {{tl|PhysicsParticle}} always displays the particle's symbol in a bold font, which is distracting in most contexts. In particular, since this template is used in {{tl|SubatomicParticle}}, we get particle names like {{SubatomicParticle|electron}} (electron) or {{SubatomicParticle|Photon}} (photon), which is rather uncommon in my experience. Perhaps the default should be non-bold, but with an optional parameter for requesting bold/italic symbols? Hqb (talk) 13:29, 20 March 2008 (UTC)

:Done. I originally made them bold because the page I based the first version off was using bold. These templates are there to facilitate making all physics pages have the same look and feel and the :Category:Nuclide templates aren't bold either, so neither should this one.

:There should be no need for make it available as an argument, as it is simpler to use single quotes like so: {{SubatomicParticle|electron}} -> {{SubatomicParticle|electron}} and {{SubatomicParticle|electron}} -> {{SubatomicParticle|electron}}.

:My TODO list includes rewriting the various :Category:Nuclide templates to use this template as well, making it possible to change the look and feel of everything in one place. That should save vandals a lot of work :)

:- SkyLined (talk) 20:02, 20 March 2008 (UTC)

::Great, thanks! Hqb (talk) 20:16, 20 March 2008 (UTC)

Photon symbol should be a gamma

The symbol generated for a photon by this template is |photon={{PhysicsParticle|γ}}

It looks like a "Y" instead of a gamma.

The gamma generated by the math template...\gamma would be much better.--Vectorboson (talk) 13:52, 14 May 2008 (UTC)

:In my setup, your two examples actually look identical (both use the Unicode "Greek small letter gamma" character of the default browser font). I assume you have your math preferences set to "Always render PNG", which forces Computer Modern (or whatever is configured to use). But that is not generally recommended, because it's quite a bit more resource-intensive (WP now has to generate and transfer an entire bitmap image instead of just a single character). It can also look really odd, when the symbols for other particles (electrons, protons, etc.) use the standard browser font. Maybe you could configure your browser to use another font, in which γ looks less like a "Y"? Hqb (talk) 14:19, 14 May 2008 (UTC)

Interesting. Browser-wise I run Safari and I tried changing my default encoding to Unicode (UTF=8) and that didn't help. I tried changing my Wiki-math-preferences away from the default that were set when I joined (tried "Recommended for modern browsers" and also "MathML if possible") but that didn't help either. Really though the issue isn't what I see on my browser, rather it should be what the average user sees on his browser...and the average user should see a gamma and not a Y.--Vectorboson (talk) 14:44, 14 May 2008 (UTC)

Don't know much about what I'm doing...but here is some additional info to help you analyze. When I view the html source of this page here is what I see...

for the one that shows up like a Y...

γ

and for the one that shows up like a gamma...

γ

You will have to view the source for this page to see the difference in html--Vectorboson (talk) 15:37, 14 May 2008 (UTC)

:Ooh, indeed. It's exactly the same character "γ" in both cases, but the latter one is inside a γ. The standard WP CSS definition for "texhtml" apparently reads,

::span.texhtml { font-family: serif; }

:which happened not to make any difference in my browser, but I can certainly see how it might do so for others. Still, I guess there's no guarantee that any particular choice of font will look optimal for everyone. How do text-mode ν vs. math-mode \nu for the neutrino look to you? Hqb (talk) 18:39, 14 May 2008 (UTC)

As you might expect, the text mode looks like a "v" while math mode looks like a nu. I agree that we can't guarantee what it will look like on someone's browser but there is a minor point that we should shove them out with the same html so they look the same. Now that I understand this is primarily a browser problem, I leave it to wiser heads as to whether it is worth a lot of trouble.--Vectorboson (talk) 18:59, 14 May 2008 (UTC)

:The font does suck, but that is not wikipedia's fault. I liked your suggestion and tried it out, only to find out it messed up the layout when the symbol had an overline (on Opera). I'm hoping to find a way to use <TABLE> to generate the sup/sub text, which might resolve this problem and allow us to use class="texhtml"     — SkyLined {{{#ifeq:talk|contribs

|contribs

|{{#if:contribs

|talkcontribs

|talk

}}}} 05:59, 15 May 2008 (UTC)

::I think the quality of the font does matter. The point of having a template is create a uniform look and feel for WP and for quality control purpose. To get a good font should not be a burden for the viewer. We should make sure we get the best possible results. The only way to do that is by using math mode. If you do it like this ν, it looks awfull. If you do it like this \nu, it still looks prety bad. Now, if you do it like that \nu\,, it looks much better. I have to say that I will probabily avoid using these templates until a better solution is implemented Dauto (talk) 21:15, 18 January 2009 (UTC)

:::Math mode is actual quite bad when used inline. Since it creates an image of the character instead of the character it will not be properly aligned with the baseline, nor will it in general be the proper font size. (TimothyRias (talk) 09:55, 19 January 2009 (UTC))

::::That may be true. But it still beats a nu that looks like a v any day of the week. (or a mu that looks like an u, or a gamma that looks like an y, or a tau that looks like a t, etc...) the font used right now is pretty awfull. The point of creating a template is to give WP a consistent look and feel and improve its quality. Right now all it's doing is make WP particle physics pages look consistently bad. Dauto (talk) 21:43, 19 January 2009 (UTC)

position lower indices

The template has a problem with the positioning of the lower indices. (On FF3 and IE7, at least) the position of the lower index varies greatly depending on the presence of an upper index. Compare

{{PhysicsParticle|A|BR=c|TR=d}} with {{PhysicsParticle|A|BR=c}}

The main issue is that the one with only a lower index positions the index way to low. The problem is caused by the {{T1|su}} template behaving funny when the parameter "p=" passed with an empty parameter. I have (partially) implemented a fix for this in the sandbox. This indeed fixes the problem:

{{PhysicsParticle/sandbox|A|BR=c|TR=d}} with {{PhysicsParticle/sandbox|A|BR=c}}

However it causes IE to render the following cases badly:

{{PhysicsParticle/sandbox|A|TR=d|BL=b|BR=c}} and {{PhysicsParticle/sandbox|A|TL=a|BL=b|BR=c}}

any ideas for a better fix?(TimothyRias (talk) 09:47, 8 January 2009 (UTC))

:OK, I have implemented a new fix by completely by passing the {{t1|su}} template. The implementation uses only css and works with IE7 and FF3. Can people with older browsers check if this implementation als works for them. (TimothyRias (talk) 11:18, 8 January 2009 (UTC))

I dunno what's going on, but you're messing every article with the template. I'm reverting to the stable version. Use a sandbox or something. Headbomb {ταλκκοντριβςWP Physics} 22:04, 19 January 2009 (UTC)

:No need to get rude. For your information this version has been in the sandbox for nearly two weeks now. It has worked perfectly with all browsers I have tested it with, which includes IE7, FF3 and Opera 9.xx . And since nobody has objected to the changes, the next logical step was to implement it in the actual template. So instead of, going jeez, "use a template or something" you might actual want to provide some useful feedback, like what was broken, in which browser and with which skin.

:Anyway, something needs to be done because the current version is broken, as it does not provide consitent postions of the lower indices. (TimothyRias (talk) 22:22, 19 January 2009 (UTC))

:: Sorry if it came across as rude, it wasn't in my mind.Headbomb {ταλκκοντριβςWP Physics} 08:24, 20 January 2009 (UTC)

::: Also the current sandbox version seems to display everything correctly, so I don't know why it came across all messed up. Was there any difference between the sandbox version and the one used in the template prior to my revert?Headbomb {ταλκκοντριβςWP Physics} 08:27, 20 January 2009 (UTC)

::There's a small problem with alignments. See {{PhysicsParticle/sandbox|Ω|TR=−|BR=bbb}} for example. The minus should be aligned on the left. Headbomb {ταλκκοντριβςWP Physics} 08:33, 20 January 2009 (UTC)

:::Fixed. That incidently was the only difference between the sandbox version and my last edit to the template yesterday. I noticed the alignment problem when viewing the {{t1|SubatomicParticle/list}}. After that fix all elements on that list showed up fine for me (on FF3). (except for any issue with sub/superscripts starting with ∗ that also plagues the current template.) What was showing messed up for you yesterday and in what way and with which browser? Also did you try purging the relevant page? (TimothyRias (talk) 09:03, 20 January 2009 (UTC))

::::Yes I tried purging and it with every browser (FF2/3, IE7). As for how messed up it was, well the various subscript were all over the page. Something like {{SubatomicParticle|Triple charmed Omega++}} would've displayed like (without the dash box around it)

++

Ω

ccc

:::: Anyway, the current version seems to be working fine now, whatever the problem was back then.Headbomb {ταλκκοντριβςWP Physics} 10:06, 20 January 2009 (UTC)

::::: OK, so how do you feel about implementing the current sandbox version. If it breaks stuff again we can then revert and copy the offending instanced to the testcases page to figure out what is going wrong. Since I gather that the testcases page is showing the sandbox version fine for you, I don't really understand what could have caused the mess up. (I expect that the new implementation might break in older browsers with poor standards compliance, but since the problem also occured for you with FF3 and IE7, I'm at a loss.) (TimothyRias (talk) 10:38, 20 January 2009 (UTC))

:::::: Sure, let's try it again.Headbomb {ταλκκοντριβςWP Physics} 10:39, 20 January 2009 (UTC)

:::::::Take 2 commenced. :) So far so good. {{t1|SubatomicParticle/list}} is fine on IE7 and FF3 on my system (win XP). (TimothyRias (talk) 11:29, 20 January 2009 (UTC))

Everything looks fine to me. Guess we'll never know what produced the garbled mess I saw.Headbomb {ταλκκοντριβςWP Physics} 12:14, 20 January 2009 (UTC)

Awfull font

The font currently used by this template isn't very good in my opinion. Its gamma looks like an y, the nu looks like a v, the mu looks like an u and the tau looks like a t. I find it hard to believe we can't do better than that. Dauto (talk) 00:09, 21 January 2009 (UTC)

:Small note: Although I agree with you mostly. This isn't actually the template that controls the characters used for particles. I'm currently advocating a serif font for (at least) all lower case greek symbols at Template_talk:SubatomicParticle/Symbol. Please join me there. (TimothyRias (talk) 06:35, 21 January 2009 (UTC))

Slow

There's currently a discussion at VP regarding the redesign of {{tl|subatomic particle}}. The suggestion there was to replace the twelve hundred or so subtemplates with #switches. Of course, the question of effeciency came up (since large #switches are pretty bad in that respect). Various different ideas were proposed. One approach that really seemed to speed {{tlf|subatomic particle}} up was its getting rid of {{tlf|physics particle}}. The down-side is that editors might want to subst {{tlf|subatomic particle}} to get {{tlf|physics particle}} and that wouldn't be possible if we just get rid of it. So if {{tlf|physics particle}} is slowing {{tlf|subatomic particle}} down, couldn't we speed {{tlf|physics particle}} up? This is where the discussion is at now.

What's slowing the template down? This template relies on four other templates to function.

  • Two subtemplates are used to put symbols together.
  • If an overline (for antiparticles) is needed, {{tlf|physics particle}} calls {{tl|overline}}.
  • If superscripts or subscripts are needed, it calls {{tl|su}} (twice if needed on both sides).
  • Two subtemplates are used for linking.
  • {{tlf|Physics particle}} sends the symbol and link (if given) to {{tl|OptionalLink}}.
  • {{tl|OptionalLink}} checks whether a link is needed and if so, calls {{tl|InternalLink}}.

What if we were to put all of this on one page? Such a code can be found in the sandbox. This code has been tested against the current code using approximately twelve hundred calls in terms of template limits with the following results.

;NewPP limit report for {{tl|physics particle/testcases/current}}

:Preprocessor node count: 67398/1000000

:Post-expand include size: 1046048/2048000 bytes

:Template argument size: 303838/2048000 bytes

:Highest expansion depth: 11/40

:Expensive parser function count: 0/500

;NewPP limit report for {{tl|physics particle/testcases/sandbox}}

:Preprocessor node count: 38666/1000000

:Post-expand include size: 716846/2048000 bytes

:Template argument size: 35310/2048000 bytes

:Highest expansion depth: 5/40

:Expensive parser function count: 0/500

The sandbox version has

  • almost halved the preprocessor node count,
  • taken about 30% off the post-expand include size,
  • reduced the template argument size to about a nineth and
  • more than halved the highest expansion depth.

I propose that we replace the current code with this new version. JIMp talk·cont 06:56, 13 June 2012 (UTC)

Non-screenreader friendly

Currently the template uses <br>'s to typeset corners, but this is extremely non-text browser or screenreader-friendly. Here's the output of:

This is a weird particle {{Physics particle|A|TL=a|TR=d|BL=b|BR=cc}} from Timothy.

in w3m:

This is a weird particle a

bAd

cc from Timothy.

Same goes with Lynx.

In your browser:

This is a weird particle {{Physics particle|A|TL=a|TR=d|BL=b|BR=cc}} from Timothy.

Is there a way to improve this?

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