在 emacs 中使用 orgtbl 在乳胶中垂直线条

Vertical lines in latex using orgtbl in emacs

我正在尝试使用 emacs 作为编辑器在 latex 中编写文档,我喜欢能够使用 orgtbl-mode 来插入和编辑 tables "ascii art style",但我很生气每当更改 table 和编译时,都必须手动将表格格式从 {lll} 更改为 {|l|l|l|}。

有没有办法让水平线成为默认值?

示例table:

|-------+-------+-------|
|       | test1 | test2 |
|-------+-------+-------|
| test3 |       |       |
|-------+-------+-------|
| test4 |       |       |
|-------+-------+-------|

我希望它输出以下内容 table。

\begin{tabular}{|l|l|l|}
\hline
& test1 & test2 \
\hline
test3 &  &  \
\hline
test4 &  &  \
\hline
\end{tabular}

而不是这个 table:

\begin{tabular}{lll}
\hline
& test1 & test2 \
\hline
test3 &  &  \
\hline
test4 &  &  \
\hline
\end{tabular}

您可以使用 Org manual 中的列组。

添加一行和一列(表示列组)

| / | <     | <     | <>    |
|---+-------+-------+-------|
|   |       | test1 | test2 |
|---+-------+-------+-------|
|   | test3 |       |       |
|---+-------+-------+-------|
|   | test4 |       |       |
|---+-------+-------+-------|

将生成所需的结果:

\begin{tabular}{|l|l|l|}
\hline
 & test1 & test2\
\hline
test3 &  & \
\hline
test4 &  & \
\hline
\end{tabular}

添加第一列得到table最左边的竖线,需要在第一行最后一列中表示一列结束的'>'才能得到table.

最右边的垂直线