Markdown Table to LaTeX

approved

by pengivy1990

This plugin has not been manually reviewed by Obsidian staff. Convert Markdown tables to LaTeX array/tabular environments. 将选中的 Markdown 表格转换为 LaTeX 表格。

5 downloadsUpdated todayMIT

Markdown Table to LaTeX

一个 Obsidian 插件,将选中的 Markdown 表格一键转换为 LaTeX array 环境,支持 MathJax 渲染。

功能

  • 选中 Markdown 表格 → 转换为 LaTeX 表格
  • 支持可选的表格标题
  • 自动去除单元格内行内公式的 $ 符号(已在 $$ 环境内,无需重复)
  • 自动解析 Markdown 对齐方式(:---:---:---:
  • 左侧功能区图标 + 命令面板两种触发方式

安装

手动安装

  1. 下载 最新 Releasemain.jsmanifest.json
  2. 将两个文件放入 vault 的 .obsidian/plugins/md-table-to-latex/ 目录
  3. Obsidian → 设置 → 第三方插件 → 启用 Markdown Table to LaTeX

从源码安装

git clone https://github.com/pengivy1990/md-table-to-latex.git
cp md-table-to-latex/*.js md-table-to-latex/manifest.json /你的vault/.obsidian/plugins/md-table-to-latex/

使用

方式一:功能区图标

点击左侧 Ribbon 栏的表格图标 → 弹窗输入标题(可选)→ 确认后自动替换选中表格。

方式二:命令面板

  1. 在编辑器中选中 Markdown 表格
  2. Ctrl+P(或 Cmd+P)打开命令面板
  3. 搜索 Convert Markdown Table to LaTeX 并回车
  4. 弹窗输入标题(可选)→ 确认

输入格式

插件接受标准 Markdown 表格:

| 变量   | 观测值 |  均值  |
| :----- | :----: | ----:  |
| $Res$  | 4656   | -0.616 |
| $Rfor$ | 4656   | 0.359  |

输出格式

有标题:

$$
\begin{array}{c}
\text{表1:描述性统计} \\[4pt]
\begin{array}{clr}
\hline
变量 & 观测值 & 均值 \\
\hline
Res & 4656 & -0.616 \\
Rfor & 4656 & 0.359 \\
\hline
\end{array}
\end{array}
$$

无标题:

$$
\begin{array}{clr}
\hline
变量 & 观测值 & 均值 \\
\hline
Res & 4656 & -0.616 \\
Rfor & 4656 & 0.359 \\
\hline
\end{array}
$$

开发

插件源文件在 main.js,可编辑后直接替换 vault 中的同名文件,然后在 Obsidian 中重载插件即可生效。

# 在 D:\plugins\md-table-to-latex 编辑
# 然后复制到 vault
cp main.js /你的vault/.obsidian/plugins/md-table-to-latex/main.js

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.