User:Buggie111/Adopt/Wikicode
In Wikipedia, not all text is WYSIWYG (What you see is what you get). Most of the special mark up, (i.e. bolding, italics, etc.) are written via wikicode. More complicated stuff is also via wikicode, but we'll cover the easy stuff first.
Sections and Spacing
[edit]To write anything comprehensible, you have to divide your writing into sections. This is easily done in Wikipedia by putting = around both sides of your section. Usually, you put at least two = at each end of the section title. 1 "equals" is rarely used. Do not skip levels (from 2 to 4), it messes up the code. To create a horizontal line, use ----. To put in a line break, use
Table of contents
[edit]By default, pages generate table of contents when they have at least 4 sections. To add one when you have three sections or less, put in __TOC__. Likewise, to remove one, put in __NOTOC__.
Indent text
[edit]What you type | What it looks like |
---|---|
Left indent | |
:A colon at the start of a line ::causes the line to be indented, :::most commonly used on Talk pages. |
|
Blockquote When there is a need for separating a block of text. This is useful for (as the name says) inserting blocks of quoted (and cited) text. | |
|
|
Center text
[edit]What you type | What it looks like |
---|---|
<div class="center" style="width:auto; margin-left:auto; margin-right:auto;">Centered text</div>
|
Centered text
|
Template {{center}} uses the same markup. To center a table, see Help:Table#Centering tables.
Lists
[edit]What you type | What it looks like |
---|---|
* ''Unordered lists'' are easy to do: ** Start every line with a star. *** More stars indicate a deeper level. **: Previous item continues. ** A new line * in a list marks the end of the list. * Of course you can start again. |
marks the end of the list.
|
# ''Numbered lists'' are: ## Very organized ## Easy to follow #: Previous item continues A new line marks the end of the list. # New numbering starts with 1. |
A new line marks the end of the list.
|
Format
[edit]Text formatting
[edit]Description | What you type | What it looks like |
---|---|---|
Italics, bold, small capital letters. |
To ''italicize text'', just put 2 apostrophes on each side. 3 apostrophes will '''bold the text''' 5 apostrophes for '''''bold italics''''' For text as {{Smallcaps|small caps}}, that uses a [[Help:Template|template]]. ; A lead semicolon bolds an entire line. Semicolons (";") must start each line. Often, it is used for section headers (see [[#Sections|above]]). |
To italicize text, just put 2 apostrophes on each side. 3 apostrophes will bold the text 5 apostrophes for bold italics For text as small caps, that uses a template.
Semicolons (";") must start each line. Often, it is used for section headers (see above). |
Syntax highlighting for source code. Computer code has colored text and more stringent formatting.
For example, to define a function: |
<syntaxhighlight lang="cpp"> #include <iostream> int m2 (int ax, char *p_ax) { std::cout <<"Hello World!"; return 0; }</syntaxhighlight> |
#include <iostream>
int m2 (int ax, char *p_ax) {
std::cout <<"Hello World!";
return 0;
}
|
Small text. |
Use <small>small text</small> if needed. A span tag can set text font-size as being <span style="font-size:87%">87% of prior size</span>, to match an image caption. |
Use small text if needed. A span tag can set text font-size as being 87% of prior size, to match an image caption. |
Big text. |
Better not use <big>big text</big>, unless <small> it's <big>within</big> small</small> text. |
Better not use big text, unless it's within small text. |
You can include a non-breaking space (sometimes called non-printing character) where you require two words to always appear together on the same line, such as Mr. Smith or 400 km/h, using |
Mr. Smith or 400 km/h. |
Mr. Smith or 400 km/h. |
Extra spacing within text can best be achieved using the pad template. |
Mary {{pad|4em}} had a little lamb. |
Mary had a little lamb. |
Typewriter font. (Does also work beyond the end of a paragraph.) |
<tt>arrow →</tt> <tt>''italics'', '''bold'''</tt> <tt><nowiki>[[link]] New paragraph </tt>started here. |
arrow → italics, bold New paragraph started here. |
Subscripts and superscripts
[edit]- The Manual of Style prefers the x<sub>1</sub> 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.
Description | What you type | What it looks like |
---|---|---|
Subscripts |
x<sub>1</sub> x<sub>2</sub> x<sub>3</sub> or x₀ x₁ x₂ x₃ x₄ x₅ x₆ x₇ x₈ x₉ |
x1 x2 x3 or |
Superscripts |
x<sup>1</sup> x<sup>2</sup> x<sup>3</sup> or x⁰ x¹ x² x³ x⁴ x⁵ x⁶ x⁷ x⁸ x⁹ |
x1 x2 x3 or |
Combined |
ε<sub>0</sub> = 8.85 × 10<sup>−12</sup> C² / J m 1 [[hectare]] = [[1 E4 m²]] |
ε0 = 8.85 × 10−12 C² / J m |
Greek characters
[edit]What you type | What it looks like |
---|---|
α β γ δ ε ζ η θ ι κ λ μ ν ξ ο π ρ σ ς τ υ φ χ ψ ω Α Β Γ Δ Ε Ζ Η Θ Ι Κ Λ Μ Ν Ξ Ο Π Ρ Σ Τ Υ Φ Χ Ψ Ω |
α β γ δ ε ζ |
Mathematical characters
[edit]- See also WikiProject Mathematics and TeX.
What you type | What it looks like |
---|---|
∫ ∑ ∏ √ − ± ∞ ≈ ∝ ≡ ≠ ≤ ≥ × · ÷ ∂ ′ ″ ∇ ‰ ° ∴ ℵ ø ∈ ∉ ∩ ∪ ⊂ ⊃ ⊆ ⊇ ¬ ∧ ∨ ∃ ∀ ⇒ ⇐ ⇓ ⇑ ⇔ → ↓ ↑ ← ↔ |
∫ ∑ ∏ √ |
Mathematical formulae
[edit]- Formulae that include mathematical letters, like x, and operators like
×
should not use the plain letterx
. See math font formatting. For a comprehensive set of symbols, and comparison between<math>
tags and the {{math}} template see section TeX vs HTML.
- The
<math>
tag typesets using LaTeX markup, which may render as an image or as HTML, depending on environmental settings. The<math>
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 {{nowrap}} template.
- The {{math}} template uses HTML, and will size-match a serif font, and will also prevent line-wrap. All templates are sensitive to the
=
sign, so remember to replace=
with {{=}} in template input. Use wikimarkup''
and'''
inside the {{math}} template, as well other HTML entities. The {{math}} template is best for typeset formulas in line with the text.
Markup | Renders as |
---|---|
<math>2x \times 4y \div 6z + 8 - \frac {y}{z^2} = 0</math> {{crlf|}} {{math|2x × 4y ÷ 6z + 8 − {{Fraction |y|z<sup>2</sup>}} {{=}} 0}} <math>\sin 2\pi x + \ln e\,\!</math> <math>\sin 2\pi x + \ln e</math> {{math|sin 2π''x'' + ln ''e''}} |
2x × 4y ÷ 6z + 8 − y⁄z2 = 0
|
Spacing in simple math formulae
[edit]- Using
to prevent linebreak is not needed; the{{math}}
template will prevent line breaks anyway; you can use<br/>
if you need an explicit line break inside a formula.
What you type | What it looks like |
---|---|
It follows that {{math |''x''<sup>2</sup> ≥ 0}} is true when {{math|<VAR>x</VAR>}} is a real number. |
It follows that x2 ≥ 0 is true when x is a real number. |
Complicated formulae
[edit]- See Help:Displaying a formula for how to use <math>.
- A formula displayed on a line by itself should probably be indented by using the colon (:) character.
What you type | What it looks like |
---|---|
: <math>\sum_{n=0}^\infty \frac{x^n}{n!}</math> |
|
Links
[edit]Linking between Wikipedia articles is simple. Just add [[ and ]] to either end of the article's title. To customize the title, add | in between the title and the ]], then add your custom title. Links outside of Wikipedia are created by adding a single bracket to either side. To add a custom title to these links, space between the end of the url and the end bracket, then add your text. Links with incorrect titles will become red.
Link to a section of a page
[edit]- 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. #Example section 3 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.
What you type | What it looks like |
---|---|
|
Wikipedia:Manual of Style#Italics is a link to a section within another page. |
|
#Links and URLs is a link to another section on the current page. Links and URLs is a link to the same section without showing the # symbol. |
|
Italics is a piped link to a section within another page. |
Create page link
[edit]- 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 Wikipedia's naming conventions.
- Please do not create a new article without linking to it from at least one other article.
Description | What you type | What it looks like |
---|---|---|
Links to pages that don’t exist yet look red. |
|
The article about cardboard sandwiches doesn't exist yet. |
Redirects
[edit]- 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#History will redirect to the History section of the United States page, if it exists.
Description | What you type |
---|---|
Redirect to an article. |
|
Redirect to a section. |
|
What you type | What it looks like |
---|---|
|
See the Wikipedia:Manual of Style. |
Link to the same article in another language (interlanguage links)
[edit]- To link to a corresponding page in another language, use the form: [[language code:Foreign 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".
- For further help, please see Interlanguage links and the Complete list of language wikis available.
NOTE: To create an inline link (a clickable link within the text) to any foreign language article, see Inline interlanguage links and consider the usage notes.
Description | What you type |
---|---|
Link from English article "Plankton" to the Spanish article "Plancton". |
|
Other examples: German ( |
|
- Link to any page on other Wikimedia wikis.
- Note that interwiki links use the internal link style.
- See MetaWikiPedia: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.
Description | What you type | What it looks like |
---|---|---|
Linking to a page on another wiki in English. All of these forms lead to the URL http://en.wiktionary.org/wiki/Hello. | ||
Simple link. Without prefix. Named link. |
|
|
Linking to a page on another wiki in another language. All of these forms lead to the URL http://fr.wiktionary.org/wiki/bonjour. | ||
Simple link. Without prefix. Named link. |
|
Categories
[edit]- 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.
Description | What you type | What it looks like |
---|---|---|
Categorize an article. |
|
|
Link to a category. |
|
|
Without prefix. |
|
Images
[edit]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.
What you type | What it looks like | Notes | |
---|---|---|---|
A picture: [[File:wiki.png]] |
A picture: | ||
With alternative text: [[File:wiki.png|alt=Puzzle globe logo]] |
With alternative text: |
| |
With link: [[File:wiki.png|link=Wikipedia]] |
With link: |
| |
Floating to the right side of the page using the ''frame'' attribute and a caption: [[File:wiki.png|frame|alt=Puzzle globe|Wikipedia logo]] |
Floating to the right side of the page using the frame attribute and a caption:
![]() |
| |
Floating to the right side of the page using the ''thumb'' attribute and a caption: [[File:wiki.png|thumb|alt=Puzzle globe|Wikipedia logo]] |
Floating to the right side of the page using the thumb attribute and a caption:
![]() |
| |
Floating to the right side of the page ''without'' a caption: [[File:wiki.png|right|Wikipedia encyclopedia]] |
Floating to the right side of the page without a caption:
![]() |
| |
A picture resized to 30 pixels... [[File:wiki.png|30 px|Wikipedia encyclopedia]] |
A picture resized to 30 pixels... |
| |
Linking directly to the description page of an image: [[:File:wiki.png]] |
Linking directly to the description page of an image: |
| |
Linking directly to an image without displaying it: [[Media:wiki.png|Image of jigsaw globe]] |
Linking directly to an image without displaying it: |
| |
Example: <div style="display:inline; width:220px; float:right;"> Place images here </div> |
Example:
Place images here
|
Using the | |
Example: {| align=right |- | Place images here |} |
Example:
|
Using wiki markup to make a table in which to place a vertical column of images (this helps edit links match headers, especially in Firefox browsers). |
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
[edit]There are two ways to build tables:
- In special wiki-markup (see Table).
- Using HTML elements: <table>, <tr>, <td> or <th>.
See also When tables are appropriate.
References and citing sources
[edit]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.
What it's for | What you type |
---|---|
For creating the reference | <ref name="name for reference">Use a closing tag</ref>
|
When you cite a book | {{cite book}}
|
To cite a web source | {{cite web}}
|
Book ISBN | |isbn=0-8018-6646-4 (ISBN of the book)
|
Web URL | |url=http://www.wikipedia.org
|
Title | |title=title of source
|
Author | |author=authors, use commas for multiple
|
First name | |first=first name
|
Last name | |last=last name
|
Location | |location=location of occurrence
|
Publisher | |publisher=who published the source
|
Date | |date=2007-03-04 (date of source)
|
Year | |year=year of source
|
Accessed date | |accessdate=2008-12-07
|
A complete reference tag | <ref name="WikiMarkup">{{cite web |url=http://en.wikipedia.org/w/index.php?title=Help:Wiki_markup |title=Help:Wiki markup |publisher=Wikimedia Foundation}}</ref>
|
Referencing this again | <ref name="WikiMarkup"/>
|
Citation needed | {{citation needed}}
|
What links here and related changes
[edit]What you type | What it looks like |
---|---|
[[Special:WhatLinksHere/aaa]] |
|
[[Special:RecentChangesLinked/aaa]] |
Linking to old revisions of pages, diffs, and specific history pages
[edit]- 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.
What you type | What it looks like |
---|---|
|
Nowiki
[edit]In some instances, we don't want our markup to be parsed as markup, so we enclose it in <nowiki>...</nowiki>
tags. <nowiki>
is a parser tag that causes the included content to not be parsed as wikimarkup, except for HTML entities. It is useful in documentation to display markup.
Markup | Renders as |
---|---|
<nowiki>{{cite book}}</nowiki> |
{{cite book}} |
A singular <nowiki />
can be used to break wikimarkup.
Variables
[edit]Some "Magic Words" can be used to add in information like the date, month, etc. They are as follows:
Code | Effect | Notes |
---|---|---|
{{CURRENTWEEK}} | 22 | |
{{CURRENTDOW}} | 1 |
Monday = 1, Tuesday = 2, etc., but Sunday = 0 |
{{CURRENTMONTH}} | 05 | |
{{CURRENTMONTHNAME}} | May | |
{{CURRENTMONTHNAMEGEN}} | May | |
{{CURRENTDAY}} | 26 | |
{{CURRENTDAYNAME}} | Monday | |
{{CURRENTYEAR}} | 2025 | |
{{CURRENTTIME}} | 04:38 | |
{{NUMBEROFARTICLES}} | 6,998,667 | |
{{NUMBEROFPAGES}} | 63,207,516 | |
{{NUMBEROFUSERS}} | 49,190,729 | |
{{PAGENAME}} | Buggie111/Adopt/Wikicode | |
{{NAMESPACE}} | User | |
{{REVISIONID}} | - | |
{{REVISIONUSER}} | Buggie111 | |
{{localurl:pagename}} | /wiki/Pagename | |
{{localurl:Wikipedia:Sandbox|action=edit}} | /w/index.php?title=Wikipedia:Sandbox&action=edit | |
{{fullurl:pagename}} | //en.wikipedia.org/wiki/Pagename | |
{{fullurl:pagename|query_string}} | //en.wikipedia.org/w/index.php?title=Pagename&query_string | |
{{SERVER}} | //en.wikipedia.org | |
{{ns:1}} | Talk |
{{ns:index}} e.g. {{ns:1}} → full name of namespace |
{{SITENAME}} | Wikipedia |
Assignment
[edit]Replace "USER" with your username.