Lenin68 downloadsGraph functions, systems, derivatives and integrals in interactive blocks.
LMath is an Obsidian plugin for graphing functions, systems of equations, derivatives and integrals directly inside your notes: each block shows the formula rendered in LaTeX (KaTeX) on the left, and an interactive Cartesian plane (pan, zoom, crosshair, rail mode) on the right.
| Block | What it graphs |
|---|---|
```obs-graph |
A single function or curve: explicit y=f(x), implicit F(x,y)=0, parametric (x(t), y(t)) or polar r(θ). |
```obs-system |
Several equations (one per line, or LaTeX \begin{cases}…\end{cases}), each with its own color, plus the solutions of the system (intersections between curves). |
```obs-derivate |
Differentiates f(x) symbolically and graphs only the derivative f'(x). |
```obs-integral |
Definite integral \int_a^b f\,dx: graphs the integrand, shades the region between a and b and shows the signed area (and the antiderivative, when the built-in integrator covers it). |
x and f(x) in real time, with a marker on the curve.π, √, ×, ÷, ², ³, θ, ∞) and standard mathematical notation.|x|, \left|…\right|, abs(x)), the six inverse trigonometric functions and step functions (⌊x⌋, ⌈x⌉).y either manually or optionally automatically (see Settings).
r(θ) notation in the panel and its corresponding geometry on the plane.main.js, manifest.json and styles.css from the latest release.lmath folder inside <your-vault>/.obsidian/plugins/.git clone https://github.com/LubrieDev/lmath.git
cd lmath
npm install
npm run build
Copy the generated main.js (along with manifest.json and styles.css) to your vault's plugins folder.
Write a function; if you write a full equality the plugin automatically takes the right-hand side (y = …, or a single-letter function label such as f(x) = …).
```obs-graph
f(x) = sin(x) * 2
```
Implicit, parametric and polar:
```obs-graph
x^3 + y^3 = 9
```
```obs-graph
x(t) = 5*cos(t) - cos(5*t)
y(t) = 5*sin(t) - sin(5*t)
```
```obs-graph
r = sin(3*theta)
```
One equation per line; each one takes its own color, and the solutions (intersections) between them are marked.
```obs-system
y = x + 1
y = -x^2 + 3
```
You only write f(x); the block differentiates and graphs f'(x).
```obs-derivate
x^3 - 2*x
```
LaTeX input with the limits of integration.
```obs-integral
\int_{0}^{2} x^2 \, dx
```
Vertical asymptote:
```obs-graph
1/(x-2)
```
Absolute value:
```obs-graph
|x^2 - 4|
```
Inverse trigonometric function:
```obs-graph
arctan(x)
```
Root of an arbitrary index:
```obs-graph
\sqrt[3]{x}
```
Nested exponent (rendered and evaluated as x⁹):
```obs-graph
x^{3^{2}}
```
| Action | Effect |
|---|---|
| Move the cursor | Shows a crosshair with x and f(x) in real time |
| Bring the cursor near a notable point | Shows a coordinate label (x, y) |
| Drag | Moves the view (pan) |
| Mouse wheel | Zoom in/out centered on the cursor |
| ⌖ button (rail mode, when the curve is walkable) | Walk along the curve with the keyboard, jumping between branches at asymptotes |
In obs-system, the color button per equation |
Choose which curve the crosshair/rail follows |
In periodic functions such as sin(x) or tan(x), the roots and vertices are infinite and are not drawn individually. Instead, an ⓘ button appears in the corner of the graph and shows a summary when clicked.
If the function does not produce any real value (for example sqrt(-1) or log(x)/log(1)), the plane is dimmed with a label indicating the cause: Not defined over ℝ, Undefined, Indeterminate, among others. Zoom and pan remain active.
An empty block shows the message No function instead of an error.
The plugin normalizes different formats before evaluating them with mathjs. This applies to all four blocks, which share the same parser.
| Type | Examples |
|---|---|
| Unicode | π, √, ∛, ∜, ×, ÷, ², ³, θ, ∞, ⌊x⌋, ⌈x⌉ |
| LaTeX | \frac{1}{2}, x^{2}, \sqrt{x}, \sqrt[3]{x}, \sin{x}, \log_{2}{x}, `\left |
| Standard | sin(x), cos(x), log(x, 2), sqrt(x), abs(x) |
| Inverse | arcsin(x), sin⁻¹(x), asin(x) (and their analogues for cos, tan, csc, sec, cot) |
⚠️ Trigonometry (degrees vs. radians): if the argument is a literal number (e.g.
sin(30)), it is interpreted in degrees; if the argument contains a variable (e.g.sin(x)), it is evaluated in radians.
Roots of any index: the \sqrt[n]{x} notation is supported for cube, fourth, fifth roots, and so on. Odd-index roots with a negative radicand return the real value (e.g. \sqrt[3]{-8} = -2).
Absolute value: |x|, \left|x\right| and abs(x) are all accepted.
Inverse trigonometric functions: arccsc, arcsec and arccot are not native to mathjs; the plugin implements them as real-domain wrappers.
Component-wise parametric curves: x(t)=… and y(t)=… on separate lines are merged into a single curve; a lone component also graphs, respecting the axis it declares (y(t)=… gives the classic graph, x(t)=… comes out lying on its side).
Unrecognized symbol: an unknown LaTeX command (\alpha, \sum, …) does not silently degrade into a free variable: the block shows "Unsupported symbol".
Complex numbers: not supported. If the function produces an imaginary result, the plane will show the non-graphable function overlay.
The plugin adds a settings tab (Settings → LMath):
y = f(x)) without pressing the "Solve" button.This version is already at a mature stage, but it may still contain bugs. If you find one, report it in an issue with the exact block that reproduces it.
obs-system requires two or more equations; for a standalone curve (including an implicit one), use obs-graph.\ge, \le, \geq, \leq) are reported as an Unsupported symbol.±∞) are labeled, not evaluated.y=f(x).sec(10x)) at extreme zoom-out is inherent to the periodic nature of those functions.Bug reports, feature requests and pull requests are welcome — see CONTRIBUTING.md for how to build, test and send changes, and the Technical Reference for the engine internals.
MIT — see LICENSE.