Jump to content

Wikipedia talk:Citing sources/Example edits for different methods

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Wtmitchell (talk | contribs) at 08:12, 15 March 2010 (Cleaning up broken handcrafted cites: What to do, if anything (??)). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

The Shortened notes with wikilinks section of this sub-article may need to be revised. See the discussion at Template talk:Citation#HTML cite element. I add parenthetically that this is one example of a good argument for using templated cites rather than resorting to hand-coded HTML. It looks like someone may need to code up a WP:bot to root out hand-coded HTML cite element usage which is noncompliant with HTML 5. -- Boracay Bill (talk) 01:06, 6 January 2009 (UTC)[reply]

Excellent

This is an excellent detailed review of how use in practice multiple different citation methods. I commend the authors on their thoroughness. --User:Ceyockey (talk to me) 05:14, 3 January 2010 (UTC)[reply]

I'm wondering: is it necessary to have so many different citation methods? I'm confused as to why Wikipedia hasn't decided on one and made it standard. I'm not sure which to use. I'm going with the short footnote and full reference; seems simplest.--TheSoundAndTheFury (talk) 14:57, 17 February 2010 (UTC)[reply]

Planned edits

Simplification of rendering

When this project page initially appeared (kudos to SallyScot), the rendering was dummied-up because of a cite.php bug which existed at the time. That bug has since been fixed. Therefore, unless someone sees a good reason not to do this, I plan to edit this page so that the rendering is done directly by echoing the associated example wikitext. I've done a test-run of this here for interested editors to take a look at. Comments? Wtmitchell (talk) (earlier Boracay Bill) 03:56, 18 February 2010 (UTC)[reply]

There having been neither comment here nor intervening edits to the project page, I've moved my test-run edit mentioned above into place. Wtmitchell (talk) (earlier Boracay Bill) 00:39, 21 February 2010 (UTC)[reply]

Expansion

I've long thought that the examples could use expansion to illustrate some techniques for handling complications which impact Refs in general. Looking at the example text, I see that the initial sentence of the final paragraph has no Ref. The full cite for (Kummer 2003) just cites a single chapter of that book. The Ref for that is named but is not reused, The cited chapter has material on page 152 which relates to that presently unsourced sentence.

I'm thinking of changing that initial sentence to agree more closely with (Kummer 2003:152), and using that to illustrate some things. Here's what I now think I'll do:

  • in the first Shortened notes example, just re-use the Ref named Kummer2003 at the end of that sentence, and probably add some explanatory text about that.
  • in the rest of the Shortened notes examples, don't reuse the ref, but make it two separate refs, the first giving a page number range for the cited chapter and the second citing p.152. The full cite would appear in the first Ref, and the second Ref would link back to that.
  • in the Full references examples, the added ref would render as "Op. cit. Kummer 2003, p. 152", and would link to the full citation in footnote No. 1.

Also, I'm thinking of moving the the Shortened footnotes examples below the Full References examples, and pointing out that using shortened footnotes allows editors to control the ordering of the citations.

Comments? Wtmitchell (talk) (earlier Boracay Bill) 03:56, 18 February 2010 (UTC)[reply]

 Done Wtmitchell (talk) (earlier Boracay Bill) 03:08, 21 February 2010 (UTC)[reply]

Highlighting

This is actually part of what should be a larger discussion and probably in a different venue, but I'm starting here with this particular bit because it has immediate relevance here.

Note in the Shortened notes with wikilinks section of the project page, the highlighting of cites has been broken; it still works in the Shortened notes with {{Harvnb}} and {{Citation}} links section. This is because the rules have changed, and the hand-coded cite examples have not (yet) caught up with the changes in the rules. This apparently was broken at some time for templated cites as well, but was fixed with this edit to {{Citation/core}}. I haven't found the discussion leading up to that and, as I'm on the road using internet cafes at present, I'm not going to pursue that now; however, see discussions here and here for some apparently related background.

As a somewhat separate but apparently related matter, I note the comment in this Mediawiki talk page edit, "That article is using raw HTML, which it really shouldn't. We have {{Ref}} and {{cite}} for a reason. One of those reasons, is that <cite> is actually an incorrectly used here, considering it's latest HTML5 definition. We use {{Ref}} in order to be able to change such things." I'm not sure how correct that is re {{Ref}} and {{Cite}}, but I take the point that if such things as <cite id="Ritter2002">...</cite> vs. <span class="citation" id="Ritter2002">...</span> were done via a template rather than with raw html, such changes could be easily done via a template edit vs. finding and fixing all the raw html in articles which the changes broke.

So—what now? I'd say fix the raw html in the project page for this article for now and, unless the proper long-term fix is more obvious to someone else than it is to me at this moment, get a discussion started about how such things ought to be done long-term. Separately, something needs to be done to find and fix all the raw html hiliting which this change in the rules broke.

As a sidebar, harking back to the prior mention of {{Ref}} and {{cite}}, I'll mention here that it seems to me that there should be a way to hilite the notes associated with {{Rref}}'d {{cite}}s. Wtmitchell (talk) (earlier Boracay Bill) 21:14, 6 March 2010 (UTC)[reply]

For templated citations it was never broken, they initiated the change actually. It was discussed here. Implemented and then 30days later executed. ATM only elements under <references /> are highlighted it seems. The discussion on how to proceed with that is here: MediaWiki_talk:Common.css#Coloring_of_the_cited_source_missing. —TheDJ (talkcontribs) 13:56, 8 March 2010 (UTC)[reply]
The mention of {{Ref}} confused me there. I repeated the mention of {{Cite}}, but I actually had in mind {{Note}}, which is the companion to {{Ref}}, as in the following from Template:Ref/doc:
*Text that requires a footnote.{{ref|1|1}}
==Notes==
:1.{{note|1}}Body of the footnote.
Rendering
  • Text that requires a footnote.1
Notes
1.^ Body of the footnote.
This is often used to footnote tables; note that the referenced note is not highlighted when it is accessed via the link provided by the {{Ref}}.
I see that {{Harv}} family templates and {{Citation}} (which is aliased as {{Cite}}) highlight linked cites as follows:
{{Harv|Authorsurname1|Year}}
==References==
*{{Citation|last=Authorsurname1|year=Year|title=Title|publisher=Publisher}}
Rendering

(Authorsurname1 & Year)

References
  • Authorsurname1 (Year), Title, Publisher {{citation}}: Check date values in: |year= (help)CS1 maint: numeric names: authors list (link) CS1 maint: year (link)
This is (currently) accomplished by placing the cites in a span with class="citation".
hand-crafted cites could be highlighted, then, as follows:
*([[#Authorsurname2Year|Authorsurname2 Year]])
;Reference
*<span class="citation" id=Authorsurname2Year>Authorsurname2 (Year), ''Title'', Publisher</span>
Rendering
Reference
  • Authorsurname2 (Year), Title, Publisher
I've been thinking that it might be useful to offer a new template named, perhaps, {{span idclass}}. Such a template would require an id= parameter and would place the content of its required first unnamed parameter into a span with class "citation" by default or into whatever other class might be specified by an optional class= parameter.
At some point, work needs to be done to fix all the now-broken hand-crafted cites which use the now deprecated <cite id=whatever>...</cite> raw HTML coding now in existing articles. It might be better to wrap those cites in such a template rather than to replace that now-deprecated HTML idiom with more raw HTML.
That would allow the optional prettification of the above hand-crafted example by hiding the raw html in a template, and would perhaps provide a way to modify the {{note}} template to highlight its notes when they are accessed. I'm currently traveling and doing WP stuff from internet cafes, and I haven't actually tried working out the details of that.
What do you think? Wtmitchell (talk) (earlier Boracay Bill) 01:11, 9 March 2010 (UTC)[reply]

<span class="citation" id=AuthorsurnameYear>, rather than <cite id=refAuthorsurnameYear>, sounds like it's a more proper way of achieving highlighted linking from shortened notes to freehand citations, and a new {{span idclass}} template might be an option too. But note however that there aren't any shortened notes linking to freehand citations included on the project page.

For the examples of shortened notes linking to cite xxx templates that we have, I'd suggest the neater option of changing these to show usage of the ref=ID parameter, which creates the HTML anchor containing that ID (i.e. ref=AuthorsurnameYear).

--SallyScot (talk) 23:08, 9 March 2010 (UTC)[reply]

I've successfully used the <span></span> method with {{SfnRef}} (or its alias {{harvid}}) on several articles, see Reading Southern railway station where we have:
*<span id={{SfnRef|Conolly|1976}} class=citation>{{cite map |... |year=1976 |cartography=W. Philip Conolly |... }}</span>
This allows the cobstruction of shortened footnotes without special constructs; either
{{sfn|Conolly|1976|loc=p. 4, section A2}}
or
<ref>{{harvnb|Conolly|1976|loc=p. 4, section A2}}</ref>
works with this. Does anybody know a method by which I might hunt down the places where I used the older method <cite id=xxx>...</cite> so that they may be amended? --Redrose64 (talk) 13:02, 10 March 2010 (UTC)[reply]
Hi SallyScot. For shortened notes linking to freehand citations on the project page, see Wikipedia:Citing sources/Example edits for different methods#Shortened notes with wikilinks. Since all three of the "Shortened notes linking to ..." examples are supposed to produce the same rendering, only one of the examples is rendered, and that happens to be one of the templated examples. The "Shortened notes with wikilinks" example uses <cite id=refAuthorsurnameYear>...</cite>, for which the rendering of highlighting when accessed is now broken. I haven't fixed this because this discussion about how it ought to be fixed (raw HTML in the article wikitext vs. wrapping the details of the raw HTML in a template) is still ongoing. I don't know how to hunt down occurrences of particular unrendered wikitext (e.g., raw HTML idioms) in articles. —Preceding unsigned comment added by Wtmitchell (talkcontribs) 08:58, 11 March 2010

Before we start writing new templates, I've found that {{wikicite}} may already provide most of the required action. The wikicode

{{wikicite |id=refDoe2010 |reference=Doe, John (2010) ''A fictional account'' }}

is exactly equivalent to:

<span class="citation wikicite" id="Reference-refDoe2010">Doe, John (2010) ''A fictional account''</span>

and the |reference= parameter may be fed with one of the citation templates which does not have a |ref= parameter, such as {{cite map}}. --Redrose64 (talk) 11:16, 11 March 2010 (UTC)[reply]

OK. I tried it below.
The above highlight the accessed cites as expected when they are accessed via a hand-coded wikilink or a Harv family template with a Ref= parameter matching the reference= parameter of the wikicite. No need for a new template like {{span idclass}}. Here's the wikicite-produced cite:
  • {{wikicite |id=refDoe2010 |reference=Doe, John (2010), ''A fictional account'' }} produces: Doe, John (2010), A fictional account
So, can we arrive at a consensus that the project page should show hand-coded cites wrapped in {{wikicite}}s? Wtmitchell (talk) (earlier Boracay Bill) 01:57, 13 March 2010 (UTC)[reply]

If nobody objects, I'll redo the project page to wrap hand-crafted cites in {{wikicite}}s in a day or two. Also, re hunting down occurrances of "<cite id=...", see WP:VPT#Searching for unrendered wikitext. Wtmitchell (talk) (earlier Boracay Bill) 02:26, 14 March 2010 (UTC)[reply]

I'd like to look at a small tweak to {{wikicite}} so that it can generate an anchor which is directly compatible with the {{harv}} family, without the need for |Ref=Reference-refDoe2010. I'm thinking along the lines of allowing direct use of the existing {{harvid}} template, which would allow something like this:
{{harvnb|Doe|2010}}
{{wikicite |harvref={{harvid|Doe|2010}} |reference=Doe, John (2010), ''A fictional account'' }}
In this way, {{sfn}} can be accommodated; this template uses the same basic syntax as {{harvnb}} and a similar linking mechanism, but lacks the |ref= parameter. --Redrose64 (talk) 12:36, 14 March 2010 (UTC)[reply]
That sounds like a worthwhile change, but it should be discussed on the talk page for that template. I've opened a discussion about this at Template talk:wikicite#Changes and offered a modified version of the template there. One small change in what I've offered vs. what you suggested is that I've named the added parameter ref instead of harvref, as the harv-specific stuff is confined to {{harvid}}. Wtmitchell (talk) (earlier Boracay Bill) 01:37, 15 March 2010 (UTC).[reply]

Cleaning up broken handcrafted cites

As discussed in the #Highlighting section above, existing handcrafted cites like <cite id="id for this cite">Citation body</cite> are now slightly broken and, once support for a new ref parameter is added to {{Wikicite}}, those should be changed to {{wikicite |ref="id for this cite" |reference=Citation body}} to unbreak them. User:Gadget850 has searched the database and found about 75 templates and 2500 articles which may be candidates for this change (many of the articles certainly are candidates). Links to these can be found at User:Gadget850/dbsearch/cite 2010-Feb-03. Does anyone have any thoughts about what should or should not be done about this? Wtmitchell (talk) (earlier Boracay Bill) 08:12, 15 March 2010 (UTC)[reply]