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

[[Category:Pages using the math template without the tex argument|Pre]] <span class="math, textstyle" style="display: inline-block; margin: 0 0 -0.75ex 0; padding: 0; white-space: nowrap; position: relative; vertical-align: -0.1ex; font-size: 1.15em; font-family: 'Computer Modern', STIXGeneral, 'Times New Roman';" title="vertical-align: baseline; No LaTeX code provided."><span style="display: inline-block; margin: 0; padding: 0; position: relative; vertical-align: -0.6ex;"><table style="display: inline-table; position: relative; vertical-align: baseline; margin: 0; padding: 0; border-width: 0; border-spacing: 0; background: transparent;"><tr><td style="margin: 0; padding: 0;">    <mn><div class="@radic@" style="display: inline-block; vertical-align: baseline; margin: -1.5ex 0 0 -0.15em; white-space: nowrap;"><span style="visibility: hidden;margin: 0 -0.75em 0 0.35em; vertical-align: 2.65ex; font-size: 0.55em;">2</span><span style="font-style: italic; font-weight: bold; font-size: 1.025em; margin: 0.085ex -0.06ex 0 0.05ex;">√</span><span style="padding: 0 0 0 0; margin: 0 0 0 -0.075ex; border-top: thin solid black; line-height: 0;"><span style="margin: 0 0 0 0; padding-top: 1px;">  2</span></span></div><span>…</span></mn></td></tr></table></span></span>

The code

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

yields

[[Category:Pages using the math template without the tex argument|Pre]] <span class="math, textstyle" style="display: inline-block; margin: 0 0 -0.75ex 0; padding: 0; white-space: nowrap; position: relative; vertical-align: -0.1ex; font-size: 1.15em; font-family: 'Computer Modern', STIXGeneral, 'Times New Roman';" title="vertical-align: baseline; No LaTeX code provided."><span style="display: inline-block; margin: 0; padding: 0; position: relative; vertical-align: -0.6ex;"><table style="display: inline-table; position: relative; vertical-align: baseline; margin: 0; padding: 0; border-width: 0; border-spacing: 0; background: transparent;"><tr><td style="margin: 0; padding: 0;">    <mn><div class="@radic@" style="display: inline-block; vertical-align: baseline; margin: -1.5ex 0 0 -0.15em; white-space: nowrap;"><span style="visibility: hidden;margin: 0 -0.75em 0 0.35em; vertical-align: 2.65ex; font-size: 0.55em;">2</span><span style="font-style: italic; font-weight: bold; font-size: 1.025em; margin: 0.085ex -0.06ex 0 0.05ex;">√</span><span style="padding: 0 0 0 0; margin: 0 0 0 -0.075ex; border-top: thin solid black; line-height: 0;"><span style="margin: 0 0 0 0; padding-top: 1px;">  2</span></span></div><span>…</span></mn></td></tr></table></span></span>

The code

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

yields

[[Category:Pages using the math template without the tex argument|Pre]] <span class="math, textstyle" style="display: inline-block; margin: 0 0 -0.75ex 0; padding: 0; white-space: nowrap; position: relative; vertical-align: -0.1ex; font-size: 1.15em; font-family: 'Computer Modern', STIXGeneral, 'Times New Roman';" title="vertical-align: baseline; No LaTeX code provided."><span style="display: inline-block; margin: 0; padding: 0; position: relative; vertical-align: -0.6ex;"><table style="display: inline-table; position: relative; vertical-align: baseline; margin: 0; padding: 0; border-width: 0; border-spacing: 0; background: transparent;"><tr><td style="margin: 0; padding: 0;">    <mn><div class="@radic@" style="display: inline-block; vertical-align: baseline; margin: -1.5ex 0 0 -0.15em; white-space: nowrap;"><span style="visibility: hidden;margin: 0 -0.75em 0 0.35em; vertical-align: 2.65ex; font-size: 0.55em;">2</span><span style="font-style: italic; font-weight: bold; font-size: 1.025em; margin: 0.085ex -0.06ex 0 0.05ex;">√</span><span style="padding: 0 0 0 0; margin: 0 0 0 -0.075ex; border-top: thin solid black; line-height: 0;"><span style="margin: 0 0 0 0; padding-top: 1px;">  2</span></span></div><span>…</span></mn></td></tr></table></span></span>

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>