resource to teach myself how to edit a style?

I wish to have citations in the body of my text to have specific fields from records in my Zotero library (all imported from PubMed "My Collections") to appear in the notation in the body of my work. I would like each citation to appear stating the PMID value, then the title, and the year. Zotero snags these values WONDERFULLY from PubMed online and are in the records, including as an "extra" value the PMID value.
An example of what I want in the body of the work:
("PMID: 23939820 The Rachitic Tooth, Feb. 2014"), with the PMID # as a hyperlink to the article at PubMed (for epub), and the Biblio listing to appear as a normal/typical scientific citation.
I can construct this using HTML by dropping the entire book into Dreamweaver which I have used for decades, but that's a lot of tedious work. Being new to Zotero, is there already a better way to get it done? a primer on how to alter styles, or maybe there is already such a "style"?
  • You can't hyperlink using citation styles (though you could produce https://www.ncbi.nlm.nih.gov/pubmed/23939820 ) but everything else isn't terribly hard using citation styles.

    There's some basics here: https://www.zotero.org/support/dev/citation_styles/style_editing_step-by-step
    And you can find a fair amount on youtube, e.g. a Webinar I did some years back here: https://www.youtube.com/watch?v=BINcqkF5fNM

    You can also ask specific questions here.
  • Many thanks. I'll pursue the links and info you suggested.
  • By "you could produce...", I presume you are agreeing that Zotero/styles won't do this for me, but that I can manually create these either by typing or using Dreamweaver. (??)
    Frankly, I'm kinda leaning towards each citation simply being "(1) PMID: 1234567" in the body of the text, with the full title et al in the Biblio linked to the (1), and the PMID embedding the URL to port out directly to PubMed for those reading my book on electronic media that are attached to the web.
    Oh well, on to the links you provided! thanks again.
  • What I'm saying is that you can produce a plaintext link such as https://www.ncbi.nlm.nih.gov/pubmed/23939820 which most website generators will turn into a clickable link.
    What you can't do using CSL is produce a hyperlinked string such as
    <a href="https://www.ncbi.nlm.nih.gov/pubmed/23939820 ">23939820</a>
  • What he meant was that you can create the text of the link using CSL, but not automatically convert it to an active link.

    Depending on your web platform, it may automatically recognize and activate links.

    I suggest formatting the PMID like this:
    https://www.ncbi.nlm.nih.gov/pubmed/18276894
  • bwiernik - thanks - I have actually been doing this, embedding hyperlinks with the apparent text as PMID:18276894 , and the underlying html to the url, using hyperlink icon in Word.
    But this does not give me a tidy bibliography in the accepted scientific/medical literature manner. Trying to have my cake in an automated fashion with Zotera by finding or else modifying an extant style.
    The PMID value is routinely captured by Zotera from the NIH' PubMed website as a field titled "extra", so I expect to find a way to insert that into the Citation values, and have the Biblio retain the traditional.
    Googling a PMID number all by itself usually returns the NIH's page as the primary hit for those who are reading hardcopy but still wanna check the reference "quick and easy". Hence my desire to put the PMID in the body as well as follow the traditions of the bibliography. For those that will be reading my book via Kindle or on a phone/tablet app, it's an easy side-venture to go to/return back within Kindle since it is actually html-based. (go figger).
    If CSL won't let me create this, as you said in your post, then dang. :( I can type all of the PMIDs into the body using Word or else dump it to DW, convert them manually to hyperlinks, return it all to Word, use the Zotero applet to put in more traditional citations adjacent to each PMID hyperlink, and pray that when I go to publish it the structures doesn't all go to heck in a handbasket. There's only 150 or so of these. :(
    I have to venture the opinion that given the neatness/conciseness of using the PMID when referring to published studies, this modality should be more of a factor going forward. IOW I'd think it might be useful for others, so if I can figure out a CSL kludge and then share it I will. Also, Adamsmith, appreciate your posts and suggestions as well. I've not been able to watch the entire webinar yet but I'll pursue that asap, along with the other links posted in the video. Yay for learning experiences, boo for running headon into "cain't do thats".
  • You can print PMID using CSL using
    <text variable="PMID"/> It's recognized from the Extra field.
  • It's obvious the code editor is using html very much like DW, but I need to find the rules for referencing the values that Zotero parsed from gleaning of PubMed's article citation contents, especially the "extra" value where the PMID number is stored. I'll get there.
  • National Library of Medicine (grant proposals with PMCID/PMID) is very close, just need to figure out insertion of pmid value into the citation string. Then I can insert a hyperlinked duplicate at each citation location.
  • "You can print PMID using CSL using
    It's recognized from the Extra field."
    the problem is discerning WHERE to insert this in the hierarchy of the CSL, to both establish it and to also "cite" it visually in the text that an insert places it. I'll get there, I am hopeful. :)
  • I’m really not following what your question is. adamsmith provided you the CSL code above.
  • bwiernik - I've been underwater at my job (pharmacist) for the last few days. Question is how to insert the CSL code snippet into the overall CSL code package for a given style, such as the National Library of Medicine one I mentioned above. It's just html code, I need to grok the fundamental structure and then determine how to make the text appearing in the body to be, "PMID: 12345678", with a hyperlink to the NIH PubMed website embedded as well as to the bibliography. I fancy the PMID word to link to the biblio, and the link embedded in the actual ID number to hyper out to the NIH datalink. I think it's doable, just too busy pushing drugs and suffering a 3-day continuing education seminar this weekend to make progress. Thanks.
  • Let me rephrase my question.

    As you note, the NLM Grant Proposals style (www.zotero.org/styles/national-library-of-medicine-grant-proposals) already lists the PMCID or PMID with the format:
    PMID: 12345.

    CSL cannot create an embedded link. Your two options are either:

    1. Just the text "PMID: 23939820"
    2. Write out the whole link in a visible manner: "https://www.ncbi.nlm.nih.gov/pubmed/23939820"

    If you want to make your bibliography easy for someone to click through to PubMed, then I recommend just leaving it as "https://www.ncbi.nlm.nih.gov/pubmed/23939820" in your bibliography.

    If you really want the live link _and_ the "PMID: " text, then you need to do a two step process. First, download the NLM Grant Proposals style (https://raw.githubusercontent.com/citation-style-language/styles/master/national-library-of-medicine-grant-proposals.csl).

    Open it in a text editor like Notepad or TextEdit or Atom. Change the Style Title and ID near the top of the style to something else (anything else). Then, search and find prefix=" PMCID: " and prefix=" PMID: " and change to prefix=" https://www.ncbi.nlm.nih.gov/pmc/" and prefix=" https://www.ncbi.nlm.nih.gov/pubmed/", respectively.

    Save the file. Close it. Double-click on it to install into Zotero.

    Then, in your Word document, insert all of your citations using your edited style. When you are done writing, save a copy of your file and then click the Unlink Citations button in the Zotero tab in Word. Select all the bibliography text and then run Word's AutoFormat function (https://www.addintools.com/documents/word/where-autoformat.html). This will turn all of the URL text into live links.

    Then, open Word's Find-and-Replace window (Ctrl+H). Search for "https://www.ncbi.nlm.nih.gov/pmc/" and replace with "PMCID: ". Then search for "https://www.ncbi.nlm.nih.gov/pubmed/" and replace with "PMID: ".
Sign In or Register to comment.