Template talk:Harvard citation documentation#duplicate inclusion problem

Why are these two pages kept?

Why are there two pages such as Template:Harvard citation/doc and Template:Harvard citation documentation? Is there some decision to keep these two separate that I am not aware of? --Stultiwikiatext me 18:49, 6 May 2011 (UTC)

:Template:Harvard citation documentation is transcluded by Template:Harvard citation/doc, Template:Harvard citation no brackets/doc, Template:Harvard citation text/doc, Template:Sfn/doc, Template:Harvcol/doc, Template:Harvcolnb/doc and Template:Harvcoltxt/doc. All of these templates are versions of each other, and the documentation applies to all seven. ---- CharlesGillingham (talk) 00:21, 7 May 2011 (UTC)

Cite report / cite thesis

{{tl|Cite report}} and {{tl|Cite thesis}} now support {{para|ref}}. ---— Gadget850 (Ed) talk 09:09, 4 April 2012 (UTC)

Use of letters with dates

The documentation was recently changed to forbid the use of letters with dates (e.g. Smith 1999a) on the grounds that it messed up the COinS metadata. This convention is widely used, both in Wikipedia and elsewhere, and I don't think advice here should be changed without proper discussion. A much better solution seems to me to change the generation of metadata. The alternative of fuller dates is not always possible, e.g. in the case of two papers by the same author(s) in the same issue of a journal, or two chapters by the same author(s) in the same book. Peter coxhead (talk) 15:47, 16 October 2013 (UTC)

:Perhaps a more careful review of the change I made is in order? The only prohibition of letter suffixes in my change was to the value of {{para|date}} or {{para|year}} when used without {{para|date}} because such use does, in fact, corrupt the COinS metadata. Suffixing the {{para|date}} value in the absence of {{para|year}} produces an incorrect CITEREF anchor. I agree that the best solution to the issue is to fix the code that generates the metadata and to fix the code that creates the anchors. However, until I or some other editor can make such changes, Wikipedia should not be generating corrupt metadata and for our readers should create correct anchors to support short-form referencing with {{tlx|sfn}} and the {{tlx|harv}} family of templates.

:A step along that path is to adjust the documentation so that editors correctly use the CS1 templates as they are currently implemented.

:This citation:

::{{cite book |title=Title |last=Last |date=16 October 2013a |ref=harv}}

:produces this output:

::{{code |1={{cite book |title=Title |last=Last |date=16 October 2013a |ref=harv}}}}

:Notice that the anchor is CITEREFLast2013 not CITEREFLast2013a as one might expect. In the metadata you can see that the date is corrupted: &rft.date=16+October+2013a. But, this citation:

::{{cite book |title=Title |last=Last |date=16 October 2013 |year=2013a |ref=harv}}

:produces this output where both the anchor and the metadata are correct:

::{{code |1={{cite book |title=Title |last=Last |date=16 October 2013 |year=2013a |ref=harv}}}}

:Please take the time to carefully review the change I made and explain how it does not accurately reflect current CS1 template operation. Or, propose an alternate version.

:—Trappist the monk (talk) 16:33, 16 October 2013 (UTC)

::I accept that it's quite possible that I misunderstood your change, but I think it would have been useful to flag that change here, on the talk page, in parallel to making it. Edit summaries are too brief for this purpose for templates such as this which are complex to use. I really didn't find your revised documentation clear – which, as I say, may well be my fault.

::If you revert my reversion, I will at least now be able to raise any issues here.

::You say above {{tq|The only prohibition of letter suffixes in my change was to the value of {{para|date}} or {{para|year}} when used without {{para|date}}}}. Sorry, but I still don't understand. It's surely quite ok to have a letter suffix to a {{mono|year}} parameter when used without a {{mono|date}} parameter. Peter coxhead (talk) 17:46, 16 October 2013 (UTC)

:::Can you identify those parts of the change that aren't clear? What improvements would you make?

:::This citation:

::::{{cite book |title=Title |last=Last |year=2013a |ref=harv}}

:::produces this output which has the correct anchor but corrupted metadata:

::::{{code |1={{cite book |title=Title |last=Last |year=2013a |ref=harv}}}}

:::So, what I said is, I think, true. If you need to disambiguate a citation, you must use both {{para|date}} and {{para|year}} where {{para|year}} has the disambiguation suffix.

:::—Trappist the monk (talk) 19:15, 16 October 2013 (UTC)

::::So the correct usage in this case is what? The following?

:::::{{cite book |title=Title |last=Last |year=2013a |date=2013 |ref=harv}}

::::If so, then it's easy in Lua to detect a year with a letter following and no {{mono|date}} parameter and simply supply the missing {{para|date}}. Why require an editor to do this manually? What about all the existing uses of citations with a suffixed year but not date? Peter coxhead (talk) 21:27, 16 October 2013 (UTC)

:::::Yes, that is the correct form for disambiguated citations.

:::::Fine questions, those. If you want to have a go at the date issue then Module:Citation/CS1/sandbox. There are still several CS1 citation types that have not yet migrated to Lua so any fix to the Lua code won't change how they work until they are upgraded.

:::::I'm not sure what action should be taken with regard to existing citations with suffixed {{para|year}} values. Certainly these could be detected, messaged, and categorized much as we do with other anomalous parameters. Once categorized, a robot could be produced that would fix the problem citations.

:::::I think that the documentation should describe current operation regardless of what we expect from the tools in future.

:::::No suggestions for improvements to the documentation?

:::::—Trappist the monk (talk) 23:00, 16 October 2013 (UTC)

::::::Ok, I think my problem with what you wrote was that I was implicitly assuming that what you've explained above couldn't be the case – I've used suffixed letters in the past apparently successfully – so I didn't understand it. I've restored your text and prefaced it by an explanation that it's a work-around for a current bug which I hope makes it clearer.

::::::Since you understand the problem better than I do – I'm just a user here – I suggest you ask the Lua experts for a fix. Peter coxhead (talk) 13:06, 17 October 2013 (UTC)

:::::::Please see Module_talk:Citation/CS1#Date_checking. Comments and opinions solicited.

:::::::—Trappist the monk (talk) 14:59, 22 October 2013 (UTC)

duplicate inclusion problem

{{u|Martin of Sheffield}} Please see [https://en.wikipedia.org/w/index.php?title=Wikipedia:Village_pump_%28technical%29&oldid=690751719#Template_sfn], and update the documentation so the next editor baffled by mysterious big red citations warnings on a page has a clue as to how to fix them. NE Ent 14:33, 15 November 2015 (UTC)

: George Orwell III has already responded at the pump. Please note how he emphasises the missing "p". I'll review the {{tl|sfn}} documentation, but IIRC it does cover the correct use of "p" and "pp" in once section. Martin of Sheffield (talk) 14:38, 15 November 2015 (UTC)

::I reviewed the documentation when faced with error messages on Paris but didn't find anything I considered helpful for resolving the problem, so anything you could do to help editors faced with similar messages in the future will be appreciated. NE Ent 15:09, 15 November 2015 (UTC)

:::I've added a short warning to the parameters section and mentioned cite errors. Will this help? Martin of Sheffield (talk) 22:31, 15 November 2015 (UTC)

::::Great, thanks! NE Ent 22:50, 15 November 2015 (UTC)

Prospective work

In case anyone is interested: I have been trying to straighten out some of this documentation so it won't be so confusing. There may be points of inconsistency with some of the existing documentation, but the latter is so confusing as it is that it probably doesn't matter. At some point the sfn documentation should be separated from the harv documentation (sfn harv!), there's no telling when I can get to that. ♦ J. Johnson (JJ) (talk) 23:06, 11 September 2019 (UTC)

:{{tlx|sfn}} is essentially {{tlx|harvnb}} wrapped in {{tag|ref|params=name="x"}} where "x" is generated automatically based upon the supplied parameters. They are very closely related. --Redrose64 🌹 (talk) 18:32, 12 September 2019 (UTC)

::Correct. But despite being very closely related, there is a difference in their use, which confuses the explanation of how to use them. (Which is confused enough as it is.) As all (?) of the sfn effects are derived from some form of harv, it would be simpler to describe the the basic form of each harv template, then show the corresponding sfn usages. And explain the more esoteric uses in a later section. ♦ J. Johnson (JJ) (talk) 20:23, 12 September 2019 (UTC)

:::That sounds a much better idea than separating the sfn documentation from the harv documentation. Martin of Sheffield (talk) 21:15, 12 September 2019 (UTC)

::::I think a case could be made for splitting this into separate pages, but that is beyond what I contemplate. I think the descriptions of each ought to be teased apart, and perhaps the entire page reorganized, but for now and any time soon I'm just trying to resolve the more troubling sources of confusion. ♦ J. Johnson (JJ) (talk) 21:45, 12 September 2019 (UTC)

Name suffixes

What's the best way to handle name suffixes in this citation style (i.e., II, Jr.)? czar 22:48, 7 December 2019 (UTC)

:Because Harvard referencing uses surnames and dates and because MOS:JR places family rank after given name when surname leads given name, perhaps there is nothing to do. So:

::{{cite book |last=Black |first=A Jr |last2=Green |first2=R III |title=Title |date=2019 |ref=harv}}

:::{{cite book |last=Black |first=A Jr |last2=Green |first2=R III |title=Title |date=2019 |ref=harv}}

::{{harvnb|Black|Green|2019}}

:::{{harvnb|Black|Green|2019}}

:—Trappist the monk (talk) 00:20, 8 December 2019 (UTC)

I recall this working at DVT years ago, but it doesn't anymore

Hello. I am working on improving deep vein thrombosis, and I recall previously having CITEREF functionality in there but it isn't working any longer. The article has Guyatt et al. 2012 33 times within the article but those links don't work to bring the reader down to the Guyatt reference, which is located in the "Cited literature" subsection at the bottom of the References section. Any advice? I spent some time trying to figure it out myself, but I imagine a kind soul here will quickly know the answer and I can instead use my time to improve the article. Thanks. Biosthmors (talk) 17:38, 30 December 2019 (UTC)

Ping to User:Trappist the monk. Thanks in advance if you can assist. Best wishes. Biosthmors (talk) 17:39, 30 December 2019 (UTC)

:Because there are multiple authors:

::{{cite journal | vauthors = Guyatt GH, Akl EA, Crowther M, Gutterman DD, Schuünemann HJ | title = Executive summary: Antithrombotic Therapy and Prevention of Thrombosis, 9th ed: American College of Chest Physicians Evidence-Based Clinical Practice Guidelines | journal = Chest | volume = 141 | issue = 2 Suppl | pages = 7S–47S | date = February 2012 | pmid = 22315257 | pmc = 3278060 | doi = 10.1378/chest.1412S3 | ref = harv | author1link = Gordon Guyatt | displayauthors = 3 }}

:::{{cite journal | vauthors = Guyatt GH, Akl EA, Crowther M, Gutterman DD, Schuünemann HJ | title = Executive summary: Antithrombotic Therapy and Prevention of Thrombosis, 9th ed: American College of Chest Physicians Evidence-Based Clinical Practice Guidelines | journal = Chest | volume = 141 | issue = 2 Suppl | pages = 7S–47S | date = February 2012 | pmid = 22315257 | pmc = 3278060 | doi = 10.1378/chest.1412S3 | ref = harv | author1link = Gordon Guyatt | displayauthors = 3 }}

:The template expects #CITEREFGuyattAklCrowtherGutterman2012.

:

:To retain the wikilink for the article uses you must match what the template expects so:

::Guyatt et al. 2012Guyatt et al. 2012

:Alternately you can change {{para|ref|harv}} to {{para|ref|{{sfnref|Guyatt2012}}}}:

::{{cite journal | vauthors = Guyatt GH, Akl EA, Crowther M, Gutterman DD, Schuünemann HJ | title = Executive summary: Antithrombotic Therapy and Prevention of Thrombosis, 9th ed: American College of Chest Physicians Evidence-Based Clinical Practice Guidelines | journal = Chest | volume = 141 | issue = 2 Suppl | pages = 7S–47S | date = February 2012 | pmid = 22315257 | pmc = 3278060 | doi = 10.1378/chest.1412S3 |ref={{sfnref|Guyatt2012}} | author1link = Gordon Guyatt | displayauthors = 3 }}

:::{{cite journal | vauthors = Guyatt GH, Akl EA, Crowther M, Gutterman DD, Schuünemann HJ | title = Executive summary: Antithrombotic Therapy and Prevention of Thrombosis, 9th ed: American College of Chest Physicians Evidence-Based Clinical Practice Guidelines | journal = Chest | volume = 141 | issue = 2 Suppl | pages = 7S–47S | date = February 2012 | pmid = 22315257 | pmc = 3278060 | doi = 10.1378/chest.1412S3 |ref={{sfnref|Guyatt2012}} | author1link = Gordon Guyatt | displayauthors = 3 }}

:so:

::Guyatt et al. 2012Guyatt et al. 2012

:Alternately, you can convert Guyatt et al. 2012 to {{tlx|sfn}} ...

:—Trappist the monk (talk) 17:57, 30 December 2019 (UTC)

::I have fixed it thanks to your help!! Many thanks! Best wishes. Biosthmors (talk) 18:15, 30 December 2019 (UTC)

Removed some duplicate material.

I have WP:BOLDly removed some redundant material from the first section of the article. The issues discussed in these paragraphs are already covered in the Possible issues section down at the bottom of the article, specifically the sections More than four authors and No last name in citation template.

It would be a good idea if someone took a look at the material I deleted and compared it to the sections at the bottom -- perhaps the deleted material should be incorporated in some way.

I imagine that the deleted material was added by someone who didn't notice that these issues were already covered. I would support anyone who wishes to rearrange the page to make it easier for readers to find what they need. ---- CharlesGillingham (talk) 17:40, 20 April 2021 (UTC)

Suppressing no-target errors with ExpandTemplates

I was trying to fix my harv no-target errors while testing my changes in Special:ExpandTemplates, and although all the linkages worked, nothing got rid of the no-target errors, and I tried everything. Finally, I tried pasting the identical code into my sandbox, and the errors went away. As a result, I added the following to section {{slink|{{ARTICLEPAGENAME}}|Link works but displays a no target error|nopage=yes}} in this edit:

: {{talk quote|If you are testing changes in Special:ExpandTemplates and the error message cannot be suppressed, try testing in a sandbox or user subpage instead.}}

I don't know why Special:ExpandTemplates appears to be more prone to non-suppressible no-target errors, but I'd like to understand, and perhaps expand or re-word the recent edit to that doc page section accordingly. {{u|Trappist the monk}}, can you offer any insight into this? If there are other sfn/harv-related issues that might be best not tested in Special:ExpandTemplates, I'd like to know about those, too, and perhaps add it to the doc as well. Thanks, Mathglot (talk) 20:07, 18 August 2023 (UTC)

:At Module:Footnotes/anchor id list line 110 the module fetches the current article's wikitext. It does that so that it can read each citation-like template that it can find to extract authors and dates from which it constructs a list of CITEREF anchor IDs. When the current short-form reference's CITEREF anchor ID doesn't match one of the constructed CITEREF anchor IDs, the module emits the {{color|#d33|no target}} error message. Special:ExpandTemplates does not have article wikitext so there is nothing for the module to read. The module then attempts to find a match for the short-form reference's CITEREF anchor ID in an empty list of constructed CITEREF anchor IDs. Because empty list there is no match so the module emits the {{color|#d33|no target}} error message.

:—Trappist the monk (talk) 21:43, 18 August 2023 (UTC)

:: Trappist the monk, thanks. I should have been clearer: in my testing of a {{tl|harvc}} example in Special:ExpandTemplates, there is wikitext that does match up, but generates no-target errors anyway—but *only* in ExpandTemplates. For example: in this sandbox subpage, everything works properly, from {{tl|sfn}} to {{tl|harvc}} to {{tl|cite journal}}—all working: highlighting, linkage, everything; and there are no extraneous no-target errors: User:Mathglot/sandbox/citec. If you paste the whole thing into Special:ExpandTemplates (or just transclude it as {{((}}User:Mathglot/sandbox/citec{{))}}{{hairspace}}), it will generate seven no-target errors. But in my sandbox, it doesn't generate any errors. I don't understand that difference in behavior. Mathglot (talk) 03:35, 19 August 2023 (UTC)

:::I understood what you were saying. In answer, I'll repeat myself: {{tq|Special:ExpandTemplates does not have article wikitext so there is nothing for the module to read.}} When run against Special:ExpandTemplates the call to mw.title.getCurrentTitle():getContent() (line 110) returns nil. When that happens, the variable Article_content is assigned the value of 'empty string'. Because Article_content is an empty string, there is nothing for the module to evaluate so it cannot compile a list of CITEREF anchor IDs.

:::

:::If you preview your sandbox, at the bottom of that page is a collapse 'Parser profiling data'. Click that. In the table that is displayed is a section called 'Lua logs' Click Show. That will give you a list of CITEREF anchor IDs that the module found, a list of the templates in the article, and the content of {{tlx|sfn whitelist}} if present. These lists are not created when the module runs against Special:ExpandTemplates.

:::—Trappist the monk (talk) 12:00, 19 August 2023 (UTC)

:::: Thanks again. So, the message I added to the doc page about Special:ExpandTemplates is valid; feel free to modify the wording as you see fit. Mathglot (talk) 17:27, 19 August 2023 (UTC)

::::: Or, if it's due to the Module not detecting that, and nothing to do with the script, maybe the module should be adjusted to detect that case, and the script needn't have any special mention of it, once that happens. (Related discussion here.) Mathglot (talk) 20:37, 19 August 2023 (UTC)

::::::This is a limitation of the software, like the whole false positive issue there is no current solution to the problem. So yes your addition to the documentation is correct. -- LCU ActivelyDisinterested transmissions °co-ords° 00:08, 20 August 2023 (UTC)

Two names no date

{{Reply to|Michael Bednarek}} Edit this reference to see it working {{harv|Lane|Singh}}.

{{Cite book | last1 = Lane | last2 = Singh | title = Demo Citation}} 2600:100F:B1BC:853F:0:B:15FC:9601 (talk) 07:42, 9 October 2023 (UTC)

:Sorry, my mistake, but I have vivid memories of sfn and harv output like (Lane & 1997). -- Michael Bednarek (talk) 07:53, 9 October 2023 (UTC)

::It's all good. Maybe from the old version or from odd dates like {{harv|Lane|Sept. 1997|ignore-err=yes}}. 2600:100F:B1BC:853F:0:B:15FC:9601 (talk) 08:59, 9 October 2023 (UTC)

Use of param 'loc' for quotations

A discussion is taking place at Template talk:Sfn regarding the use of sfn param {{para|loc}} for quotations. Mathglot (talk) 22:03, 19 November 2023 (UTC)