LaTeX Math

by Zarstensen
5
4
3
2
1
Score: 50/100

Description

The LaTeX Math plugin adds symbolic math evaluation directly inside LaTeX math blocks using Sympy. It supports a range of commands for evaluating, expanding, factoring, and solving equations, as well as unit conversions and symbolic assumptions. You can define variables or functions, assign assumptions like 'real' or 'positive', and even convert LaTeX expressions into Sympy code blocks for advanced workflows. Evaluation is context-aware, with support for persistent definitions and scoped assumptions. All operations are triggered through commands or hotkeys, giving users a fast and flexible way to perform symbolic math inside notes.

Reviews

No reviews yet.

Stats

51
stars
6,137
downloads
5
forks
333
days
1
days
25
days
131
total PRs
2
open PRs
4
closed PRs
125
merged PRs
89
total issues
21
open issues
68
closed issues
0
commits

Latest Version

a month ago

Changelog

Release 1.4.2

Usage

See README for usage.

What's Fixed

Full Changelog: https://github.com/zarstensen/obsidian-latex-math/compare/1.4.1...1.4.2

README file from

Github

LaTeX Math

GitHub Release GitHub Beta Release GitHub Actions Workflow Status

LaTeX Math is an Obsidian plugin which adds mathematical evaluation of LaTeX math blocks to your notes, using Sympy.

demo Evaluate LaTeX expression is bound to Alt + B in the above demo. In general, all demo GIFs will make use of the recommended hotkeys.1

Usage

Start out by placing the cursor inside any math block. Then execute the Evaluate LaTeX expression command (or any other command from the command list). LaTeX Math will now parse the latex math block, evaluate the expression, and insert the result at the end of the math block.

Take a look at the command list for a brief overview of what this plugin can do, or see the features list for a more in-depth walkthrough of the plugin's advanced features.

Also see the documentation, which goes more in depth about the features than this README.

Table of Contents

Command List

Below is a table of all the commands this plugin provides, along with a brief description of what it does and optionally a recommended hotkey.

Command Recommended Hotkey Usage
Evaluate LaTeX expression Alt + B Evaluate the right most expression in a relation and simplify the result.
Evalf LaTeX expression Alt + F Evaluate expression and output decimal numbers instead of fractions in the result.
Expand LaTeX expression Alt + E Evaluate expression and expand the result as much as possible.
Factor LaTeX expression Evaluate expression and factorize the result as much as possible.
Partial fraction decompose LaTeX expression Evaluate expression and perform partial fraction decomposition on the result.
Solve LaTeX expression Alt + L Solve a single equation or a system of equations. Output the result in a new math block below the current one.
Convert units in LaTeX expression Alt + U Try to convert the units in the right most expression to the user supplied one.
Create truth table from LaTeX expression If selected expression is a proposition, inserts a truth table generated from the proposition. Table can be inserted as either latex or markdown.
Convert LaTeX expression to Sympy Convert entire expression to its equivalent Sympy code, and insert the result in a code block below the current math block.

Features

Evaluate

Evaluate equations in various ways using the evaluate command suite. The computed output varies, depending on the chosen command.

The entire evaluate suite consists of the following commands: Evaluate LaTeX expression, Evalf LaTeX expression, Expand LaTeX expression, Factor LaTeX expression and Partial fraction decompose LaTeX expression.

demo

Solve

Solve equations using the Solve LaTeX expression command. To solve a system of equations, place them in a align or cases environment, separated by latex newlines (\\).

The solution domain can be restricted for single equations in the solve equation modal, see the relevant Sympy documentation for a list of possible values.2 Restrict the solution domain of a system of equations with symbol assumptions on the free symbols.

demo

Symbol and Function Definitions

Define values of symbols or functions using the := operator. Only one symbol or function can be defined per math block.

Definition persistence is location-based: any math block below a definition will use it; others will ignore it. Furthermore, all definitions are reset after an lmat code block.

To undefine a symbol or function, leave the right-hand side of the := operator blank.

demo

Units and Physical Constants

Denote units or physical constants in equations by surrounding them with braces {}. LaTeX Math automatically handles conversions between units, constants and their various prefixes. See the syntax document for a list of supported units and physical constants.

Symbol Assumptions

Use an lmat code block to tell LaTeX Math about various assumptions it may make about specific symbols. This is used to further simplify expressions, such as roots, or limit the solution domain of equations. By default, all symbols are assumed to be complex numbers.

lmat code blocks make use of the TOML config format. To define assumptions for a symbol, assign the symbol's name to a list of assumptions LaTeX Math should make, under the symbols table. Like definitions, an lmat code block's persistence is based on its location. See below the demo GIF for a simple static lmat code block example.

demo

[!TIP] Example

```lmat
[symbols]
x = [ "real", "positive" ]
y = [ "integer" ]
```

You can read more about LaTeX Math environments and the lmat code block in the docs.

See the Sympy documentation for a list of possible assumptions.

Logical Propositions

Simplify logical propositions using the evaluate commands. Truth tables can be generated from a logical proposition using the Create truth table from LaTeX expression commands.

See SYNTAX.md/Logical Operators for a list of logical operators.

[!TIP] Want to check if two expressions are equal?

Put an \iff in between them and upon evaluation, LaTeX Math will insert True if they are symbolically equal or otherwise False if they are not.

Convert To Sympy Code

Quickly convert LaTeX to Sympy code to perform more advanced computations using the Convert LaTeX expression to Sympy command. This will insert a python code block containing the equivalent Sympy code of the selected math block.

Installing

Install Link

or

Press Browse in Obsidian's Options > Community plugins menu and search for LaTeX Math.

Installing a Specific Version

An earlier or beta version of this plugin can be installed via two methods.

BRAT Installation (easy)
  • Make sure the BRAT plugin is installed in your obsidian vault.
  • Run the BRAT: Plugins: Add a beta plugin for testing (with or without version) command via. the command palette.
  • Paste the LaTeX Math repository link (https://github.com/zarstensen/obsidian-latex-math) in the Repository text field.
  • Select the desired version in the version dropdown.
  • Press the Add plugin button.

The desired plugin version should now be installed in your vault.

Manual Installation
  • Download the plugin.zip file from the desired release version.
  • Extract it to your vault's plugin folder, commonly located at .obsidian/plugins, relative to your vault's path.

The desired plugin version should now be installed in your vault.

Contributing

See CONTRIBUTING

License

See LICENSE

Footnotes

  1. All demo GIFs were produced with the Obsidian Latex Suite plugin installed.

  2. The default solution domain for single equations can be set via. The domain key in the solve table in an lmat environment.

Similar Plugins

info
• Similar plugins are suggested based on the common tags between the plugins.
AI LaTeX Generator
2 years ago by Aayush Shah
An Obsidian plugin that generates latex code from natural language inputs.
Auto Math
2 months ago by Vladislav Sorokin
Auto-expands LaTeX snippets. External rules with live reload, Custom Rules Editor, and default math pack.
Auto-\displaystyle Inline Math
2 years ago by Ryota Ushio
An Obsidian.md plugin to automatically make all inline maths \displaystyle.
Calctex
3 years ago by Mike
An Obsidian plugin for automatic calculation of LaTeX formulas.
Completr
4 years ago by tth05
Auto-completion plugin for the obsidian editor.
Copy as LaTeX
5 years ago by mo-seph
Quick plugin to be able to copy/paste from Obsidian/Markdown into a Latex document
Export To TeX
5 years ago by Zach Raines
export obsidian markdown files in a format that can be pasted into a TeX file
Extended MathJax
5 years ago by Xavier Denis & Ng Wei En
Image2LaTEX
3 years ago by Hugo Persson
This is a plugin for obsidian that will read your latest copied image from clipboard and generate math latex from it
LaTeX Algorithms
3 years ago by SamZhang02
A simple plugin for writing Algorithms and pseudocodes in Obsidian.md
LaTeX autocomplete
6 months ago by Yanis Gerst
Latex Environments
6 years ago by Zach Raines
Quickly insert and change latex environments within math blocks in Obsidian.
Latex Exporter
a year ago by Matthew S. Scott
Latex Matrices
3 years ago by Daniele Susino
An obsidian plugin to create latex matrices.
Latex OCR
2 years ago by Lucas Van Mol
Generate LaTeX equations from images in your clipboard or vault
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.
Latex Suite
4 years ago by artisticat1
Make typesetting LaTeX as fast as handwriting through snippets, text expansion, and editor enhancements
LaTeX to unicode converter
3 years ago by fjdu
Convert LaTeX commands into unicode sequences
LaTeX-OCR
2 years ago by Jack Barker
Math Booster
3 years ago by Ryota Ushio
A powerful indexing & referencing system for theorems & equations in your Obsidian vault.
Math Indicator Changer
2 years ago by Ori Replication
MathLive
3 years ago by Dan Zilberman
The must-have plugin for math in Obsidian
MathLive in Editor Mode
2 years ago by MizarZh
MathLive input in editor mode.
Mathpad
4 years ago by Gabriele Cannata
Computer Algebra System (CAS) for Obsidian.md
MathType
a year ago by slateblua
Type math faster
No more flickering inline math
3 years ago by Ryota Ushio
No longer disturbed by flickering inline math in Obsidian.
Obsidian asciimath
3 years ago by widcardw
Asciimath support for Obsidian (based on asciimath-parser)
Obsidian matrix
4 years ago by Jonas Mohr
Plot Vectors and Graphs
2 years ago by Nicole Tan YiTong
Obsidian Plugin to generate graphs given the function.
Pseudocode
3 years ago by Yaotian Liu
An obsidian plugin that helps to render a LaTeX-style pseudocode inside a code block.
Quick LaTeX
5 years ago by joeyuping
Quick Matrix
6 months ago by Charlie Flowe
Plugin for Obsidian.md that allows for faster interactions with matrices in LaTeX
SwiftLaTeX Render
2 years ago by gboyd068
TikZJax
4 years ago by artisticat1
Render LaTeX and TikZ diagrams in your notes
Transfer LaTeX from GPT
2 years ago by Xixia
Typst Mate
3 months ago by azyarashi
Render math expressions with Typst instead of MathJax in Obsidian.
Wypst
2 years ago by 0xpapercut
High quality rendering of Typst in Obsidian, powered by wypst.