Help:Wiki markup

A video about WikiCode and how to use it. Wiki markup is the syntax and keywords used by the software to format a page. To learn how to use this markup and to save an edit, see Help:Editing pages. Many links on this page are to more complete information on Wikipedia help pages. For additional help see Wikipedia:Template:Wiki markup

Section headings
Use headings to split articles into sections. Put a heading on a separate line. A level-two heading is the highest level editors use in an article.

{| class="wikitable" ! style="width: 50%" | What it looks like ! style="width: 50%" | What you type Section headings

Headings organize your writing into sections. The Wiki software can automatically generate a table of contents from them. Start with 2 'equals' characters.

Subsection Using more 'equals' characters creates a subsection.

A smaller subsection

Don't skip levels, like from two to four 'equals' characters.

A semicolon at the start of a line is a way of making headings that don't appear in the TOC. It actually bolds the entire line (see below).
 * A non-TOC subsection

Section headings
Headings organize your writing into sections. The Wiki software can automatically generate a table of contents from them. Start with 2 'equals' characters.

Subsection
Using more 'equals' characters creates a subsection.

A smaller subsection
Don't skip levels, like from two to four 'equals' characters.

A semicolon at the start of a line is a way of making headings that don't appear in the TOC. It actually bolds the entire line (see below). Separating with a horizontal dividing line:
 * A non-TOC subsection
 * Horizontal line
 * Horizontal line
 * this is above it...


 * ...and this is below it.

If you don't use a section header, you don't get a TOC entry. Separating with a horizontal dividing line:
 * Horizontal line
 * this is above it...


 * ...and this is below it.

If you don't use a section header, you don't get a TOC entry.


 * }

Table of contents
When a page has at least four headings, a table of contents (TOC) will appear in front of the first header (after the lead). Putting anywhere forces the TOC to appear at that point (instead of just before the first heading). Putting anywhere forces the TOC to disappear. See also Compact TOC for alphabet and year headings.

Line breaks

 * You can make the wikitext more readable by putting in newlines, but see Wikipedia:Wikipedia:Don't use line breaks for possible problems.
 * To break lines use the  element. The HTML tag   will be converted to the XHTML   tag by HTML Tidy in most instances. The   tag is not converted when used in editnotices or in the MediaWiki namespace— it will render invalid XHTML and will break tools such as Twinkle.
 * Please use these sparingly.
 * Close markup between lines; do not start a link or italics or bold on one line and close it on the next.
 * When used in a list, a newline does affect the layout (See Wikipedia:Help:List).

Center text
Template center uses the same markup. To center a table, see Wikipedia:Help:Table.

Retaining newlines and spaces
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 Poem extension adds HTML-like  tags to maintain newlines and spaces. These tags may be used inside other tags such as .

Special characters
See also: Chess symbols in Unicode.

Diacritical marks

 * See Wikipedia:Help:Special characters.

Other punctuation
The &lsaquo;pre&rsaquo; and &lsaquo;nowiki&rsaquo; markup tags are also available. (Permits  [ { & } ]  for example.)

Subscripts and superscripts

 * The Manual of Style prefers the x1 format.
 * The latter methods of sub/superscripting cannot be used in the most general context, as they rely on Unicode support which may not be present on all users' machines. For the 1-2-3 superscripts, it is nevertheless preferred when possible (as with units of measurement) because most browsers have an easier time formatting lines with it.

Mathematical characters

 * See also WikiProject Mathematics and TeX.

Mathematical formulae

 * Complex formulae should use  markup.
 * Simple formulae may use either  markup or HTML/wiki markup using the   template with   and   or   and   for formatting.  Make sure to replace   with.
 * Ordinary text should use wiki markup for emphasis. However, mathematical formulae often use italics, and sometimes use bold, for reasons unrelated to emphasis. Per Wikipedia:Manual of Style (mathematics), wiki markup ( and  ) is preferred over HTML markup (  and  ), but both are allowed.

Spacing in simple math formulae

 * Using   to prevent linebreak is not needed; the  template will prevent line breaks anyway; you can use   if you need an explicit line break inside a formula.

Complicated formulae

 * See Wikipedia:Help:Displaying a formula for how to use &lt;math>.
 * A formula displayed on a line by itself should probably be indented by using the colon character.

Free links
In Wikipedia and some other Wikis, free links are used in Wikitext markup to produce internal links between pages, as opposed to the concept of CamelCase for the same purpose, which was used in the early days of Wikipedia, see CamelCase and Wikipedia.

In 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,   will be rendered as Texas. Optionally, you can use a vertical bar (|) to customize the link title. For example, typing    will produce Lone Star state, a link that is displayed as " Lone Star state " but in fact links to Texas.

Link to another Wiki article

 * 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 below is to the URL en.wikipedia.org/wiki/Public_transport, which is the Wikipedia article with the name "Public transport". See also Canonicalization.
 * A red link is a page that doesn't exist yet; it can be created by clicking on the link.
 * A link to its own page will appear only as bold text.

Renamed link

 * Same target, different name.
 * The target ("piped") text must be placed first, then the text to be displayed second.

Automatically rename links

 * Simply typing the pipe character (|) after a link will automatically rename the link in certain circumstances. The next time you open the edit box you will see the expanded piped link. When previewing your edits, you will not see the expanded form until you press Save and Edit again. The same applies to links to sections within the same page.
 * See Pipe trick for details.

Blend link

 * Endings are blended into the link.
 * Exception: a trailing apostrophe (') and any characters following the apostrophe are not blended.
 * Preferred style is to use this instead of a piped link, if possible.
 * Blending can be suppressed by using   tags, which may be desirable in some instances.

Link to a section of a page

 * The part after the number sign (#) must match a section heading on the page. Matches must be exact in terms of spelling, case, and punctuation. Links to non-existent sections are not broken; they are treated as links to the top of the page.
 * Include "| link title" to create a stylish (piped) link title.
 * If sections have the same title, add a number to link to any but the first.  goes to the third section named "Example section".  You can use the pipe and retype the section title to display the text without the # symbol.

Create page link

 * To create a new page:
 * Create a link to it on some other (related) page.
 * Save that page.
 * Click on the link you just made. The new page will open for editing.
 * For more information, see starting an article and check out Communpedia's naming conventions.
 * Please do not create a new article without linking to it from at least one other article.

Redirects

 * Redirect one article title to another by placing a directive like the one shown to the right on the first line of the article (such as at a page titled "USA").
 * It is possible to redirect to a section. For example, a redirect to United States will redirect to the History section of the United States page, if it exists.

Link to the same article in another language (interlanguage links)
NOTE: To create an inline link (a clickable link within the text), see Inline interlanguage links.
 * To link to a page on the same subject in another language, use the form: language code:Title.
 * It is recommended interlanguage links be placed at the very end of the article.
 * Interlanguage links are not visible within the formatted article but, instead, appear as language links on the sidebar (to the left) under the menu section "languages".
 * Please see Interlanguage links and the Complete list of language wikis available.

InterWiki link

 * Link to any page on other Wikimedia wikis.
 * Note that interwiki links use the internal link style.
 * See Interwiki_map for the list of shortcuts; if the site you want to link to is not on the list, use an external link (see below)
 * See also Wikimedia sister projects.

Categories

 * To put an article in a category, place a link like the one to the right anywhere in the article. As with interlanguage links, placing these links at the end of the edit box is recommended.
 * To link to a category page without putting the article into the category, use a colon prefix (":Category") in the link.

"As of" tag
For an explanation of the parameters see template documentation.
 * "As of" tags like "As of April 2009" and "as of April 2009" categorize info that will need updating.

Media link

 * To include links to non image uploads such as sounds, use a "media" link. For images, see next section.
 * Some uploaded sounds are listed at Sound.

Book sources

 * Link to books using their ISBN. This is preferred to linking to a specific online bookstore, because it gives the reader a choice of vendors. However, if one bookstore or online service provides additional free information, such as table of contents or excerpts from the text, then a link to that source will aid the user and is recommended. ISBN links do not need any extra markup, provided you use one of the indicated formats.
 * To create a link to Book Sources using alternative text (e.g. the book's title), use the internal link style with the appropriate namespace.

RFC number

 * Link to Internet Engineering Task Force Request for Comments (RFCs).

Pronunciation aids
It is often desirable to provide an aid to pronunciation for a word. The IPAc-en and Respell templates can be of assistance.

Refer to Manual of Style (pronunciation) for more information.

Images
Only images that have been uploaded to Wikipedia can be used. To upload images, use the upload page. You can find the uploaded image on the image list.


 * }

See the Wikipedia's image use policy as a guideline used on Wikipedia.

For further help on images, including some more versatile abilities, see the picture tutorial.

Tables
There are two ways to build tables:
 * in special Wiki-markup (see Table)
 * Using HTML elements: &lt;table&gt;, &lt;tr&gt;, &lt;td&gt; or &lt;th&gt;.

See also When tables are appropriate.

References and citing sources
Making a reference citing a printed or online source can be accomplished by using the ref tag. Inside the reference tag details about the reference are added. You can add additional attributes to add detail about the source and reference, a pipe (|) precedes each reference, each attribute goes inside the cite portion of the tag.

Templates and transcluding pages
Examples for templates:, $sin x + ln y$, ,

Templates are segments of Wiki markup that are meant to be copied automatically ("transcluded") into a page. You add them by putting the template's name in. It is also possible to transclude other pages by using.

There are three pairs of tags that can be used in wikitext to control how transclusion affects parts of a template or article. They determine whether or not wikitext renders, either in its own article, which we will call "here", or in another article where it is transcluded, which we will call "there". There can be several such section "elements". Also, they can be nested. All possible renderings are achievable. For example, to render there one or more sections of the page here use   tags. To append text there, wrap the addition in   tags above, within, or below the section. To omit portions of the section, nest   tags within it.
 *  :  the content will not be rendered there. These tags have no effect here.
 *  :  the content will render only there, and  will not render here (like invisible ink made visible by means of transclusion).
 *  : the content will render here and will render there, but it will only render there what is between these tags.

If a page is transcluded without transclusion markup, it may cause an unintentional categorization. Any page transcluding it will contain the same category as the original page. Wrap the category markup with   tags to prevent incorrect categorization.

Some templates take parameters, as well, which you separate with the pipe character.

Signing comments

 * The character tilde (~) is used when adding a comment to a Talk page.
 * Your username provides a link to your user page.

Linking to old revisions of pages, diffs, and specific history pages

 * External link function is used for these.
 * Open an old revision or diff and copy the url from the address bar, pasting it where you want it.

User edits

 * Link to a user's Contributions page.

Show deleted or inserted text

 * When editing regular Wikipedia articles, just make your changes and do not mark them up in any special way.
 * When editing your own previous remarks in talk pages, it is sometimes appropriate to mark up deleted or inserted material.
 * For striking out material, the markup is an alternative to.


 * Notes
 * The &lt;s&gt; tags are listed as deprecated in HTML 4 but are used in HTML 5.

Limiting formatting/escaping wiki markup
A few different kinds of formatting will tell the Wiki to display things as you typed them — what you see is what you get!

Invisible text (comments)
It's uncommon, but on occasion acceptable for notes to other editors, to add a hidden comment within the text of an article. These comments are only visible when editing or viewing the source of a page. Most comments should go on the appropriate Talk page. The format is to surround the hidden text with '&lt;!--' and '--&gt;' and may cover several lines, e.g.:

Variables
*Monday=1, Tuesday=2, etc.

NUMBEROFARTICLES is the number of pages in the main namespace which contain a link and are not a redirect, in other words number of articles, stubs containing a link, and disambiguation pages.

CURRENTMONTHNAMEGEN is the genitive (possessive) grammatical form of the month name, as used in some languages; CURRENTMONTHNAME is the nominative (subject) form, as usually seen in English.

In languages where it makes a difference, you can use constructs like to convert a word from the nominative case to some other case. For example, means the same as.

HTML
Many tags can be used in Wiki markup. You can check your HTML by using markup validation.