emacs - 在 emacs 中使用 orgtbl 在 latex 中垂直线条

我正在尝试使用 emacs 作为编辑器在 latex 中编写文档,我喜欢能够使用 orgtbl-mode 插入和编辑表格“ascii 艺术风格”,但我对必须手动更改格式感到恼火每当对表进行更改和编译时,表格从 {lll} 到 {|l|l|l|}。

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

示例表:

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

我希望它输出下表。

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

而不是这张表:

\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 的右边。

https://stackoverflow.com/questions/35405714/

相关文章:

asp.net-mvc - ASP.net MVC : Identity and drop auth

.htaccess - 只允许通过 VPN 私有(private)访问网站

amazon-web-services - 更新和部署 Elastic Beanstalk 应用程序

turing-machines - PCP 可以识别吗?

sql - Knex 原始查询不工作 postgresql

azure - 是 Console.ReadKey();适合 azure webjob

vim - tmux 将选择从复制模式发送到其他 Pane (xargs 加入?)

emacs - 使 Emacs/Slime/Quicklisp/SBCL 在 Windows 中工作

ruby-on-rails - 如何连接表以仅获取 has-many 关联的最后一条记录?

angularjs - UI-Grid 分页模板可编辑