This site is supported by donations to The OEIS Foundation.

Template:Pre

From OeisWiki
Jump to: navigation, search

The {{pre}} (preformatted text) OEIS Wiki utility template yields a delayed <pre>...</pre> tag pair, where the magic words, parser functions and template calls contained in the argument are invoked before applying the tag pair to the preformatted text. (This is not the case when using the <pre>...</pre> tag pair directly.)

Usage

{{pre|contents}}

or

{{pre|contents|pre}}

or

{{pre|contents|/pre}}

or

{{pre|contents|style}}

or

{{pre|contents|style|pre}}

or

{{pre|contents|style|/pre}}

where style defaults to

  • overflow: auto;

and you have the option of using both start and end tag names, i.e. {{pre|...|pre}} or {{pre|...|/pre}}.

Examples

The code

{{pre|
{{math|
{{nbsp|4}}{{mn|{{root|2}}{{...|ldots}}|mml}}<!--
-->|mml}}
}}

yields

<strong class="error"> Math error: Invalid format. </strong>

The code

{{pre|
{{math|
{{nbsp|4}}{{mn|{{root|2}}{{...|ldots}}|mml}}<!--
-->|mml}}
|pre}}

yields

<strong class="error"> Math error: Invalid format. </strong>

The code

{{pre|
{{math|
{{nbsp|4}}{{mn|{{root|2}}{{...|ldots}}|mml}}<!--
-->|mml}}
|/pre}}

yields

<strong class="error"> Math error: Invalid format. </strong>

Code

<noinclude>{{Documentation}}</noinclude><includeonly><!--

  Delayed <pre>...</pre> tag pair. (Invokes magic words, parser functions and templates before showing the preformatted text.)

-->{{#tag:pre|{{{1|}}}| style="{{#switch: {{{2|}}}
| pre | /pre = overflow: auto;<!-- So you may use start and end tag names: {{pre|...|pre}} or {{pre|...|/pre}} --> 
| {{#if: {{{2|}}} |{{{2}}}|overflow: auto;}}
}}"<!--
-->}}</includeonly>