Category:Harv and Sfn template errors

This category holds articles that use any of the short-cite templates ({{harv}} and {{sfn}} template families, and {{harvc}}) where one or more of those short-cite templates do not properly link to a full citation, the target, or where multiple full cites can be the target of a single short-cite template.

Due to technical limitations, this category contains many articles with false-positive errors. Error messages are hidden by default. Several options to view error messages are detailed below, as well as possible ways to resolve errors.

Displaying error messages[]

Currently, three user scripts reliably detect errors

as well as a fourth experimental method based on customizing a .css page. The three methods are

Method 1 – Automatic script installation
Go in the 'Gadgets' tab of your preferences and select the 'Install scripts without having to JavaScript files' option at the bottom of the 'Editing' section.
Click on the 'Install' button in at the top of either User:Svick/HarvErrors.js, User:Ucucha/HarvErrors or User:Trappist the monk/HarvErrors.js
Method 2 – Manual script installation
Go to Special:MyPage/common.js and add any of
importScript('User:Svick/HarvErrors.js'); // Backlink: [[User:Svick/HarvErrors.js]]
importScript('User:Ucucha/HarvErrors.js'); // Backlink: [[User:Ucucha/HarvErrors.js]]
importScript('User:Trappist the monk/HarvErrors.js'); // Backlink: [[User:Trappist the monk/HarvErrors.js]]
in your skin page, like this. Alternatively, you can go to Special:MyPage/skin.js to make the script apply only to your current skin.
Method 3 – .css code for error messages emitted by the short-cite templates
Error messages are emitted by the various short-cite templates via Module:Footnotes and Module:Harvc. Because of technical limitations, the modules can emit false-positive error messages along with valid error messages. For this reason, all error messages are hidden by default. To show these hidden error messages, include the following text in your common.css page or your specific skin.css page:
.harv-error {display: inline !important;} /* display Module:Footnotes errors */
Error message display may be enabled in the future.

Error messages[]

If short-cite template error messages are enabled, ors can see these messages:

Similar (although not identical) messages are emitted by the user scripts. See the script documentation.

Resolving errors[]

Ways of resolving legitimate no target errors include:

Ways of resolving multiple targets errors include:

No advice is given for resolving false-positive errors.

Current limitations and false-positive errors[]

Brief explanation[]

When a short-cite template links to a full citation that is rendered by a template that wraps a CS1 template, like {{cite DNB}} (which wraps {{cite encyclopedia}}), a no target error may be displayed even when the short-cite template is valid and the link works. That is a "false positive" error. If you find what looks like a false positive error, please report it on the talk page for this category, and another or will either fix the article or add the template in question to Module:Footnotes/whitelist.

Details[]

The short-cite templates employ an article reader to read the article's raw wikitext (the same text that you see in the source or's window). While reading the wikitext, the article reader looks for a variety of templates that can create anchor IDs. For each such template found, the article reader attempts to extract the necessary information to create an image of the template's anchor ID, if it would produce one. For cs1|2, the most common long-form citation templates, depending on the state of |ref= the article reader looks for:

The article reader extracts similar information from other templates as appropriate for those templates.

Each image of a long-form citation anchor ID is saved in a list along with a tally indicating how many of that image the article reader found. When the short-cite template renders its output, it looks for its target anchor ID in the anchor-ID list:

The no target errors may be true errors or may be false-positive errors. For true errors, there is no anchor ID in the article to match the anchor ID expected by the short-cite template. A false-positive error occurs because the article reader can only read the article's raw wikitext, it cannot burrow into wrapper templates. Wrapper templates enclose the template that creates the anchor ID. This enclosure hides the necessary details so the article reader cannot create an image of that wrapper template's anchor ID. For example, {{cite DNB}} is a wrapper template that encloses {{cite encyclopedia}}. The values assigned to the {{cite DNB}} parameters |year= and |supplement= tell {{Cite DNB}} how to set or names and date in its call to the enclosed {{cite encyclopedia}} which uses them to create the wrapper template's anchor ID. When a wrapped template creates a matching anchor ID that the article reader cannot see; the link from short-cite to long-form citation works but is marked with a no target false-positive error message.