[Tex/LaTex] Can Emacs org-mode be used to createToDo’s linked to a line in a LaTeX source

emacsorg-mode

For some time now I'm tracking my tasks and ToDos (privately and for work) with Emacs org-mode( http://orgmode.org/ ) and I am very happy with it.

There is a large project in my life (my Ph. D. thesis), for sure written with LaTeX on MacOS X 🙂 , which creates a lot of todos related to my writing.
In the past I have tried different approaches with limited success, to add notes and todos directly to my LaTeX source code and display them in the PDF for review and action.
The problem was, that there was no external list where I could re-arrange, tag or prioritize those tasks and remarks.

Now, as I'm finally starting to like Emacs (which I never had used before org-mode), I wonder if I could use Emacs AucTEX for editing and compiling my large document and directly inserting notes in the source code, which I could keep track of with org-mode.

  • Does anyone do that or is there a tutorial to do so?

  • I assume that just inserting org-mode lines like * TODO [#B] rewrite this section"would conflict with LaTeX code.

  • Maybe there is a way to create kind of a permanent anchor at the current position in the LaTeX code and create an org-mode ToDO in my org-files which contains a hyperlink that lets me jump later (and even if the .tex file has changed) directly from org-mode to the place in the LaTeX source, where I want to edit something later?

  • It would be great, if I could add a note which is shown in the LaTeX pdf directly and link the corresponding line/place in the .tex source with a TODO in an org-file

Best Answer

org-insert-link is your friend in this. Bind it to a useful key globally, like C-c l, which you can use in your LaTeX file under AucTeX. The anchor inserted by org-insert-link isn't exacly permanent if you mess with the file enough, but it works most of the time.

A different solution would be to write your thesis in Org, including the ToDo's, and export to LaTeX.

Here's an MWE, except the link won't work because you don't have the LaTeX file I'm linking to.

#+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?