{"id":13666107,"url":"https://github.com/krassowski/jupyterlab-citation-manager","last_synced_at":"2025-10-04T21:38:04.808Z","repository":{"id":37004394,"uuid":"385070689","full_name":"krassowski/jupyterlab-citation-manager","owner":"krassowski","description":"Citation Manager for JupyterLab using Zotero Web API","archived":false,"fork":false,"pushed_at":"2024-07-10T08:49:26.000Z","size":4993,"stargazers_count":71,"open_issues_count":36,"forks_count":2,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-13T04:05:30.576Z","etag":null,"topics":["bibliography","citations","jupyterlab-extension","zotero"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/krassowski.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-07-11T23:15:13.000Z","updated_at":"2025-03-10T16:44:35.000Z","dependencies_parsed_at":"2024-01-14T20:53:35.864Z","dependency_job_id":null,"html_url":"https://github.com/krassowski/jupyterlab-citation-manager","commit_stats":{"total_commits":112,"total_committers":4,"mean_commits":28.0,"dds":0.1517857142857143,"last_synced_commit":"351f616fe6b8532674729d55bee7f584802d660e"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krassowski%2Fjupyterlab-citation-manager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krassowski%2Fjupyterlab-citation-manager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krassowski%2Fjupyterlab-citation-manager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krassowski%2Fjupyterlab-citation-manager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/krassowski","download_url":"https://codeload.github.com/krassowski/jupyterlab-citation-manager/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248661707,"owners_count":21141450,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bibliography","citations","jupyterlab-extension","zotero"],"created_at":"2024-08-02T06:00:58.115Z","updated_at":"2025-10-04T21:37:59.758Z","avatar_url":"https://github.com/krassowski.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# jupyterlab-citation-manager\n\n[![Github Actions Status](https://github.com/krassowski/jupyterlab-citation-manager/workflows/Build/badge.svg)](https://github.com/krassowski/jupyterlab-citation-manager/actions/workflows/build.yml)\n![CodeQL](https://github.com/krassowski/jupyterlab-citation-manager/workflows/CodeQL/badge.svg)\n[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/krassowski/jupyterlab-citation-manager/main?urlpath=lab)\n[![PyPI version](https://img.shields.io/pypi/v/jupyterlab-citation-manager.svg)](https://pypi.org/project/jupyterlab-citation-manager/)\n\n**Status: Work In Progress**. Not ready for production environments, may contains bugs.\nFeedback on any aspect of this extension is welcome.\n\nCitation Manager for JupyterLab:\n\n- enables adding citations to Jupyter notebooks in Markdown cells,\n- keeps the bibliography in sync with the citations in the document,\n- supports thousands of citation styles,\n- offers a way to efficiently search through your collection of references,\n- integrates with the Zotero® service (Connector for Zotero) by default,\n- is modular in design, allowing for integration of other reference managers in the future.\n\nThe data of each reference (a.k.a. _citable item_) is stored in the notebook metadata,\nwhile a mapping between citation ID and the citable items is stored in the cell metadata.\n\n- storing full data of each citable item in the notebook enables:\n  - collaboration between multiple users with separate Zotero collections,\n  - retaining the data for citation which got removed from private collection.\n- storing mapping between citation and citable items in the cell metadata allows to copy cells between notebooks.\n\n## Usage\n\n### Authenticate with Zotero\n\nTo enable you to access your reference list you will need to obtain an access API key [from your Zotero account](https://www.zotero.org/settings/keys/new).\nThe most basic, read-only key is sufficient (and recommended). The key will be stored in your settings, so you will only need to enter it once.\n\n### Insert citation\n\nInsert citation by clicking on the insert citation button in the toolbar of your notebook (![add citation icon][book-plus]) or pressing \u003ckbd\u003eAlt\u003c/kbd\u003e + \u003ckbd\u003eC\u003c/kbd\u003e (hint: shortcut are customizable in Advanced Settings Editor).\nStart typing to filter references by title, authors or year.\n\n![animation of inserting citations][add-citation]\n\n### Insert bibliography\n\nInsert bibliography by clicking on the (![add bibliography icon][book-open-variant]) or pressing \u003ckbd\u003eAlt\u003c/kbd\u003e + \u003ckbd\u003eB\u003c/kbd\u003e.\n\n![animation of inserting bibliography][add-bibliography]\n\n### Change style\n\nTo change the citation style go to the sidebar (![sidebar icon][bookshelf]) and click on (![change style icon][palette]) or press \u003ckbd\u003eAlt\u003c/kbd\u003e + \u003ckbd\u003eS\u003c/kbd\u003e.\nOnly a subset of generic styles will be shown initially; start typing a name to find more specialised styles.\n\n![animation of changing style][change-style]\n\n### Synchronise references\n\nTo synchronise your collection of references go to the sidebar (![sidebar icon][bookshelf]) and click on (![refresh collection icon][refresh]) or press \u003ckbd\u003eAlt\u003c/kbd\u003e + \u003ckbd\u003eU\u003c/kbd\u003e.\nUpdating can take a few seconds; a progress bar will appear on the status bar to keep you updated (if you have it enabled).\n\n### Explore your collection\n\nTo get the details on references in your collections without leaving JupyterLab open the sidebar (![sidebar icon][bookshelf]),\nand start typing to find item of interest. You will be able to preview the abstract, check metadata and even\nopen the article inside JupyterLab (or in a new browser tab - depending on your preference).\n\nReferences with citations in the current document will be show on top when opening the explorer\nand enable a quick preview of citation context and navigation to the relevant place in the document\n(by clicking on the citation context).\n\n### Auto-migrate existing citations\n\nWhen opening a notebook, the extension will automatically detect citations in the following formats:\n\n- cite2c, e.g. `\u003ccite data-cite=\"itemID\"\u003e\u003c/cite\u003e` with associated notebook-level metadata,\n- DOI-links, e.g. `[(Krassowski et al, 2021)](https://doi.org/10.3389/fcell.2021.626821)`\n  (the parentheses in the link label are used as an indicator distinguishing citations from non-citation DOI links)\n\nand ask for your permission to migrate them to Citation Manager format.\nOnly citations inside of markdown cells will be detected.\n\nThe migrated citations are stored separately from the citations from other providers (such as Zotero),\nunless an exact match for given ID, DOI, URL or title and list of authors is found among items available\nfrom reference providers (like Zotero), in which case the item from the provider is used.\n\n![animation of migrating from cite2c and from DOIs][migrate-gif]\n\n### Exporting to LaTeX\n\nCitation Manager supports LaTeX as one of the output formats. For now the citations are embedded as plain-text,\nwhile the bibliography uses semantic `thebibliography` LaTeX environment.\nTo configure notebook to export citations to LaTeX:\n\n1. Go to `Advanced Settings Editor` -\u003e `Citation Manager` and change the default `outputFormat` to `latex`.\n2. Insert bibliography in a cell, but instead of using `Markdown` cell, use `Raw` cell\n3. Open `Property Inspector` sidebar and change `Raw NBConvert Format` to `LaTeX` (you need to have the `Raw` cell selected for the dropdown to appear)\n4. From `File` menu select `Save and Export Notebook As…` and choose `LaTeX`\n5. Compile the resulting `.tex` to desired output such as PDF with preferred tool (e.g. `pdflatex` on Linux)\n\n![LaTeX setup overview][latex-setup]\n\n[bookshelf]: https://raw.githubusercontent.com/krassowski/jupyterlab-citation-manager/main/style/icons/bookshelf.svg?sanitize=true\n[book-open-variant]: https://raw.githubusercontent.com/krassowski/jupyterlab-citation-manager/main/style/icons/book-open-variant.svg?sanitize=true\n[book-plus]: https://raw.githubusercontent.com/krassowski/jupyterlab-citation-manager/main/style/icons/book-plus.svg?sanitize=true\n[palette]: https://raw.githubusercontent.com/krassowski/jupyterlab-citation-manager/main/style/icons/palette.svg?sanitize=true\n[refresh]: https://raw.githubusercontent.com/krassowski/jupyterlab-citation-manager/main/style/icons/refresh.svg?sanitize=true\n[add-citation]: https://raw.githubusercontent.com/krassowski/jupyterlab-citation-manager/main/docs/images/add-citation.gif\n[add-bibliography]: https://raw.githubusercontent.com/krassowski/jupyterlab-citation-manager/main/docs/images/add-bibliography.gif\n[change-style]: https://raw.githubusercontent.com/krassowski/jupyterlab-citation-manager/main/docs/images/change-style.gif\n[migrate-gif]: https://raw.githubusercontent.com/krassowski/jupyterlab-citation-manager/main/docs/images/migrate-cite2c-and-doi.gif\n[latex-setup]: https://raw.githubusercontent.com/krassowski/jupyterlab-citation-manager/main/docs/images/latex.png\n\n## Requirements\n\n- JupyterLab \u003e= 3.3\n- Modern browser (with ES 2019 support, e.g. Firefox 64+, or Chrome 73+)\n- [Zotero account](https://www.zotero.org/user/register)\n\n## Install\n\nTo install the extension, execute:\n\n```bash\npip install jupyterlab-citation-manager\n```\n\n## Uninstall\n\nTo remove the extension, execute:\n\n```bash\npip uninstall jupyterlab-citation-manager\n```\n\n## Advanced Usage\n\n### Citation clusters\n\nThis extension enables creation of citation clusters, this is a group of citations that are rendered together,\nfollowing the chosen citation style. You can create a citation cluster manually by editing cell metadata.\n\nSupport for creation and edition of citation cluster from the graphical interface is planned.\n\n### Citation styles\n\nThis extension includes thousands citation styles form the\n[official repository][csl-repository] of\n[Citation Language Styles][csl] (CSL) project.\n\nIf you want to add a custom citation style, you can do so by placing a `.csl` file in `csl-styles` folder in one of the `data` locations as returned by:\n\n```bash\njupyter --paths\n```\n\nThe `.csl` file should follow CSL v1.0.1 specification (see [official CSL specification](https://docs.citationstyles.org/en/stable/specification.html)).\n\n#### Example\n\nIf `jupyter --paths` looks like:\n\n```\nconfig:\n    /home/your_name/.jupyter\n    /usr/local/etc/jupyter\n    /etc/jupyter\ndata:\n    /home/your_name/.local/share/jupyter\n    /usr/local/share/jupyter\n    /usr/share/jupyter\nruntime:\n    /home/your_name/.local/share/jupyter/runtime\n```\n\nand you want to add your modified version of APA style, you would put `my-custom-apa.csl` in `/home/your_name/.local/share/jupyter/csl-styles` (you will need to create this folder), so that the final structure looks similar to:\n\n```\n/home/your_name/.local/share/jupyter\n├── csl-styles\n│   └── my-custom-apa.csl\n├── nbsignatures.db\n├── notebook_secret\n└── runtime\n```\n\n## Contributing\n\n### Development install\n\nNote: You will need NodeJS to build the extension package.\n\nThe `jlpm` command is JupyterLab's pinned version of\n[yarn](https://yarnpkg.com/) that is installed with JupyterLab. You may use\n`yarn` or `npm` in lieu of `jlpm` below.\n\n```bash\n# Clone the repo to your local environment\n# Change directory to the jupyterlab-citation-manager directory\n# Fetch build requirements\njlpm run bootstrap\n# Install package in development mode\npip install -e .\n# Link your development version of the extension with JupyterLab\njupyter labextension develop . --overwrite\n# Rebuild extension Typescript source after making changes\njlpm run build\n```\n\nYou can watch the source directory and run JupyterLab at the same time in different terminals to watch for changes in the extension's source and automatically rebuild the extension.\n\n```bash\n# Watch the source directory in one terminal, automatically rebuilding when needed\njlpm run watch\n# Run JupyterLab in another terminal\njupyter lab\n```\n\nWith the watch command running, every saved change will immediately be built locally and available in your running JupyterLab. Refresh JupyterLab to load the change in your browser (you may need to wait several seconds for the extension to be rebuilt).\n\nBy default, the `jlpm run build` command generates the source maps for this extension to make it easier to debug using the browser dev tools. To also generate source maps for the JupyterLab core extensions, you can run the following command:\n\n```bash\njupyter lab build --minimize=False\n```\n\n### Development uninstall\n\n```bash\npip uninstall jupyterlab-citation-manager\n```\n\nIn development mode, you will also need to remove the symlink created by `jupyter labextension develop`\ncommand. To find its location, you can run `jupyter labextension list` to figure out where the `labextensions`\nfolder is located. Then you can remove the symlink named `jupyterlab-citation-manager` within that folder.\n\n### Updating citation styles\n\nThe citation styles are retrieved from the CSL repository using git submodules\nand reside in the [jupyterlab-citation-data](https://github.com/krassowski/jupyterlab-citation-data) repository.\n\nYou can update the submodule to fetch the most recent citation styles:\n\n```bash\n# fetch the latest styles from the currently tracked CSL version branch\ngit submodule update csl-styles\n# store the information about the most recent commit in version control\ngit commit csl-styles\n```\n\nTo update the version branch:\n\n```bash\n# replace v1.0.1 with the version to track\ngit submodule set-branch --branch v1.0.1 csl-styles\ngit commit csl-styles\n```\n\n### Legal notes\n\n#### Connector for Zotero\n\nZotero is a registered trademark of the [Corporation for Digital Scholarship](http://digitalscholar.org/);\nour extension (Connector for Zotero) is not affiliated with the Corporation in any way.\n\n#### CSL styles\n\nThe CSL styles are contributed by individual authors to the [CSL project][csl];\nall the styles distributed with this extension come from the [Citation Language Styles][csl-repository]\nand are released under the [Creative Commons Attribution-ShareAlike 3.0 Unported license][cc-by-sa-3.0].\n\n[csl]: https://citationstyles.org/\n[csl-repository]: https://github.com/citation-style-language/styles\n[cc-by-sa-3.0]: https://creativecommons.org/licenses/by-sa/3.0/\n\n#### Icons\n\nPlease see the [`style/icons/README.md`](https://github.com/krassowski/jupyterlab-citation-manager/blob/main/style/icons/README.md)\nfor information on the creators and licences of icons included in the distribution.\n\n### citeproc-js\n\n`jupyterlab-citation-manager` uses `citeproc-js` to format citations and bibliography text; `citeproc-js` is\ndual-licenced under CPAL 1.0 (or newer) or AGPLv3 (or newer); in order to allow for the distribution of this extension\nwith other works the CPAL 1.0 licence was adopted for re-distribution of `cireproc-js` together with this extension.\nThe Exhibit A of `citeproc-js` CPAL 1.0 licence is presented below for informational purposes:\n\n\u003e EXHIBIT A. Common Public Attribution License Version 1.0.\n\u003e “The contents of this file are subject to the Common Public Attribution License Version 1.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://opensource.org/license/cpal_1-0/ The License is based on the Mozilla Public License Version 1.1 but Sections 14 and 15 have been added to cover use of software over a computer network and provide for limited attribution for the Original Developer. In addition, Exhibit A has been modified to be consistent with Exhibit B.\n\u003e Software distributed under the License is distributed on an “AS IS” basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.\n\u003e The Original Code is citeproc-js.\n\u003e The Original Developer is not the Initial Developer and is `________`. If left blank, the Original Developer is the Initial Developer.\n\u003e The Initial Developer of the Original Code is Frank Bennett. All portions of the code written by Frank Bennett are Copyright (c) 2009-2015. All Rights Reserved.\n\u003e Contributor `___________`.\n\u003e Alternatively, the contents of this file may be used under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE (the AGPLv3 License), in which case the provisions of AGPLv3 License are applicable instead of those above.\n\u003e If you wish to allow use of your version of this file only under the terms of the AGPLv3 License and not to allow others to use your version of this file under the CPAL, indicate your decision by deleting the provisions above and replace them with the notice and other provisions required by the AGPLv3 License. If you do not delete the provisions above, a recipient may use your version of this file under either the CPAL or the AGPLv3 License.”\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkrassowski%2Fjupyterlab-citation-manager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkrassowski%2Fjupyterlab-citation-manager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkrassowski%2Fjupyterlab-citation-manager/lists"}