Template:Abs/doc: Difference between revisions

From Xenharmonic Wiki
Jump to navigation Jump to search
ArrowHead294 (talk | contribs)
mNo edit summary
ArrowHead294 (talk | contribs)
mNo edit summary
 
Line 7: Line 7:


; <code>{{{<nowiki />2}}}</code>
; <code>{{{<nowiki />2}}}</code>
: The scale factor, used to stretch or compress the absolute value bars.
: Pass in <code>big</code> to stretch the absolute value bars for fractions.


=== Usage ===
=== Usage ===
Line 16: Line 16:
| {{plaincode|<nowiki>{{abs|''x''}}</nowiki>}} || {{abs|''x''}}
| {{plaincode|<nowiki>{{abs|''x''}}</nowiki>}} || {{abs|''x''}}
|-
|-
| {{plaincode|<nowiki>{{abs|{{sfrac|''x''|''y''}}|1.8}}</nowiki>}} || {{abs|{{sfrac|''x''|''y''}}|1.8}}
| {{plaincode|<nowiki>{{abs|{{sfrac|''x''|''y''}}|big}}</nowiki>}} || {{abs|{{sfrac|''x''|''y''}}|big}}
|}
|}

Latest revision as of 13:29, 15 July 2025

English Wikipedia has an article on:

This template is designed to typeset the absolute value of a variable or expression. It is only necessary on fractions or when scaling is necessary; for individual variables (e.g. |x|) you can simply use {{!}}x{{!}} or {{pipe}}x{{pipe}}.

Parameters

{{{1}}}
The expression to be enclosed.
{{{2}}}
Pass in big to stretch the absolute value bars for fractions.

Usage

You type You get
{{abs|''x''}} |x|
{{abs|{{sfrac|''x''|''y''}}|big}} |x/y|