模板:Xtn
示例
{{xt}}
等(“example text”的缩写)是文字格式模板,多在不便使用引号或粗体时,用彩色字体凸显文字。
用法
编辑{{xt}}
会将文字设为绿色衬线字体,用于凸显正面示例。格式手册常用本模板标记一段话中的正确示例。如果不宜使用衬线体(如电脑代码内),可换用{{bxt}}
(改用粗体)或{{mxt}}
(改用等宽字体)。如果希望示例文字自起一行,可换用{{xt2}}
若凸显不佳或错误的示例,请使用 {{!xt}}
、{{!bxt}}
、{{!mxt}}
、{{!xt2}}
等模板。
若凸显废弃、不确定、不可用等示例,可使用{{xtd}}
(d代表deprecated)模板或其别名{{xtg}}
(g代表grey)。相关模板还有{{bxtd}}
、{{mxtd}}
。
若凸显中性示例,可使用{{xtn}}
。此模板不修改文字颜色,惟将字体切换为衬线体。粗体版可使用{{bxtn}}
。
These templates cannot be used in mainspace (articles). Attempting to do so will throw an error.
These templates are not for use as quotation markup in talk pages; use {{tq}}
instead.
Parameters
编辑|text here
or|1=text here
– The text to which to apply the markup. As with all templates, when the text has any equals characters ("="), explicitly prefix the text with|1=
or the template will break.|title=tooltip text here
– Takes text, which cannot be marked up in any way, and displays it as a pop-up "tooltip" (in most browsers) when the cursor hovers over the span
Accessibility
编辑The accompanying change in typeface to a serif or mono-spaced type style, (example text) is to make it fully accessible for those with color blindness.
Keep accessibility more broadly in mind, and never construct examples such that a blind person, who may not be able to see the coloration, boldfacing, or monospace font change, cannot understand the examples. Especially indicate, with terms like "not", "don't", "wrong:", etc., that a negative example is a negative one, or with "deprecated", "avoid", etc., that deprecated material is deprecated.
Examples
编辑- What you write
...for example, {{xt|1=''T'' = 293.15 K}}, but not {{!xt|1=''m''=5.4kg}}.
- What you get
- ...for example, T = 293.15 K, but not m=5.4kg.
What you type | What you get |
---|---|
this is an {{xt|inline typeface change}} for comparison | this is an inline typeface change for comparison |
this is an {{!xt|inline typeface change}} for comparison | this is an inline typeface change for comparison |
this is an {{xtn|inline typeface change}} for comparison | this is an inline typeface change for comparison |
this is an {{xtd|inline typeface change}} for comparison | this is an inline typeface change for comparison |
this is an {{mxt|inline typeface change}} for comparison | this is an inline typeface change for comparison |
this is an {{!mxt|inline typeface change}} for comparison | this is an Template:!mxt for comparison |
this is an {{mxtn|inline typeface change}} for comparison | this is an Template:Mxtn for comparison |
this is an {{mxtd|inline typeface change}} for comparison | this is an Template:Mxtd for comparison |
this is an {{bxt|inline typeface change}} for comparison | this is an Template:Bxt for comparison |
this is an {{!bxt|inline typeface change}} for comparison | this is an Template:!bxt for comparison |
this is an {{bxtn|inline typeface change}} for comparison | this is an Template:Bxtn for comparison |
this is an {{bxtd|inline typeface change}} for comparison | this is an Template:Bxtd for comparison |