Roman Numerals

unlisted

by olivermichaelphillips

Show Roman numerals in headings and lists as true numeral characters (Ⅰ Ⅱ Ⅲ), either on screen only or written into the note.

Updated 1mo agoMIT
View on GitHub

Roman Numerals for Obsidian

Write ## IV. Methods and see ## Ⅳ. Methods.

Typing a heading in Obsidian: IV. becomes Ⅳ. once the cursor moves on

Unicode has its own characters for Roman numerals (Ⅰ Ⅱ Ⅲ Ⅳ Ⅴ Ⅵ Ⅶ Ⅷ Ⅸ), separate from the letters I, V and X. This plugin shows your numerals as those characters in a serif face, so section numbers stand apart from ordinary text the way they do in academic writing.

Why I built this

Academic papers, textbooks and formal reports have long numbered their sections with Roman numerals: Ⅰ. Introduction, Ⅱ. Methods, Ⅲ. Results. The numeral tells you at a glance that this is a section, not a quantity, a step or a list item. I wanted my Obsidian notes to read the same way, with the structure kept separate from the numbers in the text.

Obsidian has no way to do this, and as far as I know no existing plugin does it either. Typing IV in a note gives you the letters I and V, which look like any other word, and numbered lists only come as 1, 2, 3. Unicode does have proper numeral characters, but they aren't on any keyboard, so typing them means copying and pasting or looking up codes, which breaks the flow of writing.

So this plugin lets you type ordinary letters and see real numerals in Obsidian. Your notes stay plain Markdown that reads correctly in any other app, and Obsidian shows them with the formal headings and lists used in academic work.

Two modes

The same note as written and as shown

Render (default)Write
What's in the fileIV., plain lettersⅣ., the numeral character
What you seeⅣ.Ⅳ.
Without the pluginReads as normal textStill shows Ⅳ, in any app
EditingThe letters reappear under the cursorUndo straight after a conversion brings the letters back

Pick one under Settings → Roman Numerals → Mode. The plugin needs Obsidian 1.13 or later and works on desktop and mobile. Source mode always shows the file exactly as written.

What counts as a numeral

The pronoun I and the maths X are everywhere, so the rules are strict. A numeral is recognised only:

  • at the start of a heading or list item: # I. Introduction, - II) Point, - [ ] III. Task, including inside blockquotes and callouts
  • followed by a delimiter and a space (or the end of the line). The default delimiters are . and ).

Or anywhere, when you mark it: see part {IV}. The markers are hidden in render mode and removed in write mode.

You writeBecomes
# I. Introduction# Ⅰ. Introduction
- VIII) Point- Ⅷ) Point
See part {VII}See part Ⅶ
# I think sounchanged, no delimiter
him and I.unchanged, not at the start of a heading or list
- I.e. thisunchanged, no space after the delimiter
- X. Axisunchanged, a lone X is never a numeral
`{IV}`, $x = {IV}$unchanged, code and maths are skipped, as are code blocks and frontmatter

This version covers one to nine (I to IX). A lone X is never converted, only the exact token IX.

Numbered lists

Set Numbered lists to Uppercase or Lowercase to show an ordinary numbered list with numerals:

1. First point      →   Ⅰ. First point      or   ⅰ. First point
2. Second point     →   Ⅱ. Second point     or   ⅱ. Second point

Lowercase pairs well with uppercase headings, as in academic outlines.

This is always on screen only, in both modes. Your note keeps 1. and 2., so every Markdown app still sees a numbered list. Numbers from 10 on stay as numbers. Numbered lists in Reading view haven't been tested on iPhone or iPad yet.

Write mode

  • As you type: a heading or list numeral converts when you type the space after its delimiter. A marked numeral converts when you type the closing marker. Each conversion is its own undo step.
  • Commands (in either mode, from the command palette):
    • Write numeral characters into this note converts everything the rules recognise.
    • Change numeral characters in this note back to letters turns every Ⅰ–Ⅸ back into I–IX, so you can switch back to render mode at any time.

Search matches what is in the file, so in write mode search for Ⅳ rather than IV.

Settings

SettingDefault
ModeRenderRender or write
Convert as you typeOnWrite mode only
HeadingsOnRecognise numerals at the start of headings
List itemsOnRecognise numerals at the start of list items
Delimiters.)Characters that must follow a heading or list numeral
MarkersOnRecognise marked numerals anywhere
Marker prefix / suffix{ / }Both are needed, and can't contain I, V or X
Include IXOnRecognise IX as nine
LowercaseOffAlso recognise i., ii. … as ⅰ ⅱ …
Numbered listsOffShow 1. to 9. in numbered lists as Ⅰ. to Ⅸ. (uppercase) or ⅰ. to ⅸ. (lowercase)

Reading view picks up setting changes the next time a note is opened.

Styling

Numeral characters, written or rendered, carry the roman-numeral class and use a serif font by default. To choose another font, add a CSS snippet:

body {
	--roman-numeral-font: "EB Garamond", serif;
}

Installing

Until it is in the community list, either add olivermichaelphillips/obsidian-roman-numerals to BRAT, or download main.js, manifest.json and styles.css from the latest release into <vault>/.obsidian/plugins/roman-numerals/, then turn the plugin on under Settings → Community plugins.

Development

You need Node 22.18 or later, which runs the TypeScript tests directly.

npm install
npm run dev     # rebuilds main.js on every change
npm test        # the recognition rules, using Node's built-in test runner
npm run build   # type-check and production build

The code is in four small files:

  • src/numerals.ts holds every recognition rule as plain string functions, with no Obsidian imports, so the tests cover exactly what both modes use.
  • src/render.ts draws numerals in Live Preview and Reading view.
  • src/write.ts converts as you type and applies the commands.
  • src/settings.ts is the settings tab.

src/main.ts connects them.

Licence

MIT

For plugin developers

Search results and similarity scores are powered by semantic analysis of your plugin's README. If your plugin isn't appearing for searches you'd expect, try updating your README to clearly describe your plugin's purpose, features, and use cases.