Jump to content

User:Grasso Luigi/Chemistry formatting and function templates/Anchor

From Wikipedia, the free encyclopedia

Section header one

[edit]

Section header two

[edit]

Basic format

[edit]

You can define one or more anchor names, separated by |. This can be useful for alternative spellings, such as "humor" and "humour."

In general, substitute an anchor at the end of a section header:
== Section header{{subst:anchor|Anchor name}} ==

which will be saved in the article as:
== Section header<span class="anchor" id="Anchor name"></span> ==

Anchor names are case sensitive, so [[#Anchor name]] and [[#Anchor Name]] are not equivalent. When making an anchor, in general capitalize the first letter of the anchor name, and follow the same capitalization guidelines as headers (see Manual of Style: Headers for more information).

Limitations

[edit]
Character Code Template Meaning
" &quot;
&#34;
(double) quotation mark
# &#35; {{hash}} hash
| &#124; {{!}} pipe
= &#61; {{=}} equals
  • Anchor names that contain any character shown in the table on the right will not work as expected. However, any of these characters can be replaced with the "&#" codes shown for them here. Or, the pipe symbol and equals sign can be worked around with {{!}} and {{=}}, respectively. Markup code such as <sup> and <sub> (superscript and subscript) cannot be used. Most other characters, including white space and punctuation, are not a problem.
  • Anchor names must be unique on a page, and must not duplicate any heading titles. Duplicate anchors will not work as expected since the #location links go to the first anchor with that name. Duplicate anchors result in invalid HTML; you can check for duplicate anchors by running the page through the W3C Markup Validation Service.
  • Anchor links are case-sensitive in some browsers, so treat all anchor links as case-sensitive when creating links to them. For example, if you create the anchor with === Baz{{subst:anchor|Bar}} ===, link to it with [[pagename#Bar]], not [[pagename#bAR]]. However, because some browsers are not case-sensitive, do not create section titles or anchors that differ only in case from others on the page. That is, do not create both === Abcd{{subst:anchor|Baz}} === and === Efgh{{subst:anchor|bAZ}} ===.
  • If a template is left unsubstituted inside a section title (which should never be done), then the template code will appear in the edit summary window each time a section edit of that section begins, as in /* Limitations{{anchor|Issues}} */ New issue. The editor must manually remove the anchor template from the edit summary window, or else when they save the section, the browser may not return to the section and the section link of that edit in the history page won't work.

Calling up the section #Section one

Calling up the section #Section two