APL Wiki:Formatting: Difference between revisions

From APL Wiki
Jump to navigation Jump to search
m (10 revisions imported: Migrate from miraheze)
(→‎Mathematical notation: LaTeX symbols to commands)
Line 60: Line 60:
MathJax is enabled, so you can insert mathematical notation (for example for [[Iverson notation]]) inline using
MathJax is enabled, so you can insert mathematical notation (for example for [[Iverson notation]]) inline using
<blockquote><pre>
<blockquote><pre>
included the expression <math>⊥p_{32,33}:+/\alpha^2/I^0</math> in its description
included the expression <math>\bot p_{32,33}:+/\alpha^2/I^0</math> in its description
</pre></blockquote>
</pre></blockquote>
which results in:
which results in:
<blockquote>
<blockquote>
included the expression <math>⊥p_{32,33}:+/\alpha^2/I^0</math> in its description
included the expression <math>\bot p_{32,33}:+/\alpha^2/I^0</math> in its description
</blockquote>
</blockquote>
For multiple and larger mathematical expressions, use
For multiple and larger mathematical expressions, use
<blockquote><pre>
<blockquote><pre>
included the expression
included the expression
:<math>i←O^{⊥I^0_{0,1,2,3}}_{⊥I^0_{4,5,6,7}}</math>
:<math>i \gets O^{\bot I^0_{0,1,2,3}}_{\bot I^0_{4,5,6,7}}</math>
in its description
in its description
</pre></blockquote>
</pre></blockquote>
Line 75: Line 75:
<blockquote>
<blockquote>
included the expression
included the expression
:<math>i←O^{⊥I^0_{0,1,2,3}}_{⊥I^0_{4,5,6,7}}</math>
:<math>i \gets O^{\bot I^0_{0,1,2,3}}_{\bot I^0_{4,5,6,7}}</math>
in its description
in its description
</blockquote>
</blockquote>

Revision as of 12:35, 21 November 2019

APL Wiki is a standard MediaWiki, so the MediaWiki documentation for applies. In particular, the following are useful:

However, please familiarise yourself with the below APL Wiki-specific guidelines before making any major edits.

Mentioning subjects that have their own page

It is fine for a page to have a section about a subject that also has its own page. When that happens, begin the section with {{Main|subject}} where subject is the target page title. Don't include double brackets (as a page link) — it is done for you.

Yes/No tables

For tables comparison tables, use the {{Yes}}, {{No}}, and {{Maybe}} templates, e.g.:

{| class=wikitable
 ! Get wet?
             | Indoors || Outdoors  || Swimming
 |-
 | Sunshine || {{No}}  || {{No}}    || {{Yes}}
 |-
 | Rain     || {{No}}  || {{Maybe}} || {{Yes}}
|}

gives:

Get wet? Indoors Outdoors Swimming
Sunshine No No Yes
Rain No Maybe Yes

Custom options

You can customise the text by supplying an argument:

{| class=wikitable
 ! Get wet?
             | Indoors        || Outdoors             || Swimming
 |-
 | Sunshine || {{No}}         || {{No|Obviously not}} || {{Yes}}
 |-
 | Rain     || {{No|Depends}} || {{Maybe|Umbrella?}}  || {{Yes|Obviously}}
|}

gives:

Get wet? Indoors Outdoors Swimming
Sunshine No Obviously not Yes
Rain Depends Umbrella? Obviously

Inserting code

Mathematical notation

MathJax is enabled, so you can insert mathematical notation (for example for Iverson notation) inline using

included the expression <math>\bot p_{32,33}:+/\alpha^2/I^0</math> in its description

which results in:

included the expression in its description

For multiple and larger mathematical expressions, use

included the expression
:<math>i \gets O^{\bot I^0_{0,1,2,3}}_{\bot I^0_{4,5,6,7}}</math>
in its description

which results in:

included the expression

in its description

Equivalence

It is quite common to state equivalences. Please use a proper equivalence arrow, which is easy to insert with the template:

this {{←→}} that

which results in:

this that

Inline code

Inline code is used for single primitives and short expressions and uses the format

<source lang=apl inline>(2=+⌿0=N∘.|N)/N←⍳100</source>

which results in

(2=+⌿0=N∘.|N)/N←⍳100

Code blocks

For session transcripts, function definitions and longer expressions, use code blocks like

<source lang=apl>
      (2=+⌿0=N∘.|N)/N←⍳100
2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97
</source>

which results in:

      (2=+⌿0=N∘.|N)/N←⍳100
2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97

Optionally, you can indicate one or more APL dialects which are able to run the code by using a special template immediately after the source tag, like

<source lang=apl>
      {(2=+⌿0=⍵∘.|⍵)/⍵}⍳100
2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97
</source>
{{Works in|[[Dyalog APL]], [[dzaima/APL]], [[GNU APL]], [[ngn/apl]]}}

which results in:

      {(2=+⌿0=⍵∘.|⍵)/⍵}⍳100
2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97

You can also include a permalink to TryAPL, Try It Online, repl.it, or n9n.gitlab.io right before the source tag, for example

[https://tryapl.org/?a=%7B%282%3D+%u233F0%3D%u2375%u2218.%7C%u2375%29/%u2375%7D%u2373100&run Try it now!]
<source lang=apl>
      {(2=+⌿0=⍵∘.|⍵)/⍵}⍳100
2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97
</source>

which results in:

Try it now!

      {(2=+⌿0=⍵∘.|⍵)/⍵}⍳100
2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97

Very long code blocks

Use

{{Collapse|The below code generates a tall column of numbers.|
<source lang=apl>
      ⍪⍳10
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
</source>
}}}

which results in:

The below code generates a tall column of numbers.
      ⍪⍳10
 1
 2
 3
 4
 5
 6
 7
 8
 9
10

Creating new pages

Primitives and other built-ins

When creating a page for a primitive function, operator, or quad name, begin the page with the following template:

{{Built-in|Log|⍟}}

This inserts the text

Log ()

and also inserts a nice big illustration of the glyph on the page:

At the bottom such pages, include {{APL built-ins}} and edit that template's content if the page you're creating isn't already listed there.

Dialects

Begin your page about an APL dialect with the Infobox array language info box. These are all the optional parameters it supports:

{{Infobox array language
| title =
| developer =
| released =
| latest release version =
| withdrawn =
| array model =
| index origin =
| function styles =
| numeric types =
| unicode support =
| file ext =
| implementation language =
| implementation languages =
| platform =
| platforms =
| operating system =
| operating systems =
| license =
| website =
| download =
| documentation =
| influenced by =
| influenced =
}}

Have a look at the existing dialect pages, e.g. Dyalog APL, to see how these values are used, Try to fill in as many as you can (but use only one of each singular/plural pair). You only need to use title if the language title differs from the page title (e.g. for technical reason like the inability to create a page that begins with a lowercase letter). In that case, you may also want to begin the page with {{Actually|real name}} where real name should be the proper name of the dialect.

At the bottom of the page, include {{APL programming language}} and edit that template's content if the dialect you're creating a page about isn't already listed there.

People, organisations, and what they do

Insert {{APL community}} at the very bottom of the page, and edit that template's content if the page you're creating isn't already listed there.