Template talk:Frac
From Wikipedia, the free encyclopedia
Experimental template!
Intended to be used with subst: only.
| Markup | Result |
|---|---|
| {{subst:frac|2|3|4}} | 23⁄4 |
| {{frac|2|3|4}} | 23⁄4 |
| 2 3/4 | 2 3/4 |
| 2<sup><small>3</small></sup>/<sub><small>4</small></sub> | 23/4 |
| 2<small><sup>3</sup><big>/</big><sub>4</sub></small> | 23/4 |
| 2<small><sup>3</sup>/<sub>4</sub></small> | 23/4 |
| 2 3⁄4 | 2 3⁄4 |
| 2 3⁄4 | 2 3⁄4 |
| 2<sup><small>3</small></sup>⁄<sub><small>4</small></sub> | 23⁄4 |
| 2<small><sup>3</sup><big>⁄</big><sub>4</sub></small> | 23⁄4 |
| 2<small><sup>3</sup>⁄<sub>4</sub></small> | 23⁄4 |
| 2¾ | 2¾ |
| 2¾ | 2¾ |
Contents |
[edit] frac problems
Frac wraps its numerator and denominator in <small>. As subscripts and superscripts, they are already in a smaller font; the result of two smalls is nearly unreadable for me. So I prefer
- 23/4
to
- 23/4
But wikipedia is for the consumer; some readers may want to see
or even the special case- 2¾
So I think that (1) frac should be customizable, and so (2) using it with subst: defeats the purpose.
I don't know a technical answer to the problem. –Dan Hoey 13:14, 17 April 2007 (UTC)
- The first two look exactly the same to me, but I do have a user stylesheet to make that happen. I did not find such CSS rules, that would lower the fontsize for
subandsup, on a quick search through Wikipedia’s standard stylesheets. Are you sure that subscripts and superscripts are already in a smaller fontsize? - I think I could incorporate another parameter to allow the selection to generate
mathmarkup, but I think images (or tables) look terrible in running text. While precomposed vulgar fractions probably look better than those generated by this template, there are only three (¼, ½, ¾) available for certain on virtually all major platforms (save some installations of Mac OS 9). The template could be updated to automatically generate at least ⅓, ⅔, ⅛, ⅜, ⅝ and ⅞, though, but it does not look that good if generated and precomposed fractions appear near each other, say in a table. Christoph Päper 16:46, 18 April 2007 (UTC)
-
- I don't know where it comes from, perhaps the default, but 22222 has decreasing font sizes in the superscripts and subscripts wherever I've seen them (mostly on mozilla-based browsers on Mac OSX and PC). I also find
mathcode, ugly in rimmomg text, especially with the vertical layout (and I don't know how to get a diagonal layout). But the point is that platforms and users differ, and this would (in an ideal world) be the decision of the user. If a user customization option were available to and used by Template:frac, that would be the way to go, but that is not possible ifsubst:is used. –Dan Hoey 12:27, 19 April 2007 (UTC)
- I don't know where it comes from, perhaps the default, but 22222 has decreasing font sizes in the superscripts and subscripts wherever I've seen them (mostly on mozilla-based browsers on Mac OSX and PC). I also find
-
- The unicode fraction characters are likely to present accessibility problems for those with screen-reader software unless it is very up-to-date, and even general usability problems for people with older computers (much of the world). These limited number of fraction characters were not intended for general prose use, but as mathematical tokens (symbols) for limited tablular data use. — SMcCandlish [talk] [cont] ‹(-¿-)› 21:12, 9 May 2007 (UTC)
- I can grant no credence whatsoever to such complaints, as long as Wikipedia uses a zillion and a half other Unicode characters which don't work right for everybody. And these numbers are commonly used in English; the rest are for the most part not used in English. Gene Nygaard (talk) 23:10, 13 January 2008 (UTC)
- The unicode fraction characters are likely to present accessibility problems for those with screen-reader software unless it is very up-to-date, and even general usability problems for people with older computers (much of the world). These limited number of fraction characters were not intended for general prose use, but as mathematical tokens (symbols) for limited tablular data use. — SMcCandlish [talk] [cont] ‹(-¿-)› 21:12, 9 May 2007 (UTC)
[edit] Major accessibility issue
Screen reader software for the visually impaired is not going to handle this properly. The template and its documentation need to updated, to consistently say to use it like "4-{{frac|3/4}}", not ""4{{frac|3/4}}", and to generate a hyphen automatically when the third parameter is used. The weird <s style="display:none">+</s> code in there can simply be removed, as it is unlikely to have any effect on anything at all due to the display:none (which basically makes it dead code); and it is an abuse of the strikethrough element anyway; use span if you want to apply a style to something. Display:none is useful for things like showing and hiding tables of contents and stuff, but as a fixed parameter in a template it's just "noise", unless I'm missing something and there's a new text-to-speech browser that parses for such a string, or whatever. — SMcCandlish [talk] [cont] ‹(-¿-)› 21:12, 9 May 2007 (UTC)
- The template should be used like this:
{{frac|2|3|4}}, although it works also almost the same with this :2 {{frac|3|4}}. - Unlike the minus sign you propose the usually invisible plus sign is not mathematically incorrect, an underscore would have have been acceptable, too. It was in fact intended for accessibility and may therefore be removed safely if it indeed poses problems in that very area. Note that CSS is not always available.
- There are so many uncommon characters in use on WP, the fraction slash should be one of the better supported. Nevertheless, I don’t feel strongly about ‘⁄’ vs. plain old ‘/’. Christoph Päper 20:44, 13 May 2007 (UTC)
- In principle at least, speech browsers should ignore "
display:none". There's a separate declaration, "speak:none" for those [1]. I've no idea how this works in practice, though, having never used one. —Ilmari Karonen (talk) 22:44, 13 May 2007 (UTC)- At least in the UK, "4 1/2" is standard, and the hyphenated form, "4-1/2" looks extremely confusing. To the unfamiliar eye, that looks like it should be a mathematical equation giving a value of 3.5 Please bear in mind WP has an international audience. Rhialto 20:17, 5 July 2007 (UTC)
- Note that, according to the CSS working group,
display:none;does affect non-visual display. —Ms2ger (talk) 19:39, 2 February 2008 (UTC)
- Note that, according to the CSS working group,
- At least in the UK, "4 1/2" is standard, and the hyphenated form, "4-1/2" looks extremely confusing. To the unfamiliar eye, that looks like it should be a mathematical equation giving a value of 3.5 Please bear in mind WP has an international audience. Rhialto 20:17, 5 July 2007 (UTC)
[edit] Changes
I set it not to use small (since the sup/sub are already small) and added a class for user style sheets to be able to use. --Random832 07:50, 23 June 2007 (UTC)
[edit] Math
{{#if:{{{3|}}}|{{#tag:math|{{{1}}}\tfrac{ {{{2}}} }{ {{{3}}} } }}|{{#tag:math| \tfrac{ {{{1}}} }{ {{{2}}} } }} }}
gives
or
. —Random832 07:10, 27 January 2008 (UTC)
- Perhaps that would be better. I'm not happy with the typesetting of fractions produced by the current template. They look fine in isolation, but are really ugly when used inline in a paragraph of text.--Srleffler (talk) 03:48, 31 March 2008 (UTC)
- I'm not too happy with how they are currently displayed either, but don't you think the math-formatted output is a tad too big for inline use?—Ëzhiki (Igels Hérissonovich Ïzhakoff-Amursky) • (yo?); 14:44, 31 March 2008 (UTC)
[edit] Do you need <BIG> ?
Not using <BIG> gives a better look for me:
31⁄2 31⁄2 31⁄2 3 1⁄2 3 1⁄2 3 1⁄2
The latter three don't use <BIG>. What do you think? And how about using a small space instead of the hidden "+" ? - TAKASUGI Shinji (talk) 13:34, 6 March 2008 (UTC)
[edit] {{frac2}}
Just created this, thought it might make things more readable in some cases.
- What's with the rows of the nbsps, though? :)—Ëzhiki (Igels Hérissonovich Ïzhakoff-Amursky) • (yo?); 16:25, 15 April 2008 (UTC)
That has been addressed, &nbsp; no longer required-- SkyLined (talk) 22:44, 22 April 2008 (UTC)
[edit] +pl:Szablon:U
{{editprotected}} Please add pl interwiki: pl:Szablon:U. 83.29.153.144 (talk) 12:27, 27 April 2008 (UTC)

