Harvard AuthorDate citations and Word AddIn

There are 2 citation styles in the Harvards style: (Author Date) and Author (Date). For example:
Work by Bloggs (2009) states that...
and
There has been a lot of work defining blogging (Bloggs 2009).

I need to mix these styles in a single document but can find no way of doing so other than deciding on one style then "manually" editing to the alternative style where relevant. The Word AddIn has only one button for inserting a citation so only one style can be used from it. The editor allows the author to be suppressed but that's no use in this case. I even thought of creating 2 style "variants" but the application of styles is on a per document basis not per citation inserted. Or even changing the Word AddIn to have 2 citation insert buttons and "fiddling" the text for the citation to the alternative form (but I couldn't find where the text was being returned in the time I had available to look at the AddIn code)

I can't find anyone else referring to this problem so either I've missed something obvious or I've not searched well enough or perhaps someone can help!!
  • why doesn't suppress author work? That's designed exactly for the case you describe.
  • Adam
    All I end up with if the author is suppressed is, in the case I quoted, (2009) i.e Work by (2009) states that... Surely then I would have to manually insert the author, in this case Bloggs to form the citation Bloggs (2009). As I said initially, perhaps I am being really stupid and missing the obvious (especially as I did see a post that said suppressing the author solved this problem). Can you explain in detail?
  • No, you're not missing something, but the idea between Zotero's implementation of citations is that everything that is a part of the text should be written as part of the text (what you call manually insert) and not as part of the citation.
    I.e. if your sentence doesn't make sense without the name of the author, you should type said name of the author and not have Zotero insert it.
    There are a number of reasons for that, the most intuitive being that Zotero prides itself on being able to switch seamlessly between author-date and footnoted styles.

    Now, if in your example above, the citation would be "Bloggs (2009)" and you were to convert that into a footnoted style you'd get "Work by (23) states that..." - clearly undesirable.

    There is somewhere in the depth of the forum a lengthy discussion on if Zotero should follow bibtex in allowing for two different citation modes along the lines of what you suggest, but the added benefit of that seems minimal and the added complications (and likely limitations) vast. Certainly two citation styles in a document sound like a big mess, both in terms of the formatting and in terms of the dialogue needed to create them.

    So, in short, you're stuck with typing your authors. That's what "solved" this for other people, too.
  • edited November 21, 2009
    Ok Adam, I accept your explanation and thank you for it.
    However my real scenario is it's my wife doing her university assignments and she wants to alternate citation styles. I'm just the IT man! To her Zotero is the means to an end (and a very good one in general)...how it works and the more esoteric concepts don't matter to her - she just wants it to do what she wants and my (tweaked for her assignments) get the exact style of Harvard referencing she needs!!
    So, if I haven't missed anything obvious, it looks like I may be able to examine the Word .dot template and intercept the formation of the citation before it gets inserted and offer her a dialog box with the 2 options she needs. That's all I can think of doing to solve her problem - she'll never need to switch "fundamental" styles at least while on her present course.
  • I think that will prove to be a nightmare and probably not just for you, but also for her: every time the document updates, you'd have to do the same thing, for every citation.

    I mean, obviously do what you want - but as a fellow academic (almost everyone here is) I can pretty much guarantee you that your wife does not want to use untested hacks (regardless of how good of a programmer you are) for any assignment, thesis, book etc.
    One thing goes wrong, and she'll end up having to redo every citation in the document (e.g. how would you deal with refreshing references). These things tend to backfire at the worst possible moments. Trust me (and many others). I've seen it many times.

    So I'd suggest you tell her that while you might be able to make things work like she wants to, the friendly folks at the Zotero forum strongly, strongly warned against doing that and suggested that instead she just slightly adapt her workflow to save both her and your time.
  • Here's a thread where this has been discussed. The synopsis version is that the issue (automatically supplying the author name in-text on a per-cite basis) is known, and there is some experimental work on parts of what might go into an implementation, but no decision has been made yet about whether to go further. For the present, just manually typing in the author names for such cites, as adamsmith suggests, is the way to go.
  • edited November 22, 2009
    Thanks for that link - I've only had time to skim through it but it does seem as though a suppress author and a suppress date solution would answer (at least) my problem.

    Having to type in the Author part of the citation is definitely the worst option - unfamiliar names, et al etc all have to be typed. If a suppress date option were available at least only a few keystrokes are required to add the date! It rather defeats one of the main reasons for using Zotero (no, I'm NOT knocking it as it has MANY other great qualities).

    While "poking about" looking at the field codes generated by the citation editor (for Word) I've come across another problem. If the editor is used to generate a different format from the standard citation then the field that results is not updated when the relevant Zotero button in Word is clicked. In fact the resultant field is rather odd. I've given an example below:

    Not edited resultant text and field code:
    (Andersson and Bergman 1980)
    ADDIN ZOTERO_ITEM {"citationItems":[{"itemID":5844}]}

    Edited resultant text (moving first "(" to just before the date):
    Andersson and Bergman (1980)
    ADDIN ZOTERO_ITEM {"custom":"Andersson and Bergman (1980)","citationItems":[{"itemID":5844}]}

    So this means that if the unknowing user edits the citation in the editor then they get a non-updatable citation - not the best behaviour!

    Documentation on the ADDIN field code is almost non-existent (I can only find one explanation on the Web) so I don't know why this was chosen in preference to some other field code - even the author of the Word Zotero VBA code has some comments about its quirkyness in the code.

    As a "footnote" to this post, Word's "F9" key doesn't update any citations - this is probably a good thing and is almost certainly a result of using ADDIN as it seems to have "properties" that make it locked against "F9" refreshing.

    When I have more time I promise I will read the discussion in the link more thoroughly!!
  • edited November 22, 2009
    So this means that if the unknowing user edits the citation in the editor then they get a non-updatable citation - not the best behaviour!
    on the contrary. Intended behavior. Imagine I spend a lot of time editing some details in citations using the editor, then refresh my document and *woosh* all my edits are gone.
    Now you may say - "well, the edits could remain, just the citation would update" - but once you start thinking about that that's entirely unfeasible: While "orderly" edits - i.e. prefix and suffix - do indeed update, how would you deal with, say, a deleted colon between date and title as you switch between APA and Chicago Manual of Style? And that's essentially true for all the edits that require the editor - there would be no way to refresh those in a useful way, so the best default is to leave edited citations as they are.

    Edit: In your critique of the "suppress author" option, you fail to note the - imho crucial - argument that words (in this case author names) that are part of the text should remain part of the text and not be dealt with by your bibliographic software. This both for practical (style switching) and systematic reasons.
  • OK - but there are 2 sides to that - the essential items are (in this case) the fields that are being used i.e. the Author and Date. What I would want is what most database queries would give. The formatting (i.e colons, spaces, commas etc etc) remain as I defined them but the data (i.e. the Author and Date) are filled in from the database. This is normal behaviour for database reports.
  • but how is Zotero to tell? People may change the title in the editor. Or add an author.
    In many ways, anything that _doesn't_ involve changing the content of the fields doesn't require use of the editor, but can and should be taken care of at the level of the style.
    Using the editor function should be a last, last resort for exactly that reason.

    As for "formatting" - that's a lot more complex that you make it out to be. For example, we've had one discussion where someone pointed out that a (foreign language) citation style required a period between title and subtitle, even if the original had a colon. Now - if someone changes that colon to a period in the editor, you would not want refreshing to revert that, right? But there is a technically indistinguishable situation, where someone may correct punctuation in a title in the database and then _would_ want refreshing to take account of that. Point being - there is no clean solution to this.

    Maybe that needs to be better documented (though I don't think I've seen a single question on the forum that was based on a mis- or lack of understanding of this).
  • edited November 22, 2009
    I don't seem to be getting my point across here. A a software designer/writer I have to provide the facilities that my users want so long as that is technically feasible. That's my first point! As Zotero is open source contributed to by many skillful and knowlegable individuals I have to accept that some features that I might want might require someone to put in a lot of time and effort and maybe nobody wants to do it for a variety of reasons. That's accepted.

    My second point however, comes from the viewpoint that Zotero is essentially a database coupled with a presentation manager. In the database are fields of information. As a user all I would like to do is to be able to present those field values in a format of my choice and that might include alternative formats. Your example of a period or colon between what are essentially field values is something that a change of style should solve. Further, if a particular field always/frequently had a colon in it and a period was what was wanted the facility to manipulate the field value before presentation could be solved by a style applied to the field. This is a normal facility when creating reports from databases. If Zotero was never designed with this kind of flexibility then my recommendation would be that its design should be extended to incorporate this.
    That said, we'll continue using Zotero - I believe that the effort put in by its creators should be applauded but it shouldn't stop users from requesting what they need however technically difficult it is to achieve this so long at it is possible (and I believe it is possible).
  • no, don't worry, you're getting your point across.
    All I'm trying to do is to highlight why particular design choices in Zotero have been made the way they are.
    Which I would hope can both lead to you making custom-changes in a more informed way and seeing the types of issues that any suggestions for changes in the main Zotero code that you may have would have to grapple with in order to convince people.
  • Good - why then do we only have one choice of citation style in any particular style. Why can't we have lots of citation styles (and lots of bibliography styles if users really wanted) - this is the equivalent of "reports" from databases (or the equivalent of field formatting). Where is the "bottleneck" in the design and what could be done about it - the style XML could support these changes - is it in the "presentation" manager (i.e. the Wor/OOo addin) or what?
  • edited November 22, 2009
    Technically, yes, the limitation is the plugin. What could be done about it in terms of coding is beyond my expertise.

    While I don't speak in any capacity for the developers, I think I have some ideas of why these design choices were made. As you will discover, Zotero in general does not encourage customization. You can, for example, not create custom item types, nor add custom fields to items. (Though some of that may change as a result of the NSF collaboration). As I understand it, this is on purpose.

    The biggest concern is the sharing of documents and data. With the examples above, as people add custom fields to items, sharing them gets a lot more complicated.
    With respect to your specific concern, when you have to people co-authoring in Zotero and one uses suppress author while the other uses two citation styles... not sure if this could be solved, but it certainly sounds messy.

    The second concern is simplicity and usability. Right now, you can change the citation style of a document with one click. When the document contains several styles, you need to change each one individually and then things might not work well depending on the nature of the styles... doesn't sound great either. So essentially implementing such features would load up (overload?) the plugin and decrease the general ease of usage.

    I'm aware that this is a trade-off. But my point is that while allowing users to customize things as they like may sound like an unambiguously good idea at first, it has substantial costs in terms of interface and interoperability. And I'd much rather have a few grumpy users that than a deteriorating product. As such, I think any such case needs a _really_ good reason to be implemented.
    What constitutes a good reason is obviously a judgment call. I think the specific usage example you point to doesn't warrant substantial changes - it warrants convincing end-users to slightly change their behavior (afaik they most likely wouldn't even have to _change_ behavior, because the only bibl. software that offers a solution here is bibtex, and I'd assume that LaTeX users are familiar and comfortable with the idea of software imposed constraints).
    (Incidentally, there is a imho more compelling usage case, as some styles in the sciences require different citation styles for figure and graph labels. Still, these are rather rare and the question of trade-offs remains).

    Now, obviously people may disagree with the approach taken by Zotero on these questions (and people do!), but I don't think you're likely to change developers' minds about the fundamental approach.

    Edit: wow that turned out long. See it as more general Sunday afternoon ruminations on "The Zotero approach to bibliographic management" ;-).
  • @colin,
    Good - why then [...] can't we have lots of citation styles (and lots of bibliography styles if users really wanted) [...] Where is the "bottleneck" in the design and what could be done about it - the style XML could support these changes - is it in the "presentation" manager (i.e. the Wor/OOo addin) or what?
    The use case you originally described required only a need to automate the placement of the author's name in the document text, and to suppress the printing of the author's name in the cite itself. The discussion under the link I posted above concerns such cases.

    As for allowing multiple citation styles and multiple bibliography styles in a single document, that's unlikely to feature in CSL or Zotero in the foreseeable future.

    When producing citations, the CSL processor doesn't output literal field content, it composes the data according to the citation context. In the next version of the processor, factors will include available backreferences, backreference proximity, other cited authors with the same surname, and the presence of other cites to different sources elsewhere in the document that have the same string representation according to the formatting rules in force. Both the citation form as a whole, and the inclusion and composition of names can be affected by small changes in context.

    The processor maintains internal state tables for the document which it references in order to make these choices. If multiple citation styles are allowed in the document, separate tables would need to be maintained (which is certainly doable), and a very large number of questions would need to be answered concerning the proper interaction between the state tables of separate styles (which is not).

    It's more a matter of the complexity implicit in your suggestion than of an arbitrary design barrier in CSL or Zotero. That, plus the fact that there just does not appear to be a pressing requirement for arbitrary mixing of bibliography styles out in the field.
  • Thank you all for your comments. While I agree with the purist arguments (really I do) I still need to do something to fix the problem locally.

    I have now had time to look at what's going on in the Word addin and have done enough "hacking" to convince myself that I can provide a solution which will work for my client (wife!) in her specific circumstances by changing the Addin code.

    I still have to confirm that Word persists the relevant information into its document but, provided that it does, the problem seems to be solved,

    So, I still have some way to go to prove the concept and to implement it. Should I be succesful in this (awful hacking) I'd be happy to collaborate with anyone else who has this specific problem.
  • If you're planning to dedicate time to this, be warned that 1.0 plugin VBA code is obsolete and incompatible with Zotero 2.0, which is nearing release. Most of the 2.0 plugin code is JavaScript (with a little bit of supporting platform/program-specific code in other languages).
  • Dan, what I'm planning will take relatively little time - would like to find out more about the 2.0 code though when the time comes!
  • Well, It all turned out to be remarkably simple in the end. About 15 lines of VBA code and an extra Zotero insert citation button on the toolbar (which was the most difficult part as I'd completely forgotton how to do this in Word). Now my wife can insert whichever form of citation she wants at the click of a button and the formatting is preserved when she clicks the refresh button.
    If anyone wants further details I'm happy to provide them.
  • Hi I know this is an old thread,

    but this issue is driving my nuts, so if there were a VBA solution to add Author (Date) citations I would very much appreciate if you or someone shared a solution.
    I somewhat understand the concerns, but then, e.g., in Lyx it works perfectly and I don't see exactly why in Word it should be different.

    More importantly, I have a 100 page test or so with standard citations and it would take loooon to convert them all by hand and for the future an easy way to insert "Standard" Harvard citations would be awesome!!!
  • As Dan wrote a few posts up, VBA is no longer relevant. I haven't used LyX, but this is easier to implement in a batch-processing environment tied to a fixed citation style than in a word processor. It's certainly not impossible in Word, but it's a question of whether it would be worth the programming effort that would be required.

    The logic needed to support such references is embedded in the citeproc-js citation processor, and the Zotero plugin code for Word is available. If anyone wants to take a crack at the necessary modifications, I'll be happy to make adjustments to the processor API to help get it working. But I think the core developers (understandably) have other priorities.
Sign In or Register to comment.