Template:Mapping: Difference between revisions

Created page with "<includeonly>{{#if: {{{legend|}}} | Mapping: }}<span class="left-delim">[</span>{{bra| {{{1|0}}} }}{{#if: {{{2|}}}|, {{bra| {{{2|}}} }} }}{{#if: {{{3|}}}|, {{bra|..."
 
+support for sval and gencom mappings
Line 1: Line 1:
<includeonly>{{#if: {{{legend|}}} | [[Mapping]]:&nbsp;}}<span class="left-delim">&#91;</span>{{bra| {{{1|0}}} }}{{#if: {{{2|}}}|, {{bra| {{{2|}}} }} }}{{#if: {{{3|}}}|, {{bra| {{{3|}}} }} }}{{#if: {{{4|}}}|, {{bra| {{{4|}}} }} }}<span class="right-delim">&#93;</span></includeonly><noinclude>
<includeonly>{{#switch: {{{legend|}}} | 1 = [[Mapping]]:&nbsp; | 2 = [[Sval]] [[mapping]]:&nbsp; | 3 = [[Gencom]] [[mapping]]:&nbsp; }}<span class="left-delim">&#91;</span>{{bra| {{{1|0}}} }}{{#if: {{{2|}}}|, {{bra| {{{2|}}} }} }}{{#if: {{{3|}}}|, {{bra| {{{3|}}} }} }}{{#if: {{{4|}}}|, {{bra| {{{4|}}} }} }}<span class="right-delim">&#93;</span></includeonly><noinclude>
This '''mapping''' template eases typing [[mapping]]s: it puts bra notation (<code>&#x27E8;</code> and <code>&#93;</code>) 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.  
This '''mapping''' template eases typing [[mapping]]s: it puts bra notation (<code>&#x27E8;</code> and <code>&#93;</code>) 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.  


Line 5: Line 5:
; You type
; You type
: <code><nowiki>{{mapping| 31 49 72 87 }}</nowiki></code>
: <code><nowiki>{{mapping| 31 49 72 87 }}</nowiki></code>
: <code><nowiki>{{mapping| 1 0 -4 | 0 1 4 }}</nowiki></code>
: <code><nowiki>{{mapping| 1 0 -4 -13 | 0 1 4 10 }}</nowiki></code>
: <code><nowiki>{{mapping|legend=1| 1 0 0 0 | 0 1 1 2 | 0 0 2 -1 }}</nowiki></code>


:'''Tip''': adding spaces improves readability of the wiki markup.
:'''Tip''': adding spaces improves readability of the wiki markup.


; You get (rendered)
; You get
: {{{{PAGENAME}}| 31 49 72 87 }}
: {{{{PAGENAME}}| 31 49 72 87 }}
: {{{{PAGENAME}}| 1 0 -4 -13 | 0 1 4 10 }}
: {{{{PAGENAME}}| 1 0 -4 -13 | 0 1 4 10 }}
; To include a legend, type
: <code><nowiki>{{mapping|legend=1| 1 0 0 0 | 0 1 1 2 | 0 0 2 -1 }}</nowiki></code>
: <code><nowiki>{{mapping|legend=2| 1 0 0 0 | 0 1 1 2 | 0 0 2 -1 }}</nowiki></code>
: <code><nowiki>{{mapping|legend=3| 1 0 0 0 | 0 1 1 2 | 0 0 2 -1 }}</nowiki></code>
; So you get
: {{{{PAGENAME}}|legend=1| 1 0 0 0 | 0 1 1 2 | 0 0 2 -1 }}
: {{{{PAGENAME}}|legend=1| 1 0 0 0 | 0 1 1 2 | 0 0 2 -1 }}
: {{{{PAGENAME}}|legend=2| 1 0 0 0 | 0 1 1 2 | 0 0 2 -1 }}
: {{{{PAGENAME}}|legend=3| 1 0 0 0 | 0 1 1 2 | 0 0 2 -1 }}


== Technical note ==
== Technical note ==