Jump to content

Template:Sfrac/doc: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
"common or mixed fractions"
 
(26 intermediate revisions by 16 users not shown)
Line 1: Line 1:
{{Documentation subpage}}
{{Documentation subpage}}
{{High-use}}
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE -->
{{Uses TemplateStyles|Template:Sfrac/styles.css}}
This template builds an alternative form of [[common fraction]]s, using a [[Vinculum (symbol)|vinculum]] (horizontal line), for [[Wikipedia:Manual of Style (mathematics)|scientific and mathematical text]]. It takes one, two or three parameters: the optional integer (may be signed), the optional numerator and the required denominator; in this order. Please '''do not''' substitute it.
This template builds an alternative form of common or mixed [[fraction]]s, using a [[Vinculum (symbol)|vinculum]] (horizontal line), for [[Wikipedia:Manual of Style (mathematics)|scientific and mathematical text]]. It takes one, two or three parameters: the optional integer (may be signed), the optional numerator and the required denominator; in this order. Please '''do not''' substitute it.


; <code><nowiki>{{sfrac|A|B|C}}</nowiki></code>
; <code><nowiki>{{sfrac|A|B|C}}</nowiki></code> : {{sfrac|A|B|C}} (integer, numerator and denominator)
: {{sfrac|A|B|C}} (integer, numerator and denominator)
; <code><nowiki>{{sfrac|B|C}}</nowiki></code> : {{sfrac|B|C}} (numerator and denominator)
; <code><nowiki>{{sfrac|A|B}}</nowiki></code>
; <code><nowiki>{{sfrac|C}}</nowiki></code> : {{sfrac|C}} (denominator only)
: {{sfrac|A|B}} (numerator and denominator)
; <code><nowiki>{{sfrac|A}}</nowiki></code>
: {{sfrac|A}} (denominator only)


== Examples ==
== Examples ==
{{sfrac|2}} {{sfrac|3}} {{sfrac|2|3}} {{sfrac|4}} {{sfrac|3|4}} {{sfrac|5}} {{sfrac|2|5}} {{sfrac|3|5}} {{sfrac|4|5}} {{sfrac|6}} {{sfrac|5|6}} {{sfrac|7}} {{sfrac|2|7}} {{sfrac|3|7}} {{sfrac|4|7}} {{sfrac|5|7}} {{sfrac|6|7}} {{sfrac|8}} {{sfrac|3|8}} {{sfrac|5|8}} {{sfrac|7|8}} {{sfrac|16}} {{sfrac|3|16}} {{sfrac|5|16}} {{sfrac|7|16}} {{sfrac|9|16}} {{sfrac|11|16}} {{sfrac|13|16}} {{sfrac|15|16}} {{sfrac|22|7}} {{sfrac|1|1|16}} {{sfrac|16|2|3}}


<!--the fractions are separated by commas that are only visible to screen readers because they do not read out the space separators here-->
==See also==

{{sfrac|2}}{{sronly|,}} {{sfrac|3}}{{sronly|,}} {{sfrac|2|3}}{{sronly|,}} {{sfrac|4}}{{sronly|,}} {{sfrac|3|4}}{{sronly|,}} {{sfrac|5}}{{sronly|,}} {{sfrac|2|5}}{{sronly|,}} {{sfrac|3|5}}{{sronly|,}} {{sfrac|4|5}}{{sronly|,}} {{sfrac|6}}{{sronly|,}} {{sfrac|5|6}}{{sronly|,}} {{sfrac|7}}{{sronly|,}} {{sfrac|2|7}}{{sronly|,}} {{sfrac|3|7}}{{sronly|,}} {{sfrac|4|7}}{{sronly|,}} {{sfrac|5|7}}{{sronly|,}} {{sfrac|6|7}}{{sronly|,}} {{sfrac|8}}{{sronly|,}} {{sfrac|3|8}}{{sronly|,}} {{sfrac|5|8}}{{sronly|,}} {{sfrac|7|8}}{{sronly|,}} {{sfrac|16}}{{sronly|,}} {{sfrac|3|16}}{{sronly|,}} {{sfrac|5|16}}{{sronly|,}} {{sfrac|7|16}}{{sronly|,}} {{sfrac|9|16}}{{sronly|,}} {{sfrac|11|16}}{{sronly|,}} {{sfrac|13|16}}{{sronly|,}} {{sfrac|15|16}}{{sronly|,}} {{sfrac|22|7}}{{sronly|,}} {{sfrac|1|1|16}}{{sronly|,}} {{sfrac|16|2|3}}{{sronly|,}}{{sfrac|2{{pi}}|''a''<sup>2</sup>''b''}}

'''Inside the {{tl|math|...}} template (for inline math):'''

{{math|
{{sfrac|2}}{{sronly|,}} {{sfrac|3}}{{sronly|,}} {{sfrac|2|3}}{{sronly|,}} {{sfrac|4}}{{sronly|,}} {{sfrac|3|4}}{{sronly|,}} {{sfrac|5}}{{sronly|,}} {{sfrac|2|5}}{{sronly|,}} {{sfrac|3|5}}{{sronly|,}} {{sfrac|4|5}}{{sronly|,}} {{sfrac|6}}{{sronly|,}} {{sfrac|5|6}}{{sronly|,}} {{sfrac|7}}{{sronly|,}} {{sfrac|2|7}}{{sronly|,}} {{sfrac|3|7}}{{sronly|,}} {{sfrac|4|7}}{{sronly|,}} {{sfrac|5|7}}{{sronly|,}} {{sfrac|6|7}}{{sronly|,}} {{sfrac|8}}{{sronly|,}} {{sfrac|3|8}}{{sronly|,}} {{sfrac|5|8}}{{sronly|,}} {{sfrac|7|8}}{{sronly|,}} {{sfrac|16}}{{sronly|,}} {{sfrac|3|16}}{{sronly|,}} {{sfrac|5|16}}{{sronly|,}} {{sfrac|7|16}}{{sronly|,}} {{sfrac|9|16}}{{sronly|,}} {{sfrac|11|16}}{{sronly|,}} {{sfrac|13|16}}{{sronly|,}} {{sfrac|15|16}}{{sronly|,}} {{sfrac|22|7}}{{sronly|,}} {{sfrac|1|1|16}}{{sronly|,}} {{sfrac|16|2|3}}{{sronly|,}} {{sfrac|2{{pi}}{{sronly|,}}|''a''<sup>2</sup>''b''}}
}}

'''Inside the {{tl|bigmath|...}} template (for standalone math):'''

{{bigmath|
{{sfrac|2}}{{sronly|,}} {{sfrac|3}}{{sronly|,}} {{sfrac|2|3}}{{sronly|,}} {{sfrac|4}}{{sronly|,}} {{sfrac|3|4}}{{sronly|,}} {{sfrac|5}}{{sronly|,}} {{sfrac|2|5}}{{sronly|,}} {{sfrac|3|5}}{{sronly|,}} {{sfrac|4|5}}{{sronly|,}} {{sfrac|6}}{{sronly|,}} {{sfrac|5|6}}{{sronly|,}} {{sfrac|7}}{{sronly|,}} {{sfrac|2|7}}{{sronly|,}} {{sfrac|3|7}}{{sronly|,}} {{sfrac|4|7}}{{sronly|,}} {{sfrac|5|7}}{{sronly|,}} {{sfrac|6|7}}{{sronly|,}} {{sfrac|8}}{{sronly|,}} {{sfrac|3|8}}{{sronly|,}} {{sfrac|5|8}}{{sronly|,}} {{sfrac|7|8}}{{sronly|,}} {{sfrac|16}}{{sronly|,}} {{sfrac|3|16}}{{sronly|,}} {{sfrac|5|16}}{{sronly|,}} {{sfrac|7|16}}{{sronly|,}} {{sfrac|9|16}}{{sronly|,}} {{sfrac|11|16}}{{sronly|,}} {{sfrac|13|16}}{{sronly|,}} {{sfrac|15|16}}{{sronly|,}} {{sfrac|22|7}}{{sronly|,}} {{sfrac|1|1|16}}{{sronly|,}} {{sfrac|16|2|3}}{{sronly|,}} {{sfrac|2{{pi}}{{sronly|,}}|''a''<sup>2</sup>''b''}}
}}

== See also ==
* [[Wikipedia:Rendering math]]
* [[Wikipedia:Rendering math]]
* {{tl|frac}}, displays common fractions using a [[fraction slash]]
* {{tl|frac}}, displays common fractions using a [[fraction slash]]
* {{tl|BSsplit}}, for two lines of text, with formatting options
* {{tl|BScvt}}, for two distances
* {{tl|su}} ({{su|p=superscript|b=subscript}} text) – to align both b=subscript & p=[[superscript]]
* {{tl|su}} ({{su|p=superscript|b=subscript}} text) – to align both b=subscript & p=[[superscript]]
* {{tl|sub}} ({{sub|subscript}} text) – to show a [[subscript]]
* {{tl|sub}} ({{sub|subscript}} text) – to show a [[subscript]]
* {{tl|sup}} ({{sup|subscript}} text) – to show a [[superscript]]
* {{tl|sup}} ({{sup|superscript}} text) – to show a [[superscript]]
* {{tl|sup sub}} (text{{sup sub|sup|sub}}) – for both 1=superscript & 2=subscript
* {{tl|sup sub}} (text{{sup sub|sup|sub}}) – for both 1=superscript & 2=subscript
* [[Help:Displaying a formula#Fractions, matrices, multilines]]
* [[Help:Displaying a formula#Fractions, matrices, multilines]]
* [[Help:Convert#Fractions]]
* [[Help:Convert#Fractions]]
* [[Number Forms]], a Unicode block consisting primarily of vulgar fractions
* [[OpenType]] fonts feature ''afrc'', [[CSS]] {{code|font-variant-numeric:stacked-fractions|css}} with little support as of 2020


{{Math templates|notation}}
{{Math templates|notation}}


<includeonly>
<includeonly>{{Sandbox other||
<!-- CATEGORIES AND INTERWIKIS HERE, THANKS -->
<!-- Categories and interwikis go here -->
[[Category:Wikipedia formatting and function templates]]
[[Category:Fraction templates]]
}}</includeonly>
[[Category:Mathematical formatting templates]]

[[fa:الگو:Sfrac]]
[[mk:Шаблон:Sfrac]]
[[sl:Predloga:Sfrac]]
</includeonly>

Latest revision as of 12:06, 10 April 2024

This template builds an alternative form of common or mixed fractions, using a vinculum (horizontal line), for scientific and mathematical text. It takes one, two or three parameters: the optional integer (may be signed), the optional numerator and the required denominator; in this order. Please do not substitute it.

{{sfrac|A|B|C}}
⁠A+B/C (integer, numerator and denominator)
{{sfrac|B|C}}
B/C (numerator and denominator)
{{sfrac|C}}
1/C (denominator only)

Examples

[edit]

1/2, 1/3, 2/3, 1/4, 3/4, 1/5, 2/5, 3/5, 4/5, 1/6, 5/6, 1/7, 2/7, 3/7, 4/7, 5/7, 6/7, 1/8, 3/8, 5/8, 7/8, 1/16, 3/16, 5/16, 7/16, 9/16, 11/16, 13/16, 15/16, 22/7, ⁠1+1/16, ⁠16+2/3,2π/a2b

Inside the {{math}} template (for inline math):

1/2, 1/3, 2/3, 1/4, 3/4, 1/5, 2/5, 3/5, 4/5, 1/6, 5/6, 1/7, 2/7, 3/7, 4/7, 5/7, 6/7, 1/8, 3/8, 5/8, 7/8, 1/16, 3/16, 5/16, 7/16, 9/16, 11/16, 13/16, 15/16, 22/7, ⁠1+1/16, ⁠16+2/3, 2π,/a2b

Inside the {{bigmath}} template (for standalone math):

1/2, 1/3, 2/3, 1/4, 3/4, 1/5, 2/5, 3/5, 4/5, 1/6, 5/6, 1/7, 2/7, 3/7, 4/7, 5/7, 6/7, 1/8, 3/8, 5/8, 7/8, 1/16, 3/16, 5/16, 7/16, 9/16, 11/16, 13/16, 15/16, 22/7, ⁠1+1/16, ⁠16+2/3, 2π,/a2b

See also

[edit]