I have several .org files, and I'd like to be able to create links between them using an ID. I am using DOIs as unique identifiers. I can link within a file by using properties:
* Paper 1
:PROPERTIES:
:CUSTOM_ID: 10.1088/0953-8984/23/21/213001
:END:
* Paper 2
:PROPERTIES:
:CUSTOM_ID: 10.1038/nphys2935
See also [[#10.1088/0953-8984/23/21/213001]]
Is there a way to make the custom_id global, so I can reference it from another file?
I think that org-id is what I need to go further, but I've found the documentation a little confusing. I tried adding the following lines in my .emacs
;; Use global IDs
(require 'org-id)
(setq org-id-link-to-org-use-id use-existing)
;; Update ID file .org-id-locations on startup
(org-id-update-id-locations)
but the file .emacs.d/.org-id-locations
only has nil
.
It seems like global links won't be automatically generated (Assign IDs to every entry in Org-mode). I tried (with cursor on the heading) to use M-x org-id-get-create
, but this does not seem to do anything.
EDIT: (Based on helpful comment)
Within one session, I can store and create links using M-x org-store-link
while on the heading (Paper 1
in my example above). Then I can use M-x org-insert-link
, and type the ID to insert the link. The link looks like [[id:10.1088/0953-8984/23/21/213001][Paper 1]]
. But I am running into two problems: (1) I'd like the ids to be stored automatically. (2) The links don't work when I close and re-open the file.
EDIT: A related question: