Automatically Superscript Citations in Word 2007

I've tried searching but no luck.. Is there a way to automatically have zotero insert citation numbers as superscripted in word 2007 (I know I can manually edit each citation). I need vancouver style citations but with superscripts not (x). Can I edit the style like I can with Endnote?

This is the only thing stopping me from ditching endnote completely..
«1
  • You can change the style with a text editor. Some info:

    http://www.zotero.org/support/dev/creating_citation_styles
    http://www.zotero.org/support/dev/csl_syntax_summary#formatting

    So these lines:
    <layout prefix="(" suffix=")" delimiter="; ">
    <text variable="citation-number"/>
    </layout>

    should become:
    <layout delimiter="; ">
    <text variable="citation-number" vertical-align="sup"/>
    </layout>
  • Thanks for the reply... that seems to superscript it, but it's still using the parentheses, but now around the superscript. I tried to remove them but then Zotero tells me it's not a valid CSL file. :(
  • Can you try this file:

    http://gist.github.com/raw/90150/e34437061dcc4215b84f5c4328a19824b071b821/vancouver-superscript.csl

    That one works for me (I made the exact changes as outlined above).
  • Yes, the citation-number is superscripted. However, the prefix and suffix hasn't been done. See these:

    <layout prefix="[" suffix="]" delimiter="; ">
    <text variable="citation-number" vertical-align="sup"/>
    </layout>

    Thanks for more help.
  • I based my style on http://www.zotero.org/styles/vancouver, which doesn't include those lines. You can just remove the entire prefix/suffix-part though:
    <layout prefix="[" suffix="]" delimiter="; ">then becomes
    <layout delimiter="; ">
  • edited April 12, 2009
    This works great. Now the last tweak needed (I believe this is where the delimiter part comes in) is that when I use 2 citations for one statement they are separated as:
    Statement1; 2 (just the numbers are superscripted the ; is regular font)

    but I'd like it to be
    Statement1, 2 (all superscript)

    I hope that makes sense. Thanks for all your help.. This is saving me so much time in working through references!
  • Ah, I see. I mistakenly assumed that the delimiter would also become superscripted in the code I outlined earlier. I guess this then should work correctly:

    <layout delimiter=", " vertical-align="sup">
    <text variable="citation-number"/>
    </layout>
  • That works perfectly! Thanks so much once again!!
  • Hi Hanish,

    Is it possibe to put this style up in the style section as I need exacty the same style for my work, and I am struggling with the code.
  • Is there a certain guide that describes this variant of Vancouver? That might make the style easier to identify in the Style Repository (the alternative would be to name this variant "Vancouver - superscript" or something similar).
  • The vancouver-superscript is a version preferred by medical journals.
    The main difference being that the in text citations are in supersciprt without brackets of parenthesis and that a coma "," is used to separate two references.

    Good explanation:
    www.fgdp.org.uk/pdf/vancouver.pdf


    From the University of Surrey:

    In the Vancouver style, a consecutive number is allocated to each reference as it is cited for the first time in the
    text of the assignment. This number becomes the unique identifier of that source and if the source is cited again
    the same number is repeated. Numbers are inserted to the right of commas and full stops, and to the left of
    colons and semi-colons. Multiple sources can be listed at a single reference point. The numbers are then
    separated by commas and consecutive numbers are joined with a hyphen. Vancouver uses superscript
    numbers, or standard numbers in brackets, in the text, e.g. 1-4,10,12 or (1-4,10,12).

    The references are listed at the end of your assignment in the numerical order in which they are cited in the text.

    The main advantage of the Vancouver style is that the text reads more easily, without the intrusion of in-text
    citations which can be difficult to keep brief. The reader can also check the references as they read through the
    text, without having to search through the list alphabetically for the first author of a particular reference.
  • Thank you very much for your help Rintze
  • edited April 17, 2009
    So according to that guide both options are valid (numbers in brackets or as superscripts). I'll just name the variant "Vancouver-superscript" then to avoid any confusion.

    P.S. I added the style. It may take some time for it to show up though in the Style Repository.
  • I look forward to trying the new style. Once again thanks for all your help.
    K
  • That was great Rintze,

    I have been using the new superscript style and it works beautifully.

    K
  • Sorry, was out of town a few days, thanks for troubleshooting with us and uploading it Rintze. I'm surprised nobody uploaded this before, it's a common style in medical journals.

    kaarthur, the only thing to watch out for is the number of authors in the references, as that sometimes varies by journal,ie how many authors before "et al" is used etc. This can be customized in the csl file.
  • It's really perfect without the prefix string. I also need the prefix and suffix string superscripted , so the layout format is like this:

    <layout prefix="[" suffix="]" delimiter="," vertical-align="sup">
    <text variable="citation-number"/>
    </layout>

    However, I can't get what I want. In Word, just the citation-number is superscripted; in OOo, just the citation-number and the suffix string are superscripted.

    I tried to check extensions\zotero@chnm.gmu.edu\chrome\zotero\content\zotero\xpcom\csl.js and Zotero-Word-Plugin to find out what happened. But failed.

    Thanks for any help.
  • That's outside my realm of expertise.
  • edited April 20, 2009
    @heromyth,

    It's no immediate comfort, but the new CSL processor I'm working on will handle this correctly. Ranging will also work, so with numbered references you should also be able to get something like [1]-[4] and [1],[3],[5]-[7], superscripted. It's not quite done yet, but it's in the works (I'm building this part of the thing this week and next), and if all goes well (touch wood), the processor will eventually be deployed in Zotero.

    Small steps ...
  • edited April 23, 2009
    Thanks fbennett!
    After doing some modifications to \chrome\zotero\content\zotero\xpcom\csl.js, I got what I want, which is to format the prefix and suffix in the citation layout.

    Here is my patch (More tests needed!):

    ================================
    *** /chrome/zotero/content/zotero/xpcom/csl.js Thu Mar 19 12:19:44 2009
    --- /chrome/zotero/content/zotero/xpcom/csl.js Thu Apr 23 17:17:14 2009
    @@ -2613,9 +2613,16 @@
    this.closeFormatting += formattedString.closeFormatting;
    this.closePunctuation += formattedString.closePunctuation;
    }
    +
    + if(haveAppended && suffix !== false)
    + {
    + var oldCloseFormatting = this.closeFormatting;
    + this.closeFormatting = "";
    + this.append(suffix, null, true);
    + this.string += oldCloseFormatting;
    + }
    +

    - // append suffix, if we didn't before
    - if(haveAppended && suffix !== false) this.append(suffix, null, true);

    return haveAppended;
    }
    @@ -2842,7 +2849,8 @@
    }
    }

    - this.string += addBefore+string;
    + //this.string += addBefore+string;
    + this.string = addBefore+ this.string + string;

    if(element && element.@suffix.length()) {
    this.append(element.@suffix.toString(), null, true);
    ================================

    The debug output before using this patch:
    ================================
    <updateCitationsResponse>
    <citations>
    <citation index="0">
    <text>{\rtf [\super 1\super0 ]}</text>
    </citation>
    <citation index="1">
    <text>{\rtf [\super 2\super0 ]}</text>
    </citation>
    <citation index="2">
    <text>{\rtf [\super 3-8,2\super0 ]}</text>
    </citation>
    </citations>
    </updateCitationsResponse>
    ================================

    after patching:
    ================================
    <updateCitationsResponse>
    <citations>
    <citation index="0">
    <text>{\rtf \super [1]\super0 }</text>
    </citation>
    <citation index="1">
    <text>{\rtf \super [2]\super0 }</text>
    </citation>
    <citation index="2">
    <text>{\rtf \super [3-8,2]\super0 }</text>
    </citation>
    </citations>
    </updateCitationsResponse>
    ================================
  • edited May 7, 2009
    I cannot find /chrome/zotero/content/zotero/xpcom/csl.js, where is it? I works on Zotero 1.5b2, firefox 3.0.10.

    fbennett said:
    It's no immediate comfort, but the new CSL processor I'm working on will handle this correctly. Ranging will also work, so with numbered references you should also be able to get something like [1]-[4] and [1],[3],[5]-[7], superscripted. It's not quite done yet, but it's in the works (I'm building this part of the thing this week and next), and if all goes well (touch wood), the processor will eventually be deployed in Zotero.
    I hope he had done. Thanks
  • the csl.js is part of zotero.jar,
    which you should be able to find with a regular search - (it's somewhere in the extension folder of your firefox, where exactly depends on your system.
    I wouldn't suggest you try to patch it unless you at least know more or less what you are doing.
  • edited May 7, 2009
    thank to adamsmith. I dare not modify zotero.jar.
    I I works on Zotero 1.5b2, firefox 3.0.10, and Chinese-Std-GBT7714-Numeric.csl. It requires the prefix and suffix string [] superscripted also. I use Zotero for my master paper which should be completed up to May 15. any suggestion?
  • I "soluted" it Using a deceptive step. After all citation were made, use "search and repalce" function of word processor to relpace all normal "[" ("]" follow suit) with "[" supercripted.
  • It looks like this superscript issue has been fixed now. I'm using Zotero 2.0b7.2 + WinWord 3.0a2 without problems.

    Citations like: 2,4-6)
    where all the characters including the comma and the parenthesis are superscripted (style as required by the Japanese Journal of Applied Physics) now works without problems.

    A big thank you for the fix!
  • But These nice styles and maybe the Zotero engine itself, have a serious bug:

    Those codes ONLY appliy to when MULTIPLE-citations are being added at once. However when the user adds a citation, and afterward finds and adds another citation exactly beside the previous one, unlike Endnote, Zoterro can't understand to merge those fields into one, and then re-apply the Style to the newly created bigger field.

    Does someone knows how to fix it?

    Additional details are described here:
    http://forums.zotero.org/discussion/9199/vancouver-style-a-comma-between-two-neighbor-but-separated-fields-needs-automerging-those-fields/

    thank you very much :)
  • victorxstc, don't "add" a new field; try "editing" the existing field, using the second button on the toolbar.
  • Thank you asahiko :) This works just fine :)
  • * asahiko
    * CommentTimeSep 25th 2009


    "It looks like this superscript issue has been fixed now. I'm using Zotero 2.0b7.2 + WinWord 3.0a2 without problems."
    It's a very good news! But I'm using openoffice 3.1 where the citations and ] are superscripted, but [ is normal size. It seems that the problem was solved uncompletely. More ever, unlike winword, openoffice cannot use find and replace to make [ superscripted. Any help?
  • More ever, unlike winword, openoffice cannot use find and replace to make [ superscripted. Any help?
    that's incorrect.
    In Ooo, use search, click on more options and modify the replace term using the format button on the bottom left. Superscript is in the "position" tab of the format window.
Sign In or Register to comment.