Convert Markdown tables to LaTeX array/tabular environments. 将选中的 Markdown 表格转换为 LaTeX 表格。
一个 Obsidian 插件,将选中的 Markdown 表格一键转换为 LaTeX array 环境,支持 MathJax 渲染。
$ 符号(已在 $$ 环境内,无需重复):---、:---:、---:)main.js 和 manifest.json.obsidian/plugins/md-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 栏的表格图标 → 弹窗输入标题(可选)→ 确认后自动替换选中表格。
Ctrl+P(或 Cmd+P)打开命令面板插件接受标准 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
MIT