Skip to content

chr-werner/bib2md

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bib2md

Sync BibLaTeX bibliography metadata into Obsidian Markdown note frontmatter.

Given a .bib file and a directory of Markdown notes, bib2md converts each bibliography entry into structured YAML and merges it into the frontmatter of the matching note. Authors are formatted as Obsidian wiki-links ([[First Last]]), groups become tags, and keywords become a list.

bib2md — Requirements

bib2md — Installation

pip install -r requirements.txt

bib2md — Usage

python bib2md.py <bib_file> <yaml_file> <md_directory>
Argument Description
bib_file Path to the source .bib file
yaml_file Path for the intermediate YAML file (created and deleted automatically)
md_directory Root directory containing your Markdown notes
python bib2md.py library.bib /tmp/library.yaml ~/obsidian/vault/papers/

Note matching

Each Markdown file is matched to a bibliography entry by filename. The leading @ and file extension are stripped, and the name is lowercased before lookup.

Filename Matched entry key
@doe2024.md doe2024
@Einstein1905.md einstein1905

Files with no matching entry are skipped with a warning.

Frontmatter behaviour

  • Scalar fields (title, year, journal, …) are created or overwritten.
  • List fields (authors, tags, keywords) are merged — existing entries are kept and only new unique values are appended.

Example output frontmatter:

title: On the Electrodynamics of Moving Bodies
authors:
  - "[[Albert Einstein]]"
year: 1905
tags:
  - physics
  - relativity
keywords:
  - special relativity
  - electrodynamics

Running tests

pytest

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages