Single to multiple citations in Word Plugin

13
  • If you're willing to work with ODF scan it works - adjacent citations are already mereged with ODF scan and since ODF scan works both ways (i.e. you can also convert citations to markers) it can merge citations.
    Otherwise nothing new.
  • My mistake. What I want is to merge discrete FOOTNOTES into a single note. If a paragraph contains a note at the end of three different sentences, I want that merged into a single note at the end of the paragraph. And, come to think of it, that is something that would be done in the word processing software, not ODF scan. ODF scan has great possibilities all on its own. m
  • Right - so if you insert those footnotes via Zotero citations (i.e. by putting the marker into the text when using ODF scan) they would actually be mergeable with ODF scan. But if you insert the footnotes with your word processor - as I understand you do - this is indeed nothing Zotero can solve.
  • edited November 8, 2013
    Ah. But I have started using ODF Scan. But I use it in Scrivener and make discrete footnotes. Hmmm. If I have a paragraph of text with ODF codes run into the text (parenthetically), does it merge all of these in each paragraph into a single note? That would be a capability that I have not discovered. I will play with it. Merging adjacent cites--{}{}{}--I do understand. But I am talking about:

    TextA{Cite1} TextB{Cite2} TextC{Cite3} becoming:


    TextA. TextB. TextC.1

                       

    1. Cite1; Cite2; Cite3.
  • That won't be implemented. Apart from the complexity if it, there would be guesswork involved -- what looks like a paragraph boundary can be marked up in all sorts of ways inside the file.
  • Yeah. That's why it dawned on me that it needs to be in the word processing software, or maybe in Scrivener. It's so nice to keep each note with each proposition so that you can switch things around creating drafts; afterward, consolidate. ODF is huge for me, and I am very glad to have it for what it can and does do. m
  • Hi
    I do not understand how its possible to say that this is a rare case. I have published hundreds of papers. I add references at different times, especially for large reviews. Thats means I get something like (35)(36)(37) or (42)(43)(44)(45)(46) or (5, 91)(92) and some in reverse order. Work on papers of reviews or grants in life science proceeds often over months, often with multiple authors, so its simply impossible to have all references at day one in one spot. Also new references will come out and have to be added.
    So its not that there is a habit based on using Endnote, its a strict necessity. The Zotero system is fantastic, just this is an essential part. Having to hand edit after the doc is complete is problematic, since if the reviewers request revisions, one has to track which one is the edited version without filed codes. Seems like many people had the same problem but are simply not taken serious....
  • I think you're missing something. You can easily add a citation to an existing citation simply by using "edit citation" in the Word add-on and that leaves field codes intact.
  • Let me try to understand. What I tried is to highlight lets say (35)(36)(37), then click the 'edit zotero citation'. that opens the red bar, but its empty.
  • no, the goal would be to not get (35)(36)(37) in the first place.
    So let's say you have (35), but you want to add two citations to get (35-37).
    You mover your cursor to the (35), click edit citation. You get the red bar with one item in it (the one cited in 35). You just type after it to search for the next one and select that from the search list, then select the last one in a similar way.
    See here for multiple citations in general:
    https://www.zotero.org/support/word_processor_plugin_usage#citations_with_multiple_cited_items

    The problem with the lack of "merge" is really limited to a situation where you need to move references around a lot in a document--and that's not impossible without merge, it's just more tedious.
  • so in other words, you are saying I have to delete all these cases and reinsert all the references where i have multiple?
  • In an existing document, where you have (35)(36)(37), yes. That's where I come back to my remark about Endnote--this is really annoying if you're used to Endnote's systems and then did this "wrong." If you're using the regular Zotero method from the start, it's no more work than adding individual citations and merging them.
  • all I can say is that this is not intuitive, nothing to do with endnote, it requires a particular instruction, and annoying that its not possible to repair existing file without jumping through hoops. So my recommendation, change in future releases.
  • Just to add another vote, it would be really nice to add this feature, because:

    1. As already mentioned by wfromer2 and others, merging in-text citations is very common. It is not just a habit issue.

    Just as another toy example, originally I wrote:" this method has been applied to dogs (ref1, ref2, ref3), cats (ref4, ref5, ref6), rats (ref7, ref8, ref9), chicken (ref10, ref11, ref12), and ducks (ref13, ref14, ref15)."

    But now I'd like to change to:" this method has been applied to different animal species (ref1-15)."

    In this case, I need to merge all the citations, and this type of reorganizing/ combing processes happen a lot during writing and revising.

    2. Yes, we can add them manually. But when a library has more than 10000 references and the file is large, adding a new reference can become slow, or at least not very fast. Therefore, it will save a lot of time if we can merge them directly. I truly believe this function can significantly enhance Zotero's usability.
  • Yes Zotero, please add a "merge" button!
  • Another vote for this feature!

    Essential for efficient citing in my opinion.
  • Another vote for such a feature! More options to edit citation fields would be great.
  • edited March 8, 2018
    I just programmed a VBA macro for Word 2010 (hopefully it will work in newer versions, too) which joins two or more selected adjacent Zotero references into one multiple reference. Before starting the macro, select the references to be joined. After running the macro, make a Zotero Refresh.

    Update 2018-02-20: Added code to distinguish Zotero fields from other fields.
    Other fields which may incidentally be within the selection now remain untouched.

    Warning! Use at your own risk.
    One shortcoming: The macro does not check whether a citation is contained more than once in the selection. The Zotero refresh does recognize this case and - depending on the selected citation style - groups multiple citations of the same source. If you want to remove the redundant citations after joining, select the multiple citation and choose the Zotero "Add/Edit Citation" in classical view. You can then remove sources from and add sources to the multiple citation.

    I'd like to get experiences from other users.

    Sub ZoteroJoinCitations()

    Dim MyField As Field
    Dim MyRg As Range
    Dim IStrt, ILen, IEnd As Long
    Dim First As Boolean
    Dim FOrig, FContent, FRest, FNew As String
    FContent = ""
    First = True
    Set MyRg = Selection.Range

    For Each MyField In MyRg.Fields
    If InStr(1, MyField.Code.Text, "ADDIN ZOTERO_ITEM CSL_CITATION", vbTextCompare) = 2 Then
    If First Then
    FOrig = MyField.Code.Text
    IEnd = InStr(1, MyField.Code.Text, "],""schema"":", vbTextCompare) - 1
    First = False
    Else
    IStrt = InStr(1, MyField, """citationItems"":[", vbTextCompare) + 17
    ILen = InStr(1, MyField, "],""schema"":", vbTextCompare) - IStrt
    FContent = FContent & "," & Mid(MyField.Code.Text, IStrt, ILen)
    End If
    End If
    Next MyField

    ILen = Len(FOrig) - IEnd
    FNew = Left(FOrig, IEnd) & FContent & Right(FOrig, ILen)
    ' MyRg.Fields(1).Code.Text = FNew ' 2018-03-08 commented out
    ' would insert the Zotero field contents in the first field of the selection
    ' even if this is not a Zotero field

    First = True
    For Each MyField In MyRg.Fields
    If InStr(1, MyField.Code.Text, "ADDIN ZOTERO_ITEM CSL_CITATION", vbTextCompare) = 2 Then
    If First Then
    MyField.Code.Text = FNew ' 2018-03-08 inserted here
    First = False
    Else
    MyField.Delete
    End If
    End If
    Next MyField

    End Sub
  • edited March 7, 2018
    Thank you very much "wh_fzj_ste": your macro works perfectly! It enables to save plenty of time.
    My configuration: Windows 10, Word 365 (version 1802, Build 9020.2167), Zotero 5.0.35.1
    And by the way, if everyone asks for this feature, there must be a reason, and the answer "you just have to edit your citations and merge them manually" was not acceptable. The scenario is too frequent, and the manual procedure is too time-consuming.
    Thank you again!
  • @ emmanuel.chazard:
    please let us know in which version of MS Word you used the macro.
    As I wrote, I can only test it in Word 2010, but others may want to know whether it will work in their -newer- version of Word, too.
  • Would be extra lovely if you could tie this in with the Zotero toolbar, adding a button 'Merge selected citations'!
  • @mark: Only Zotero developers can add this to the Zotero toolbar, neither you nor me.
  • edited March 8, 2018
    2018-03-08 Again updated the macro code: Respect a non-Zotero field even if this is the first field in the selection.
  • My hope is that at some point the code will be mature enough to be folded into the Zotero Word plugin — @bwiernik is this likely?
  • @mark: I also hope that the macro will at some time be included in the plugin.
    I was just wondering if there could be cases where the macro would fail or would perform unwanted things. Up to now I can't imagine any. One could also add a test whether a citation of the same source is contained more than once in the selection, but that would be rather complicated.
  • Thanks a lot a lot a lot @wh_fzj_ste . I've been waiting for this feature to update in the last 8 years.
    I still do not understand why zotero has not added this important feature so far.
  • @cnnsbs I have the same question with you. I have just move form mendely to Zotero. Found that if when I cite extra papers using Rotero, I still could merge them using Mendely.
  • I am adding yet another request to enable merging of multiple adjacent citations in the Word Plugin. Not a rare operation amongst manuscript writers, methinks. Anyone who updates their citations due to the appearance of new publications or just realising that that they have missed one will do this.
  • @GuyLyons
    just to re-iterate -- it is absolutely possible to add citations to existing citations with Zotero already (as explained above) and the scenarios you're describing seems to be satisfied by that.

    There is absolutely a use case for merging (e.g. Jackliu008's comment above), but it's much less common.
  • @adamsmith
    Unfortunately this is not true. Your method works only if new refs are put manually. If I need to copy-paste them (e.g. set of references taken from another doc in between of old one) it is still impossible just copy new refs after old and merge them. This is a pain.
This discussion has been closed.