Change citation style before-after periods

How can I change the placement of periods when I am changing a citation style? For instance, the citation number is currently a superscript at the end of a sentence after a period (ex: Currently the guidelines for the prevention of stroke in patients with stroke and transient ischemic attack advise against screening for hyperhomocysteinemia and vitamin supplementation for prevention of stroke.8)

If I have to submit it to a different journal, the formatting may now be required to have brackets with the citation number coming before the period (ex: Currently the guidelines for the prevention of stroke in patients with stroke and transient ischemic attack advise against screening for hyperhomocysteinemia and vitamin supplementation for prevention of stroke [8].)

Is there anyway to automatically do this with the Zotero Plugin in Microsoft Word or do I have to manually delete/insert/move the location of the periods for each citation?

Thanks in advance.
  • edited July 26, 2014
    I'm afraid that there is currently no way to do this in an automatic way. You will have to move the periods yourself.

    Edit: If you want to follow instructions below, you will have to use the _final_ version of the document with field codes removed (use the "Remove Codes" button in the Zotero toolbar in Word). MAKE A COPY OF YOUR DOCUMENT _BEFORE_ REMOVING FIELD CODES!!! (this will break any links between the references in your document and your Zotero library)

    You can semi-automate this by using Word's Find and Replace capabilities. In Word, open the Replace dialog (Ctrl + H). Click "More>>" then select "Use wildcards". In the "Find what" textbox type .(\[[0-9, \-]@\]) and in the "Replace with" textbox type \1.(note the space before \1). Now you can use the "Find Next" and "Replace" buttons to switch the position of the period. (I would not use "Replace All", since it may replace something you don't want)
  • I tried entering: .(\[[0-9, \-]@\]) in the "Find what" box, but it says "Search item was not found." I removed the field codes first before searching. Several of my citations contain more than one reference (ex: 3-5), a few are individual references but multiple (ex: 3,5,7), and some are double digits (ex: 12). Is there something else I should be doing or are there more specific instructions with regards to the wildcards in the "Find What" textbox?

    Thanks
  • Can you copy paste an example of a citation and a few words of surrounding text here?
  • In the past, studies have demonstrated that elevated homocysteine level is a risk factor for vascular disease, specifically myocardial infarction and stroke.1–3 The association between hyperhomocysteinemia and stroke was even shown in a population of young adults with a history of ischemic stroke.4 Despite this, more recent clinical trials have failed to reveal a benefit when using homocysteine-lowering vitamins in patients with vascular disease.5–7

    Is that what you meant? (The citation numbers are supposed to be superscript)
  • Right, so you would first chance that to a new style, do whatever other edits you need, save a copy of the document, remove field codes, then do a search and replace as per above. It should work for a style with numbers in brackets.
  • and how would the search and replace work if the new citations were in parentheses rather than brackets?
  • I tried what you suggested on the citations with brackets, and the search code you gave me works great for citations with one number but doesn't work when it's several (ie. 4-7)
  • Well, with parentheses you would have to use .(\([0-9, \-]@\))(changed the brackets that were preceded by a backslash to parentheses)

    That might be an en-dash (I used a hyphen in the string that I gave you). You can use this instead
    .(\[[0-9, \-‒–—]@\]) which includes all sorts of dashes.
  • I made a macro to address this issue. It corrects the placement of punctuation signs and spaces before and after the reference after switching from footnotes/endnotes to inline citations such as numbered citations or author-date citations in Word for Windows.
    https://github.com/ailintom/Cleanup-after-style-change-in-Zotero-for-Word
  • That's a neat macro!

    @adamsmith This is something that has bugged me as a weakness of CSL's ability to switch between author-date and numeric systems. I'd think that a CSL change to add a space before author-date citations makes sense, but is this sort of cleanup something that might be recommended for inclusion in the processors?
  • edited November 27, 2017
    This couple of macros has just been rejected as a new feature for the Word for Windows plugin https://github.com/zotero/zotero-word-for-windows-integration/pull/41
    But may be the developers could find a more suitable place for this feature in the Zotero infrastructure.
Sign In or Register to comment.