Jump to content
 







Main menu
   


Navigation  



Main page
Contents
Current events
Random article
About Wikipedia
Contact us
Donate
 




Contribute  



Help
Learn to edit
Community portal
Recent changes
Upload file
 








Search  

































Create account

Log in
 









Create account
 Log in
 




Pages for logged out editors learn more  



Contributions
Talk
 



















Contents

   



(Top)
 


1 Types of anchors  





2 In-text reference templates that create links to anchors  





3 Citation templates that create anchors  





4 Date and year fields  





5 Custom anchors  





6 Link and anchor names  





7 Manual links to citation anchors  





8 Duplicate in-text links  





9 Duplicate anchors  





10 Templates without anchors  














Wikipedia:Citation templates and reference anchors







Add links
 









Project page
Talk
 

















Read
Edit
View history
 








Tools
   


Actions  



Read
Edit
View history
 




General  



What links here
Related changes
Upload file
Special pages
Permanent link
Page information
Get shortened URL
Download QR code
 




Print/export  



Download as PDF
Printable version
 
















Appearance
   

 






From Wikipedia, the free encyclopedia
 


Citation templates are often used to format the citations that show in the reference list. Many of these templates can create anchors that allow links from reference templates that are placed in-text with the content to the full citation in the reference list. These links are a convenience and are not a requirement; the use of reference and citation templates is also not required.

The in-text links are formatted manually or automatically as #CITEREF normally followed by the author name(s) and the year of publication. The citation template then creates an anchor using an HTML id manually or automatically formatted as CITEREF followed by the author last name(s) and the year. For citations without an author, the anchor can be customized.

Anchor support across citation templates is not standardized, and not all templates support anchors.

This page discusses only general citation templates and does not include any of the hundreds of specific-source templates. See Category:Specific-source templates, although many of these may be in Category:Citation templates or not properly categorized. Many specific-source templates use a general citation template as a meta-template.

Types of anchors[edit]

Anchor types can be combined. For example, a template could create a CITEREF auto anchor.

In-text reference templates that create links to anchors[edit]

These templates always create a link of the form #CITEREF plus the author last names (up to four) plus the year.

setting |Ref= will create a custom link.

When a custom link is needed, the first author field can be replaced by the desired text.

Citation templates that create anchors[edit]

These templates always create a CITEREF auto anchor; setting |ref= will create a custom plain anchor.
These citation templates create a plain custom anchor when |ref= is set or a CITEREF custom anchor when |harvid= is set.
These citation templates create a plain custom anchor when |ref= is set or a Reference- custom anchor when |id= is set.
These citation templates create a plain custom anchor when |ref= is set.
These citation templates do not support anchors.

Date and year fields[edit]

Most of the templates will attempt to extract the year from the date field. If the date consists of anything other than a full date then the year extraction will fail. Most templates include a month field that can be used in conjunction with the year field.

Custom anchors[edit]

Custom anchors must be used when the template does not support auto anchors or when there is no author. The name of the website or organization can be used in place of the author name. Custom anchors can be crafted manually or with {{SfnRef}} / {{harvid}}.

Link and anchor names[edit]

Manually created names should start with CITEREF. If you choose to not do this, then the first character must begin with a letter A-Z or a-z. All names are case sensitive. HTML ids have other name rules, but the MediaWiki software automatically encodes spaces to underlines and Unicode characters to their equivalent hexadecimal characters.

Manual links to citation anchors[edit]

To avoid the sometimes difficult-to-remember syntax for manual links to CITEREF anchors, {{citeref}} can be used to create internal wikilinks with either small superscript-style labels (like this[n]) or plain free-text labels to such anchors. It can be used inside of other citations. In addition, {{citelink}} and {{remoteref}} can also create internal wikilinks, and may also be used to create wikilinks to other pages, such as linking to a CITEREF anchor from the article Talk page (or from any page, like this[1]), or to an anchor in a foreign Wikipedia article (like this[2]) and may also be used inside another citation.

Duplicate in-text links[edit]

Multiple instances of the same in-text link may be used to link to one citation in the reference list, and the in-text links can use the same name.

Duplicate anchors[edit]

The anchor name for each citation must be unique. Multiple instances of the same anchor will create ambiguous links and will cause invalid HTML output of the page. There is no automatic error checking. The W3C Validation Service can be used to check for duplicate HTML ids.

Where the same author has multiple publications within the same year, the citation template will create a duplicate anchor. The standard solution is to add a lower case alpha character to the year.

Templates without anchors[edit]

{{Wikicite}} can be used to add an anchor for any of the templates that do not support anchors. The |ref= field is used to create the anchor and the |reference= field is set to the citation template. The |ref= field should be enclosed in quotes and can be defined with {{SfnRef}}.


Retrieved from "https://en.wikipedia.org/w/index.php?title=Wikipedia:Citation_templates_and_reference_anchors&oldid=1189473443"

Category: 
Citation templates
Hidden category: 
Wikipedia citation administration
 



This page was last edited on 12 December 2023, at 01:58 (UTC).

Text is available under the Creative Commons Attribution-ShareAlike License 4.0; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy. Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc., a non-profit organization.



Privacy policy

About Wikipedia

Disclaimers

Contact Wikipedia

Code of Conduct

Developers

Statistics

Cookie statement

Mobile view



Wikimedia Foundation
Powered by MediaWiki