Template:Mapping: Difference between revisions
Jump to navigation
Jump to search
+support for sval and gencom mappings |
ArrowHead294 (talk | contribs) mNo edit summary |
||
(5 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
<includeonly>{{#switch: {{{legend|}}} | 1 = [[Mapping]]: | 2 = [[Sval]] [[mapping]]: | 3 = [[Gencom]] [[mapping]]: }}<span class="left-delim">[</span>{{bra| {{{1|0}}} }}{{#if: {{{2|}}}|, {{bra| {{{2|}}} }} }}{{#if: {{{3|}}}|, {{bra| {{{3|}}} }} }}{{#if: {{{4|}}}|, {{bra| {{{4|}}} }} }}<span class="right-delim">]</span></includeonly><noinclude> | <includeonly>{{#switch: {{{legend|}}} | 1 = [[Mapping]]: | 2 = [[Sval]] [[mapping]]: | 3 = [[Gencom]] [[mapping]]: }}<span class="left-delim">[</span>{{bra| {{{1|0}}} }}{{#if: {{{2|}}}|, {{bra| {{{2|}}} }} }}{{#if: {{{3|}}}|, {{bra| {{{3|}}} }} }}{{#if: {{{4|}}}|, {{bra| {{{4|}}} }} }}<span class="right-delim">]</span></includeonly><noinclude> | ||
{{documentation}} | |||
[[Category:Formatting templates]] | |||
[[Category: | |||
</noinclude> | </noinclude> |
Latest revision as of 19:03, 30 January 2025
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 -13 | 0 1 4 10 }}
- Tip: adding spaces improves readability of the wiki markup.
- You get
- [⟨31 49 72 87]]
- [⟨1 0 -4 -13], ⟨0 1 4 10]]
- To include a legend, type
{{mapping|legend=1| 1 0 0 0 | 0 1 1 2 | 0 0 2 -1 }}
{{mapping|legend=2| 1 0 0 0 | 0 1 1 2 | 0 0 2 -1 }}
{{mapping|legend=3| 1 0 0 0 | 0 1 1 2 | 0 0 2 -1 }}
- So you get
- Mapping: [⟨1 0 0 0], ⟨0 1 1 2], ⟨0 0 2 -1]]
- Sval mapping: [⟨1 0 0 0], ⟨0 1 1 2], ⟨0 0 2 -1]]
- Gencom mapping: [⟨1 0 0 0], ⟨0 1 1 2], ⟨0 0 2 -1]]
Technical note
This template calls Template: Bra to render the brackets.