DEV Community

Cover image for NBIB (PubMed MEDLINE) to BibTeX
Sahil Kumar
Sahil Kumar

Posted on • Originally published at thelatexlab.com

NBIB (PubMed MEDLINE) to BibTeX

From PubMed: select results → Send to → Citation manager → Create file. That gives you a .nbib file (MEDLINE format) - a different export than RIS or EndNote tags entirely, and citation.js (the library most free converters lean on) doesn't parse it. This is a parser built specifically for it.

Three fixes that matter: NBIB wraps long values onto continuation lines starting with six spaces - a title or abstract spanning three lines is one logical value with two continuation rows. Parsers that don't handle the indentation truncate at the first line or treat the continuation as a separate field. This reassembles continuations back into the parent field. Second, NBIB has two author tags - AU is "Last F" (initials only), FAU is "Last, First" (full name) - and most converters grab whichever appears first (usually AU), giving "LeCun Y" instead of "LeCun, Yann." This prefers FAU when present. Same logic for journals: TA is the NLM abbreviation, JT is the full title, and this prefers JT.

Third: the DOI is buried inside the LID or AID field with a type marker, like LID - 10.1038/nature14539 [doi]. Converters that don't parse the marker either skip the DOI or emit the whole bracketed string as the field value. This extracts the DOI proper, alongside PMID and ISSN. Compressed page ranges expand the same way as the PubMed tool, trailing periods on titles get stripped (CSL/BibTeX convention), and multi-value tags (authors, MeSH headings, keywords) stay as arrays instead of collapsing into one string.

Link: thelatexlab.com/nbib-to-bibtex/

Top comments (0)