Sigma

approved

by monesga

Use notes as calculation sheets.

27 stars4,762 downloadsUpdated 3y agoMIT
View on GitHub

Obsidian Sigma

Obsidian is a great markdown-based note taking app. One of the key aspects of Obsidian is it's extensibility by using additional plugins.

Sigma is a plugin to enable using blocks within a note as calculation sheets.

Features

  • Calculation expressions with proper operator precedence
  • Automatic block level totals
  • Support for multiple blocks in a single note
  • Hierarchy and subtotals
  • Variable assignment and evaluation
  • Built in scientific functions
  • Control over output number formatting
  • Output in clean HTML tables for easy sharing
  • Syntax coloring for expressions in output including dark theme
  • Supported on desktop and mobile

Usages

  • Financial planning,
  • Expense tracking,
  • Conversions,
  • Miscllaneous calculations,
  • And much more

Installation

  • Install the Sigma plugin from the Obsidian community plugins list

Guide

  • Use a code block (3 backquote characters) with a type sigma
  • Write expressions on each line
  • Each expression is evaluated
  • All expressions in a block are totaled
  • Once you exit the block (editing cursor moves out, or switch to read mode), the block is rendered as an HTML table with expression values and block totals

Exampels

Simple Calculation List

```sigma
12+3+5
13+9+44
2+3*4
2*3+4
2*(3+4)
```

Produces

112+3+520
213+9+4466
32+3*414
42*3+410
52*(3+4)14
124

Word and Value

You can use a word as a prefix for an expression, separated by a colon character :

```sigma
test1: 12/3
test2: 98.7
```

Produces

1test1: 12/34
2test2: 98.798.7
102.7

Words and Expressions

You can also use multiple words in a sentence as a prefix, however, you cannot embed numbers or other special characters within the sentence.

```sigma
multipe word sentence: 7+9
word1
word2: 2*9
```

Produces

1multipe word sentence: 7+916
2word10
3word2: 2*918
34

Negative Values

```sigma
-234
```

Produces

1-234-234

Hierarchy

Create hierarchies by using space indentation in code blocks. Sigma automatically adds all sub-items to the parent line

```sigma
Cat1
 Item1: 5
 Item2: 6
Cat2
 Item3: 7
 Item4: 8
```

Produces

1Cat111
2....Item1: 55
3....Item2: 66
4Cat215
5....Item3: 77
6....Item4: 88
26

Assignment and variable

Variables can be evaluated later within the block

```sigma
someVar = 200;
someVar * 10;
```

Produces

1someVar=200;200
2someVar*10;2,000
2,200

Built-in Functions

A number of scientific functions are built-in

```sigma
PI=3.141592276
sin(PI/4)
cos(PI/2)
tan(PI/4)
asin(1)
acos(0)
atan(0.7)
abs(2-4)/(2-4)
clamp(29,0,1)
```

Produces

1PI=3.1415922763.142
2sin (PI/4)0.707
3cos (PI/2)0
4tan (PI/4)1
5asin (1)1.571
6acos (0)1.571
7atan (0.7)0.611
8abs (2-4)/(2-4)-1
9clamp (29,0,1)1
8.601

Line References

Even without explicitly naming a variable, each line is automatically referenceable by using Line and the line number

```sigma
Header1
 Value1: 1
 Value2: 2
Line1+6
```

Produces

1Header13
2.....Value1: 11
3.....Value2: 22
4Line1+69
12

Complex Expressions

You can use parenthesis for compound expressions as you would expect in a programming language.

```sigma
abs(12-3)/(12-3)+9
```

Produces

1abs (12-3)/(12-3)+910

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.