Citation-key completion for MarkEdit.
Type @ in a Markdown document and choose a citation from one or more local BibTeX/BibLaTeX files. Suggestions show the citation key, author, year, and title, and insert the selected key into the Markdown source.
Completed citations are shown compactly when the cursor is outside them:
[@smith2024, p. 12]appears as(Smith, 2024, p. 12).@smith2024 [para. 4]appears asSmith (2024, para. 4).- Citation clusters such as
[@smith2024; @doe2022]are supported.
Click a compact citation to reveal and edit its original Markdown.
-
Download
markedit-citations.jsfrom the latest release, or builddist/markedit-citations.jslocally. -
In MarkEdit, use the main-menu command to open its Documents folder, then open the
scriptssubfolder. Alternatively, open:~/Library/Containers/app.cyan.markedit/Data/Documents/scripts/ -
Option-drag
markedit-citations.jsinto that folder. Option-dragging avoids a macOS sandbox error that can occur with command-line copies. -
Restart MarkEdit.
The extension targets the current MarkEdit API and requires a MarkEdit release that provides userSettings, getFileInfo, getFileContent, and CodeMirror autocomplete.
Add a bibliography field to the YAML front matter:
---
title: "My Paper"
bibliography: references.bib
---
Previous work discusses this problem [@smith2024].Multiple bibliographies are supported:
bibliography:
- references.bib
- ../shared/books.bibRelative paths are resolved from the Markdown document. Save a new document before using a relative bibliography path.
MarkEdit's settings.json can provide fallback bibliography files. Open the settings file from MarkEdit's customization menu and add:
{
"extension.markeditCitations": {
"bibliography": ["~/Documents/references/library.bib"],
"compactCitations": true,
"maxResults": 100,
"reloadIntervalMs": 1500,
"showOnEmptyQuery": true
}
}Document bibliographies and configured global bibliographies are combined. Duplicate citation keys use the last occurrence.
The extension checks file modification times and reloads changed bibliographies. Use Extensions → Citations → Reload Bibliographies to force an immediate reload or Bibliography Status to see resolved paths and warnings.
If the bibliography lives outside the document folder, grant MarkEdit access using File → Grant Folder Access.
- Scalar and list-form
bibliographyYAML fields - Relative, absolute,
~/, andfile://local paths - Multiple
.bibfiles - BibTeX and common BibLaTeX entry fields
- Braced and quoted values, string macros, and
#concatenation - Citation search by key, author, year, and title
- Automatic reload after bibliography changes
- Suppression inside email addresses
- Compact parenthetical, narrative, locator, and clustered citation display
The compact display is editor-only and never changes the Markdown source.
Requires Node.js 20 or later:
npm ci
npm run checkThe installable single-file build is written to dist/markedit-citations.js.
MIT