Difference between revisions of "Template:Mathcal"

From blackwiki
Jump to navigation Jump to search
imported>Lambiam
m (+cat)
imported>Lambiam
(copy edit)
Line 3: Line 3:
  
 
=== Usage ===
 
=== Usage ===
Use this template to wrap an inline formula in wikitext. Examples:
+
Use this template to wrap an inline formula in wikitext. Example:
<pre>
+
:<code><nowiki>{{mathcal|ABCDEFGHIJKLMNOPQRSTUVWXYZ}}</nowiki></code>
{{mathcal|ABCDEFGHIJKLMNOPQRSTUVWXYZ}}
+
produces: {{mathcal|ABCDEFGHIJKLMNOPQRSTUVWXYZ}}.
</pre>
 
: produces: {{mathcal|ABCDEFGHIJKLMNOPQRSTUVWXYZ}}.
 
  
 
===Use of equals-sign===
 
===Use of equals-sign===
The template is meant to be used with alphabetic text, typically one or a few letters. If the body contains an exposed equals-sign ("<code>=</code>") is used, it will fail to renderFor example, the following template-coding would be invalid:
+
The template is meant to be used with alphabetic text, typically one or a few capital letters. If the body contains an exposed equals-sign ("<code>=</code>"), it will fail to render. For example, the following template use produces no result:
 
+
:<code><nowiki>{{mathcal|P=NP}}</nowiki></code>.
<pre>{{mathcal|P=NP}}</pre>
 
:which results in {{mathcal|P=NP}}.
 
  
 
There are two ways to resolve this.
 
There are two ways to resolve this.
  
Method 1: Start the body with "<code>1=</code>" as in:
+
Method 1: Start the body with "<code>1=</code>", as in:
<pre>{{mathcal|1=P=NP}}</pre>
+
:<code><nowiki>{{mathcal|1=P=NP}}</nowiki></code>,
:which produces: {{mathcal|1=P=NP}}.
+
which produces: {{mathcal|1=P=NP}}.
  
 
Method 2: Enclose the equals-sign in double-braces "<code><nowiki>{{=}}</nowiki></code>", as in:
 
Method 2: Enclose the equals-sign in double-braces "<code><nowiki>{{=}}</nowiki></code>", as in:
<pre>{{mathcal|P{{=}}NP}}</pre>
+
:<code><nowiki>{{mathcal|P{{=}}NP}}</nowiki></code>,
:which produces: {{mathcal|P{{=}}NP}}.
+
which produces: {{mathcal|P{{=}}NP}}.
  
 
[[Category:Mathematical formatting templates]]
 
[[Category:Mathematical formatting templates]]
 
</noinclude>
 
</noinclude>

Revision as of 22:44, 23 April 2011

The Mathcal template is intended to simulate a calligraphic font for use in mathematical formulas using standard HTML. Use this template as an alternative to \mathcal{...} in LaTeX markup (see Help:Displaying a formula).

Usage

Use this template to wrap an inline formula in wikitext. Example:

{{mathcal|ABCDEFGHIJKLMNOPQRSTUVWXYZ}}

produces: ABCDEFGHIJKLMNOPQRSTUVWXYZ.

Use of equals-sign

The template is meant to be used with alphabetic text, typically one or a few capital letters. If the body contains an exposed equals-sign ("="), it will fail to render. For example, the following template use produces no result:

{{mathcal|P=NP}}.

There are two ways to resolve this.

Method 1: Start the body with "1=", as in:

{{mathcal|1=P=NP}},

which produces: P=NP.

Method 2: Enclose the equals-sign in double-braces "{{=}}", as in:

{{mathcal|P{{=}}NP}},

which produces: P=NP.