How to highlight (bold) some references in bibliography

I'm writing a grant application and it has been suggested that in the bibliography I should bold (or otherwise highlight) the references by my lab. I could go through the list and do it manually at the end, but this would obviously be very painful, especially right before the deadline.
Does anyone have a trick for this?
A feature that I can imagine is a checkbox when I add a citation, asking Zotero to (for example) bold the authors for that item in the bibliography. I don't think such a thing exists?
Thank you.
- Robert
  • edited March 25, 2021
    Do you bold all the references or some specific ones?

    if all, you could edit the style file (csl) or select the proper style.

    if the latter, you could add <b> before the start of the text you want to bold and </b> after the end in the item of zotero Info tab.
  • Thanks for your reply!
    I'd need to bold only some of the references. There are currently about 100 references in the document, and I'd want to bold about 40 of them.
    The tags didn't appear in your message but I think you're suggesting that I add 'b' and '/b' HTML tags. I hadn't thought of it and I may end up having to do it. The problem is that it's only in this particular document that I want to bold them, not in other documents where I'll be citing them.
  • edited March 25, 2021
    which field do you want to bold? The title, the author or publication. And which csl do you use?
  • I'd want to bold the authors. I'm using a modified version of American Psychological Association 6th Edition. I could probably figure out how to bold the authors in that style, but I don't understand how that would help, since I only want to bold the authors in some of the references in this document.
  • edited March 25, 2021
    You could modify these codes, select the items you want to bold authors, run them in JavaScript window (Tools-Developer-Run JavaScript), and change back when they needn't bold.

    They work for me.



    var oldName = "John Smith";
    var newFirstName = "<b>John</b>";
    var newLastName = "<b>Smith</b>";
    var newFieldMode = 0; // 0: two-field, 1: one-field (with empty first name)

    var rn = 0; //number of changes
    await Zotero.DB.executeTransaction(async function () {
    zoteroPane = Zotero.getActiveZoteroPane();
    items = zoteroPane.getSelectedItems();
    for (item of items) {
    let creators = item.getCreators();
    let newCreators = [];
    for (let creator of creators) {
    if (`${creator.firstName} ${creator.lastName}`.trim() == oldName) {
    creator.firstName = newFirstName;
    creator.lastName = newLastName;
    creator.fieldMode = newFieldMode;
    rn+=1;
    }
    newCreators.push(creator);

    }
    item.setCreators(newCreators);

    await item.save();

    }

    });
    return rn + " item(s) updated";

  • Alternatively, you could modify the style to, e.g., print an asterisk at the beginning of the relevant references -- that could be done, e.g. using the Extra field (and the CSL variable note that displays it). It's not quite as visible as bold, but still pretty good and more flexible that themethods above.
  • edited March 25, 2021
    @adamsmith, thanks, could I append an asterisk for the specific author (for example the correspond author)? Maybe different reference has different correspond author.
  • Not with CSL, no.
  • Thank you to both of you, this opens up two possibilities that I wasn't aware of.
  • I keep a separate group library of my lab references with bold tags around relevant names that I use for CV and grant applications.
  • Interesting, thank you. I've never really made use of group libraries, although my students have created a couple. I assume that references from your lab would also have duplicate entries in the main library?
  • Yes, I only use the "Wiernik Lab CV" library for grant applications. For regular writing, I use the versions without bolding in my main library.
  • Right. Thank you.
Sign In or Register to comment.