Emacs org-mode 可以用来创建链接到 LaTeX 源中的某一行的待办事项吗?

Emacs org-mode 可以用来创建链接到 LaTeX 源中的某一行的待办事项吗?

一段时间以来,我都在用Emacs org-modehttp://orgmode.org/) 我对此非常满意。

我生活中有一个大项目(我的博士论文),当然是用 MacOS X 上的 LaTeX 写的 :-),这会产生很多与我的写作相关的待办事项。过去,我尝试过不同的方法,但收效甚微,将注释和待办事项直接添加到我的 LaTeX 源代码中,并将它们显示在 PDF 中以供审查和采取行动。问题是,没有外部列表可以让我重新排列、标记或优先处理这些任务和备注。

现在,我终于开始喜欢 Emacs(在 org-mode 之前我从未使用过),我想知道我是否可以使用 Emacs AucTEX 来编辑和编译我的大型文档直接在源代码中插入注释,我可以使用 org-mode 进行跟踪。

  • 有人这样做吗或者有这样做的教程吗?

  • 我认为仅插入 org-mode 行* TODO [#B] rewrite this section"就会与 LaTeX 代码冲突。

  • 也许有一种方法可以在 LaTeX 代码的当前位置创建一种永久锚点,并在我的 org 文件中创建一个 org-mode ToDO,其中包含一个超链接,让我稍后(即使 .tex 文件已更改)直接从org-modeLaTeX 源中跳转到我想要稍后编辑某些内容的位置?

  • 如果我可以直接在 LaTeX pdf 中添加注释,并将 .tex 源文件中的相应行/位置与 org 文件中的 TODO 链接起来,那就太好了

答案1

org-insert-link是您的朋友。将其全局绑定到有用的键,例如C-c l,您可以在 AucTeX 下的 LaTeX 文件中使用它。如果您对文件进行足够的干扰,org-insert-link 插入的锚点并不是永久的,但它在大多数情况下都有效。

另一种解决方案是在 Org 中编写你的论文(包括 ToDo),然后导出到 LaTeX。

这是一个 MWE,但由于您没有我链接到的 LaTeX 文件,因此链接不起作用。

#+TITLE:     Some links to a LaTeX doc
#+OPTIONS:   H:3 num:t toc:t \n:nil @:t ::t |:t ^:t -:t f:t *:t <:t
#+OPTIONS:   TeX:t LaTeX:t skip:nil d:nil todo:t pri:nil tags:not-in-toc


* This is an ordinary heading

This is a link to a context in a \LaTeX{} file with
[[file:~/Dropbox/_support/LSM2241/L7/LSM2241-AY201213-S1-L6-Feedback.tex::\section*{Q6%20How%20can%20the%20delivery%20of%20the%20material%20be%20altered%20to%20enhance%20your%20understanding%20of%20the%20material?}][some
helpful linky text]]. Note that the link keeps a bit of context,
which is created by running ~org-store-link~.

I have org-store-link globally bound to ~C-c l~ in emacs. Once the
link is stored, just insert it with org-insert-link


* TODO [#B] Finish this section

This *TODO* heading prints the *TODO* mark when the ~todo:t~
property at the top of this file is enabled. The template is
inserted with ~C-c C-e t~

* But honestly?

Why not just write your thesis in Org and export to \LaTeX{}
instead of keeping separate files?

答案2

来自Orgmode 手册

file:sometextfile::NNN                    file, jump to line number
...
file:projects.org::some words             text search in Org file

尽管手册中提到了在后一种情况下搜索“org 文件”,但如果您将其链接到非 org 类型,它将进行文本搜索。这就是 @GTK 的示例所使用的。

相关内容