Template:Mapping

From Xenharmonic Wiki
Revision as of 11:03, 25 May 2023 by FloraC (talk | contribs) (Created page with "<includeonly>{{#if: {{{legend|}}} | Mapping: }}<span class="left-delim">[</span>{{bra| {{{1|0}}} }}{{#if: {{{2|}}}|, {{bra| {{{2|}}} }} }}{{#if: {{{3|}}}|, {{bra|...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This mapping template eases typing mappings: it puts bra notation ( and ]) around each of its arguments and left and right brackets outside (it also removes surrounding spaces). You may optionally include a legend. Mappings are supported up to rank-4.

Usage

You type
{{mapping| 31 49 72 87 }}
{{mapping| 1 0 -4 | 0 1 4 }}
{{mapping|legend=1| 1 0 0 0 | 0 1 1 2 | 0 0 2 -1 }}
Tip: adding spaces improves readability of the wiki markup.
You get (rendered)
[31 49 72 87]]
[1 0 -4 -13], 0 1 4 10]]
Mapping[1 0 0 0], 0 1 1 2], 0 0 2 -1]]

Technical note

This template calls Template: Bra to render the brackets.

See also