Numerals

by RyanC
5
4
3
2
1
Score: 65/100

Description

Category: Coding & Technical Tools

The Numerals plugin is a powerful tool that enables users to perform mathematical calculations and insert the results into their Obsidian notes. With this plugin, you can write complex math expressions in Markdown code blocks and evaluate them instantly. The plugin also offers advanced features such as result annotation, autocompletion of functions and variables, and style settings for customization. Additionally, Numerals supports mapping currency symbols to different currencies and allows users to specify the format of rendered results. Overall, this plugin is an excellent choice for anyone who needs to perform complex calculations or visualize data in their Obsidian notes.

Reviews

No reviews yet.

Stats

613
stars
64,202
downloads
19
forks
1,244
days
6
days
343
days
38
total PRs
3
open PRs
5
closed PRs
30
merged PRs
106
total issues
30
open issues
76
closed issues
40
commits

Latest Version

a year ago

Changelog

🚀 Numerals 1.5.5 - May '25 Update 🚀

🎉 Restarting development after a bit of a hiatus!

1.5.5 adds two new features, @hideRows and @prev!

  • @prev: Refer to the result in the preview row (similar to the prev token in Numi)
    • Plays nice with @sum or @total
  • Adds @hideRows, a new "directive" (i.e. a Numerals-specific command starting with @)
    • A math block with @hideRows on a row (with nothing else), will only render lines that have => at the end of them ("result annotation")

image

README file from

Github

Numerals Obsidian Plugin

Obsidian Downloads GitHub release (latest by date) GitHub release (latest by date including pre-releases)

Numerals gives you the power of an advanced calculator inside a math code block, complete with currencies, units, variables, and math functions! Now you can perform calculations inline with your notes, and see both the input and the evaluated result. Numerals works with Live Preview as well as Reader view, and offers TeX-style rendering or Syntax Highlighting as well as auto-completion suggestions. Comments or explanations can be added with #, and important results can be indicated with => after the calculation. Numerals Lemonade Stand - Side by Side Numerals Tex Example

To get started, simply install and enable the plugin. Add a math code block with your desired calculations:

```math
20 mi / 4 hr to m/s
```

Features

  • Units
    • 1ft + 12in2ft
    • 20 mi / 4 hr to m/s2.235 m / s
    • 100 km/hr in mi/hr62.137 mi / hr
    • 9.81 m/s^2 * 100 kg * 40 m39.24 kJ
  • Currency
    • $1,000 * 22,000 USD
    • £10 + £0.7510.75 GBP
    • $100/hr * 3days7,200 USD
    • Set custom currencies, for example
  • Math functions
    • sqrt, sin, cos, abs, log, etc (see mathjs for full list)
  • Hex, Binary, Octal, and other bases
    • 0xff + 0b100259
    • hex(0xff + 0b100)"0x103"
  • Natural Constants
  • Auto-complete suggestions
    • By default will offer auto-complete suggestions for any variables defined in a math codeblock being edited
    • Optional setting to include all available functions, constants, and physical constants
  • Totals of previous lines using @total or @sum special operator
    • When Numerals encounters @total or @sum it inserts the sum of all previous lines up until the last blank line or comment
  • Previous result
    • Use previous line result in current calculation with @prev
  • Greek Letters
    • Variables can be named using greek letters, e.g. μ = 3 m/s
    • Greek letters can be auto-completed by typing :, e.g. :mu in a math block will offer μ as an auto-complete suggestion
  • Note-Global Variables
    • Any variable name or function definition preceeded by an $ symbol will be made available to all math blocks on a page
  • Fractions:
    • fraction(1/3) + fraction(1/4)7/12
  • Comments and Headings:
    • # at the end of a line will be ignored, but rendered in faint text as a comment
    • A line starting with # will be ignored by the math engine, but will be bolded when rendered
  • Result Annotation:
    • => at the end of a line (but before a comment) will tell Numerals that a result should be highlighted. Any line in that code block without a => annotation will be rendered faintly (or hidden depending on settings).
  • Result Insertion:
    • Using the @[...] syntax (for example: @[profit]), Numerals will insert the results of a calculation into the raw text of your note, following ::
    • Uses dataview notation, which allows writing back to dataview values. For example, @[profit] will be modified to say @[profit::10 USD]
  • Access Frontmatter Properties
    • Numerals math blocks will have access to any property name specified in the numerals: property. Setting numerals to all, will make all properties in a note available to Numerals
    • Multiple properties can be specified as a list, e.g. numerals: [apples, pears] will makes both the apples and pears property available to Numerals
    • Any property in the YAML frontmatter beginning with $ automatically becomes a note-global variable (or function) accessible in every math block on the page
    • Functions can be defined in YAML by name along with their arguments, e.g. $f(x): x+2
  • Cross-note references
    • Reference frontmatter and Dataview metadata from other notes using [[note name]].property, including nested values like [[config]].rates.hourly
    • Works in math blocks and inline calculations, and updates when referenced note metadata changes

Numerals utilizes the mathjs library for all calculations. Numerals implements a preprocessor to allow more human-friendly syntax, such as currency symbols and thousands separators. For all available functions and capabilities (which includes matrices, vectors, symbolic algebra and calculus, etc), see the mathjs documentation

Styling Options

Numerals has been tested with the default theme and most other top themes. It uses default values such that it should play nice with any other theme. There are also several configurable settings to modify how Numerals renders math blocks

Render Style

Numerals supports rendering inputs/ouputs as either:

  1. Plain Text
  2. TeX
  3. Syntax Highlighting

One of these options can either be chosen as a default from Numerals settings, or then can be applied on a per-block basis by using math-plain, math-tex, or math-highlight rather than a math code block.

Numerals Render Style Side by Side

Layout

2-panes
  • Answer is shown to the right of the input with a background color and a separator.
  • Distinctive style that separates input from evaluated answers

Numerals 2 Panes

Answer to the Right
  • Answer to the right: answer is shown in the same line as the input, but right-aligned
  • More subtle than 2-panes that works well with just a few calculations

Numerals answer right

Answer Below
  • Answer is shown below the input, on the next line.
  • Less compact vertically, but more compact horizontally

Numerals answer below

Alternating Row Colors

Choose between a consistent code block background color (left), or alternating rows to help track from input to result (right).

Numerals Alternating Row Style Comparison

Auto-completion Suggestions

By default, Numerals will provide auto-completion suggestions for variables that have been defined in a particular math codeblock. Turning on Include Functions and Constants in Suggestions will also provide suggestions for all functions, math constants, and physical constants supported in Numerals.

Auto-completion of Functions

Format of Numbers in Rendered Results

Numerals allows the user to specify the format of rendered results.

  • System Formatted (Default): Use your local system settings for number formatting (including thousands and decimal separator)
  • Fixed: No thousands separator and full precision. Period as decimal separator (e.g. 100000.1)
  • Exponential: Always use exponential notation. (e.g. 1.000001e5)
  • Engineering: Exponential notation with exponent a multiple of 3. (e.g. 100.0001e3)
  • Formatted: Forces a specific type of formatted notation.
    • Style 1: 100,000.1
    • Style 2: 100.000,1
    • Style 3: 100 000,1
    • Style 4: 1,00,000.1

Installation

Numerals can be found in the Obsidian community plugin list.

Using BRAT

To try the latest features of Numerals before they are released, and provide helpful feedback and testing, try Numerals by using the Obsidian BRAT plugin. All new Numerals features will be pushed to beta testers first.

  1. Ensure BRAT is installed
  2. Trigger the command Obsidian42 - BRAT: Add a beta plugin for testing
  3. Enter this repository, gtg922r/obsidian-numerals
  4. Activate Numerals plugin in community plugin list

Features in progress and roadmap

  • Support for mapping currency symbols to different currencies (#17) both $ and ¥ can be mapped to different currencies in settings
  • Style Settings support for all colors and other style options (#13)
    • Partial support added in 1.0.5
  • Result annotation, similar to Calca feature (#4)
    • Support added in 1.0.5
  • Autocompletion of functions and variable inside math code block (#15)
    • Support added in 1.0.8
  • Inline calculation for inline code blocks (#5)

Feel free to suggest additional features by creating an issue!

Development

Numerals uses a three-stage development workflow: Version → Build → Release

1. Version Management

Update the version number in package.json:

npm run version:patch    # 1.5.1 → 1.5.2
npm run version:minor    # 1.5.1 → 1.6.0  
npm run version:major    # 1.5.1 → 2.0.0
npm run version          # defaults to patch

These commands only update the version in package.json and do not sync to manifests or create releases.

2. Build

Compile the TypeScript and bundle the plugin:

npm run build            # Build for production
npm run dev              # Build for development with watch mode

The build command compiles TypeScript and creates the main.js file that Obsidian loads.

Mathjs Symbol Suggestions

Auto-complete suggestions for mathjs functions and constants are kept as a static list in src/mathjsUtilities.ts. When upgrading mathjs, run npm run symbols:check to compare that list against the installed mathjs documentation metadata.

If the check finds intentional changes, run npm run symbols:update, review the generated diff, and adjust the explicit exclusions in scripts/mathjs-symbols.ts for any documented symbols that should not appear in Numerals suggestions.

3. Release

Create tagged releases that trigger automated GitHub Actions:

Beta Releases
npm run release:beta
  • Creates a timestamped beta version (e.g., 1.5.1-beta.2024-01-15T10-30-00)
  • Updates manifest-beta.json with the beta version
  • Builds the project
  • Creates a git tag and pushes it to trigger GitHub Actions
  • Automatically creates a beta release on GitHub
Production Releases
npm run release:production    # Full command
npm run release              # Shortcut for production
  • Uses the current version from package.json
  • Updates manifest.json and versions.json
  • Builds the project
  • Creates a git tag and pushes it to trigger GitHub Actions
  • Automatically creates a production release on GitHub

Complete Development Workflow

  1. Make changes to the codebase
  2. Test locally with npm run dev
  3. Increment version: npm run version:patch (or minor/major)
  4. Test with beta release: npm run release:beta
  5. Create production release: npm run release

The release scripts handle all manifest syncing, building, tagging, and triggering GitHub Actions for automated release publishing.

There are a number of other plugins that address math and calculation use cases in Obsidian.

There are also a number of "calculator as notes" apps that acted as the inspiration for Numerals. If you are looking for a purpose-built app outside of Obsidian, consider:

Similar Plugins

info
• Similar plugins are suggested based on the common tags between the plugins.
Linter
5 years ago by Victor Tao
An Obsidian plugin that formats and styles your notes with a focus on configurability and extensibility.
Latex Suite
4 years ago by artisticat1
Make typesetting LaTeX as fast as handwriting through snippets, text expansion, and editor enhancements
Quick LaTeX
5 years ago by joeyuping
Code Styler
3 years ago by Mayuran Visakan
A plugin for Obsidian.md for styling codeblocks and inline code
Obsidian Columns
4 years ago by Trevor Nichols
Codeblock Customizer
3 years ago by mugiwara
Codeblock Customizer plugin for Obsidian
Obsidian Math+
4 years ago by Oscar Capraro
This is an Obsidian plugin for taking math notes using Excalidraw.
Math Booster
3 years ago by Ryota Ushio
A powerful indexing & referencing system for theorems & equations in your Obsidian vault.
Latex Environments
5 years ago by Zach Raines
Quickly insert and change latex environments within math blocks in Obsidian.
ABC Music Notation
5 years ago by Til Blechschmidt
Plugin which renders music notations from code blocks
MathLive
3 years ago by Dan Zilberman
The must-have plugin for math in Obsidian
Desmos
4 years ago by Nigecat
Embed graphs directly into your obsidian notes
Function Plot
4 years ago by leonhma
A obsidian.md plugin for rendering maths graphs.
Advanced Codeblock
4 years ago by Lijyze
An obsidian plugin that give additional features to code blocks.
ProgressBar
3 years ago by Wei Zhang
Code block plugin for Obsidian generating a progress bar
Mathpad
3 years ago by Gabriele Cannata
Computer Algebra System (CAS) for Obsidian.md
Embedded Code Title
5 years ago by tadashi-aikawa
It is an Obsidian plugin which can embeds title to code blocks.
Meld Calc
5 years ago by meld-cp
Typst Renderer
3 years ago by fenjalien
Renders typst code blocks in Obsidian into images using Typst through the power of WASM!
Typst Mate
3 months ago by azyarashi
Render math expressions with Typst instead of MathJax in Obsidian.
MLIR Syntax Highlight
3 years ago by Lewuathe
Obsidian matrix
4 years ago by Jonas Mohr
HK Code Block
3 years ago by Heekang Park
Obsidian plugin developed by Heekang Park; Make code block looking good on reading view
Obsidian asciimath
3 years ago by widcardw
Asciimath support for Obsidian (based on asciimath-parser)
Calctex
3 years ago by Mike
An Obsidian plugin for automatic calculation of LaTeX formulas.
No more flickering inline math
3 years ago by Ryota Ushio
No longer disturbed by flickering inline math in Obsidian.
CodeBlock Tabs
3 years ago by Jemin Mau
Create tab group for contiguous codeblocks.
Collapsible Code Blocks
a year ago by Bradley Wyatt
Obsidian Plugin that makes code blocks collapsible in reading and edit view as well as enabling scroll-able code blocks.
CSV Codeblock
2 years ago by elrindir
Plugin for obsidian to render csv syntax in codeblocks.
Todo.txt Codeblocks
3 years ago by Benjamin Nguyen
Manage your tasks inside Obsidian codeblocks according to the Todo.txt specification.
Latex Matrices
3 years ago by Daniele Susino
An obsidian plugin to create latex matrices.
Auto-\displaystyle Inline Math
2 years ago by Ryota Ushio
An Obsidian.md plugin to automatically make all inline maths \displaystyle.
Minitabs
2 years ago by ssjy1919
Obsidian tabs
Codeblock Template
3 years ago by Super10
A template plugin that allows for the reuse of content within Code Blocks!一个可以把Code Block的内容重复利用模板插件!
Mathematica Plot
2 years ago by Marcos Nicolau
Insert functions on Obsidian using Wolfram Mathematica!
MathLive in Editor Mode
2 years ago by MizarZh
MathLive input in editor mode.
Math Indicator Changer
2 years ago by Ori Replication
Calculite
10 months ago by Holo
Standard calculator plugin for Obsidian.
MathType
a year ago by slateblua
Type math faster
YAML Table
a year ago by dainakai
LaTeX Panel Helper
5 months ago by Luster
A powerful and convenient LaTeX symbol panel for Obsidian to enhance your mathematical and scientific note-taking efficiency.
Command Line
a year ago by Steven Stallion
Copy command lines from your notes to the clipboard.
Code Blocks commands
8 months ago by dragonish
Provide commands to insert code blocks with markup, and support triggering commands with backticks.
IMSwitch in Math Block
a year ago by XXM
Replace Pencil
10 months ago by penyt
🐧 An obsidian plugin that can easily replace the custom variable in the code block.
Project Euler Stats
a year ago by Artem Korsakov
Get statistics from Project Euler.
Quick Matrix
5 months ago by Charlie Flowe
Plugin for Obsidian.md that allows for faster interactions with matrices in LaTeX
Segerlab
a month ago by Semyon Kononchuk
Renders calculator views within notes from JSON data copied from the Segerlab app.