2

I am using org-mode to write my labbook. Each experiment is an org-file that is exported to PDF when finished. Currently, I am linking to previous experiments by using the resulting PDF. Is it possible to link to org-files instead and have org-mode convert the link to PDF once exported?

This would make it easier to jump from experiment to experiment inside Emacs and from PDF to PDF once exported.

I am aware that this is done for HTML export. How do I set this up for LaTeX export?

5
  • Can you share one of your books (google drive?) if you don't mind? I'm a org user but I have not be able to use it for anything other than organizing / planning / scheduling. I would like to see how you are doing your lab book.
    – Prasanna
    Jan 10, 2017 at 15:10
  • 1
    I think it would be best to apply org export filters. orgmode.org/org.html#Advanced-configuration Jan 11, 2017 at 6:12
  • @Prasanna I am using the setup by the Kitchin lab - Scimax with which I created a projectile project for each project I am working in. Inside each project I create a folder for each experiment (I give each experiment a number). Then inside that folder I have the .org file for the experiment in which I write down my purpose for the experiment, the procedure (which are also TODO tasks that are scheduled) and my data analysis (with R/ESS) and results from the experiment. The org-file is then exported via latex to PDF.
    – Cumol
    Jan 11, 2017 at 13:20
  • 1
    @Dieter.Wilhelm thank you for the suggestion, I will give it a look.
    – Cumol
    Jan 11, 2017 at 13:21
  • 1
    @Dieter.Wilhelm at the end I did the following: (defun my-latex-filter-macro (text backend info) "Replace .org with .pdf" (when (org-export-derived-backend-p backend 'latex) (replace-regexp-in-string "\\.org" ".pdf" text))) (add-to-list 'org-export-filter-link-functions 'my-latex-filter-macro)
    – Cumol
    Mar 29, 2019 at 9:42

1 Answer 1

0

In the end I did the following:

(defun my-latex-filter-macro (text backend info)

  "Replace .org with .pdf"

  (when (org-export-derived-backend-p backend 'latex)

    (replace-regexp-in-string "\\.org" ".pdf" text)))



(add-to-list 'org-export-filter-link-functions

             'my-latex-filter-macro)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.