Help:Wikitext: Difference between revisions

Content deleted Content added
No edit summary
Line 221:
''Description lists''<!--HTML5 name--> (formerly ''definition lists''<!--HTML4 name-->, and a.k.a. ''association lists''<!--draft HTML5 name-->) consist of group names corresponding to values. Group names (terms) are in bold. Values (definitions) are indented. Each group <em>must</em> include one or more definitions. For a single or first value, the <code>:</code> can be placed on the same line after <code>;</code> – but subsequent values must be placed on separate lines.
 
{{hatnote-inline|Do not use a semicolon (;) simply to bold a line without defining a value using a colon (:). This usage renders invalid [[Wikipedia:HTML5]] and creates issues with [[wikipedia:screen reader|screen reader]]s.}}
 
{{markup
Line 247:
{{shortcut|H:POEM}}
 
The MediaWiki software suppresses single newlines and converts lines starting with a space to preformatted text in a dashed box. HTML suppresses multiple spaces. It is often desirable to retain these elements for poems, lyrics, mottoes, oaths and the like. The [[mw:Extension:Poem|Poem]] extension adds HTML-like {{tag|poem}} tags to maintain newlines and spaces. These tags may be used inside other tags such as {{tag|blockquote}}; the template {{tlx|poemquote}} provides a convenient shorthand. [[wikipedia:H:CSS|CSS styles]] may be applied to this tag, e.g.: <code><nowiki><poem style="margin-left: 2em;"></nowiki></code>.
 
{{markup
Line 343:
|-
|
Small chunks of [[wikipedia:source code|source code]] within a line of normal text.
 
Code is displayed in a [[wikipedia:Monospaced font|monospace]] font.
|
<pre><nowiki>function <code>int m2()</code> is nice.</nowiki></pre>
Line 392:
|
<syntaxhighlight lang="html">
To match, for example, the font-size used in an [[wikipedia:Help:Visual file markup#Caption|image caption]], the "small" tag can also be used to
<small style="font-size:87%;">reduce a text's font-size to 87%</small>.
</syntaxhighlight>
|
To match, for example, the font-size used in an [[wikipedia:Help:Visual file markup#Caption|image caption]], the "small" tag can also be used to <small style="font-size:87%;">reduce a text's font-size to 87%</small>.
 
<!----------------- <big> text ------------------>
Line 412:
|-
|
To prevent two words from becoming separated by a [[wikipedia:linewrap|linewrap]] (e.g. ''Mr.&nbsp;Smith'' or ''400&nbsp;km/h'') a '''[[wikipedia:non-breaking space|non-breaking space]]''', sometimes also called a "non-printing character", may be used between them. (For three or more words, the template {{tl|nowrap}} is probably more suitable.)
|
<pre>Mr.&amp;nbsp;Smith or 400&amp;nbsp;km/h</pre>
Line 577:
====Subscripts and superscripts====
* The [[Wikipedia:Manual of Style (mathematics)#Superscripts and subscripts|Manual of Style]] prefers the {{tag|sub|o}} and {{tag|sup|o}} formats, for example <code>x{{tag|sub|content=1}}</code>. So this should be used under most circumstances.
* The latter methods of sub/superscripting cannot be used in the most general context, as they rely on [[wikipedia:Unicode|Unicode]] support that may not be present on all users' machines.
 
{| class="wikitable"
Line 634:
&epsilon;<sub>0</sub> = 8.85 &times; 10<sup>&minus;12</sup> C&sup2; / J m
 
1 [[wikipedia:hectare|hectare]] = [[wikipedia:1 E+4 m&sup2;|1 E+4 m&sup2;]]
 
|}
Line 641:
{{main|wikipedia:MOS:TEXT#PUA and RTL}}
 
Invisible and [[wikipedia:Private Use Areas|PUA (Private Use Areas)]] characters should be avoided where possible. When needed, they should both be replaced with their (hexa)decimal code values (as "&#(x)...;"). This renders invisible characters visible, for manual editing, and allows [[Wikipedia:AutoWikiBrowser|AWB]] to process pages with PUA characters. The latter should also be tagged with the {{tl|PUA}} template for tracking and future maintenance.
 
===Mathematical characters and formulae===
Line 647:
====Mathematical characters====
 
* See also [[Wikipedia:Mathematical symbols]], [[Wikipedia:WikiProject Mathematics|WikiProject Mathematics]] and [[wikipedia:TeX|TeX]].
 
{| class="wikitable"
Line 683:
{{main|Help:Displaying a formula}}
 
* Formulae that include mathematical letters, like {{math|x}}, and operators like <code>×</code> should not use the plain letter <code>x</code>. See [[wikipedia:MOS:MATH#Font_formatting|math font formatting]]. For a comprehensive set of symbols, and comparison between {{tag|math|o}} tags and the {{tl|math}} template see section [[wikipedia:Help:Displaying_a_formula#TeX_vs_HTML|''TeX vs HTML'']].
 
* The {{tag|math|o}} tag typesets using [[wikipedia:MOS:MATH#Typesetting_of_mathematical_formulae|LaTeX markup]],{{efn|The version of LaTeX used is a subset of AMS-LaTeX markup; see [[wikipedia:Help:Displaying a formula]] for details.}} which may render as an image or as HTML, depending on environmental settings. The {{tag|math|o}} tag is best for the complex formula on its own line in an image format. If you use this tag to put a formula in the line with text, put it in the {{tl|nowrap}} template.
 
* The {{tl|math}} template [[wikipedia:MOS:MATH#Using_HTML|uses HTML]], and will size-match a serif font, and will also prevent line-wrap. All templates are sensitive to the <code>=</code> sign, so remember to replace <code>=</code> with <code>{{tl|{{=}}}}</code> in template input, or start the input with <code>1=</code>. Use wikimarkup <code><nowiki>''</nowiki></code> and <code><nowiki>'''</nowiki></code> inside the {{tl|math}} template, as well as other [[Wikipedia:Mathematical_symbols|HTML entities]]. The {{tl|math}} template is best for typeset formulas in line with the text.
Line 728:
====Complicated formulae====
 
* See [[wikipedia:Help:Displaying a formula]] for how to use {{tag|math|o}}.
* A formula displayed on a line by itself should probably be indented by using the colon (:) character.
 
Line 744:
===Free links===
 
In [[wikipedia:Wikipedia|Wikipedia]] and some other [[wikipedia:wiki|wiki]]s, '''free links''' are used in [[wikipedia:wikitext|wikitext]] markup to produce [[wikipedia:internal link|internal link]]s between pages, as opposed to the concept of [[wikipedia:CamelCase|CamelCase]] for the same purpose, which was used in the early days of Wikipedia – see [[Wikipedia:CamelCase and Wikipedia|CamelCase and Wikipedia]].
 
In [[Wikipedia:How to edit a page#Wiki markup|Wikipedia's markup language]], you create free links by putting double square brackets around text designating the title of the page you want to link to. Thus, <code><nowiki>[[Texas]]</nowiki></code> will be rendered as [[wikipedia:Texas|Texas]]. Optionally, you can use a [[wikipedia:vertical bar|vertical bar]] (|) to customize the link title. For example, typing <code><nowiki>[[Texas|Lone Star State]]</nowiki></code> will produce [[wikipedia:Texas|Lone Star State]], a link that is displayed as "<u>Lone Star State</u>" but in fact links to [[wikipedia:Texas|Texas]].
 
====Link to another wiki article====
Line 752:
* Internally, the first letter of the target page is automatically capitalized and spaces are represented as underscores (typing an underscore in the link has the same effect as typing a space, but is not recommended).
* Thus the link hereafter is to the Web address <code>en.wikipedia.org/wiki/Public_transport</code>, which is the Wikipedia article with the name "Public transport". See also [[Help:Link#Conversion to canonical form|Canonicalization]].
* [[wikipedia:Intentionally permanent red link|A red link]] is a page that doesn't exist yet; it can be created by clicking on the link.
* [[wikipedia:Help:Self link|A link to its own page]] will appear only as bold text.
 
{{markup