Відмінності між версіями «Шаблон:Mbox»

Матеріал з Аероскан Сервіс
Перейти до: навігація, пошук
м
(Created page with '<span style="white-space: nowrap;">{{{eq|{{{1}}}}}}</span><noinclude> ---- This template prevents line breaks during HTML mathematics. It is a practical alternativ...')
Рядок 1: Рядок 1:
<includeonly><table class="metadata plainlinks" style="{{{style|width: 80%; margin: 0 auto; border-collapse: collapse; background: #f8fcff; border: 1px solid #aaa;}}} border-left: 10px solid {{#switch:{{{type|}}}
+
<span style="white-space: nowrap;">{{{eq|{{{1}}}}}}</span><noinclude>
  | warning  = #b22222
+
----
  | serious  = #b22222
+
This template prevents line breaks during HTML mathematics. It is a practical alternative to excessive use of [[non-breaking space]]s (&#38;nbsp;).
  | content  = #f28500
+
  | style    = #f4c430
+
  | merge    = #9932cc
+
  | notice  = #1e90ff
+
  | growth  = #228b22
+
  | idea    = yellow
+
  | #default = #1e90ff
+
}};">
+
<tr><td style="width: 52px; padding: 2px 0px 2px 0.5em; text-align: center;">
+
{{#if:{{{image|}}}
+
  | [[Image:{{{image}}}|40px]]
+
  | [[Image:{{#switch:{{{type|}}}
+
    | warning  = Stop hand nuvola.svg
+
    | serious  = Stop hand nuvola.svg
+
    | content  = Emblem-important.svg
+
    | style    = Applications-office.svg
+
    | merge    = Merge-split-transwiki default.svg
+
    | notice  = Information icon.svg
+
    | growth  = Nuvola Green Plus.svg
+
    | idea    = Ktip.svg
+
    | blank    = <!-- empty image cell -->
+
    | #default = <!-- empty image cell -->
+
  }}|40px]]
+
}}
+
</td><td style="color: #000000;">
+
{{{text|''Enter Text''}}}
+
</td style="padding: 0.25em 0.5em;">
+
{{#if:{{{imageright|}}}|
+
  <td class="ambox-imageright"> {{{imageright}}} </td>
+
}}
+
</tr>
+
</table></includeonly><noinclude>
+
  
== Usage ==
+
==Use==
 
+
In a math article, included math such as
This template is used to create other templates with a consistent visual style. Messages will be color coded to demonstrate their type and severity. The types of message are described as:
+
<pre>''f'': ''X'' × ''Y'' → [0, 1]</pre>
 
+
may end up broken between lines.  This can be fixed using nonbreaking spaces:
<nowiki>{{mbox|type=<TYPE>|text=<TEXT>}}</nowiki>
+
<pre>''f'':&#38;nbsp;''X''&#38;nbsp;×&#38;nbsp;''Y''&#38;nbsp;→&#38;nbsp;[0,&#38;nbsp;1]</pre>
 
+
However, this results in cumbersome source code which can be difficult to edit.  Using this template, the same result can be achieved with:
Where <TYPE> can be one of the following:
+
<pre>{{mbox| ''f'': ''X'' × ''Y'' → [0, 1] }}</pre>
 
+
{{msg:mbox|type=warning|text=warning}}
+
{{msg:mbox|type=content|text=content}}
+
{{msg:mbox|type=style|text=style}}
+
{{msg:mbox|type=merge|text=merge}}
+
{{msg:mbox|type=notice|text=notice}}
+
{{msg:mbox|type=growth|text=growth}}
+
{{msg:mbox|type=idea|text=idea}}
+
 
+
the default images can be suppressed by specifying "image=blank", or "image=<IMAGE>", where <IMAGE> is a replacement image link.
+
  
 +
===Dealing with equations===
 +
Because of Wikipedia limitations on templates, mbox doesn't function as stated above if the math contains an equals sign.  In this case, the following syntax should be used:
 +
<pre>{{mbox|eq= 2''x'' + 3''y'' + 5''z'' = 7 }}</pre>
 
</noinclude>
 
</noinclude>

Версія за 05:26, 18 вересня 2007

{{{1}}}


This template prevents line breaks during HTML mathematics. It is a practical alternative to excessive use of non-breaking spaces (&nbsp;).

Use

In a math article, included math such as

''f'': ''X'' × ''Y'' → [0, 1]

may end up broken between lines. This can be fixed using nonbreaking spaces:

''f'':&nbsp;''X''&nbsp;×&nbsp;''Y''&nbsp;→&nbsp;[0,&nbsp;1]

However, this results in cumbersome source code which can be difficult to edit. Using this template, the same result can be achieved with:

{{mbox| ''f'': ''X'' × ''Y'' → [0, 1] }}

Dealing with equations

Because of Wikipedia limitations on templates, mbox doesn't function as stated above if the math contains an equals sign. In this case, the following syntax should be used:

{{mbox|eq= 2''x'' + 3''y'' + 5''z'' = 7 }}