LaTeX Assistant
approvedVSCode+LaTeX Workshop-like editing experience: snippets, auto-completion, smart newlines, bracket pairing, and more. - This plugin has not been manually reviewed by Obsidian staff.
LaTeX Assistant
为 Obsidian 打造的轻量 LaTeX 编辑助手
中文
功能
| 功能 | 说明 |
|---|---|
$ 自动配对 | 按 $ → $|$,再按 $ → $$\n|\n$$ |
| Slash 命令 | $$ 中间按 / → 搜索并插入 LaTeX 片段 |
| Snippet 展开 | 输入触发词自动弹出补全提示,Enter 展开;或输入完整触发词直接按 Tab |
| 自定义片段 | 设置页增删改查 + JSON 导入导出 |
| 数学感知 | 仅在 $...$ $$...$$ 中激活 |
安装
- 从 Releases 下载
main.js、manifest.json、styles.css - 放入
<vault>/.obsidian/plugins/latex-assistant/ - 重启 Obsidian,在设置中启用插件
使用
$ 自动配对
| 操作 | 结果 |
|---|---|
按 $ | $|$ 光标在中间 |
再按 $ | $$\n|\n$$ 转为行间公式 |
Snippet 展开
输入触发词的前几个字母,自动弹出补全提示,按 Enter 展开;也可以输入完整触发词后直接按 Tab。
常用触发词:
| 输入 | 展开 |
|---|---|
frac | \frac{num}{den} |
cases | cases 环境 2×2 |
bmatrix | 方括号矩阵 |
aligned | 多行对齐 |
sum | 求和 |
int | 积分 |
lim | 极限 |
sqrt | 根号 |
/ Slash 命令
$$ 中间按 / → 搜索片段 → Enter 插入。干净的 LaTeX 代码,光标自动落在第一个可编辑位置。
设置
| 设置项 | 说明 |
|---|---|
| 语言 | English / 简体中文 |
$ 自动配对 | 开关 |
| Snippet 展开 | 开关 |
| Slash 命令 | 开关 |
| 数学环境感知 | 仅在公式内激活 |
| 自定义片段 | 增删改查 / JSON 导入导出 |
开发
npm install --legacy-peer-deps
npm run dev # watch
npm run build # 生产构建
English
Features
| Feature | Description |
|---|---|
$ auto-pair | Press $ → $|$, press again → $$\n|\n$$ |
| Slash command | / inside $$ → search & insert LaTeX snippet |
| Snippet expansion | Type trigger prefix → popup suggestions → Enter to expand; or type full trigger + Tab |
| Custom snippets | Add/edit/delete + JSON import/export |
| Math-aware | Only activates inside $...$ $$...$$ |
Installation
- Download
main.js,manifest.json,styles.cssfrom Releases - Place them in
<vault>/.obsidian/plugins/latex-assistant/ - Restart Obsidian, enable the plugin in Settings
Usage
$ auto-pair
| Action | Result |
|---|---|
Press $ | $|$ cursor in the middle |
Press $ again | $$\n|\n$$ display math |
Snippet expansion
Type a few letters of a trigger word to see completion suggestions. Press Enter to expand. Or type the full trigger and press Tab directly.
Common triggers:
| Trigger | Expands to |
|---|---|
frac | \frac{num}{den} |
cases | Cases environment 2×2 |
bmatrix | Bracket matrix |
aligned | Aligned equations |
sum | Summation |
int | Integral |
lim | Limit |
sqrt | Square root |
/ Slash command
Press / inside $$ → search snippet → Enter to insert. Clean LaTeX, cursor lands at the first editable position.
Settings
| Setting | Description |
|---|---|
| Language | English / 简体中文 |
$ auto-pair | Toggle |
| Snippet expansion | Toggle |
| Slash command | Toggle |
| Math-aware | Only in math mode |
| Custom snippets | CRUD / JSON import-export |
Development
npm install --legacy-peer-deps
npm run dev # watch
npm run build # production build
License
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.