3

Like the title says. I like to organize papers/books/etc that I've read, usually with a heading that has the name and a link to a pdf file. Unfortunately, once a link is inserted in a heading it becomes impossible to create a working link to that heading.

Example (created with org-store-link and org-insert-link):

Broken link: [[*heading%20with%20%5B%5Bfile:alink.stuff%5D%5Blinks%5D%5D][heading with links]] 
* heading with [[file:alink.stuff][links]]
   - some notes here

The best solution would be a way to link only to the visible text. That way, it would be possible to move the linked file around without breaking things. However, any insight at all would be appreciated.

1

Seems like Org successfully stores the link to a heading like this one but fails to parse it as an internal link afterwards.

Here's a workaround: use the CUSTOM_ID property:

Working link: [[#heading-with-links][heading with links]]
* heading with [[file:alink.stuff][links]]
  :PROPERTIES:
  :CUSTOM_ID: heading-with-links
  :END:
   - some notes here

See section 4.2 Internal links of the Org manual for details.

Edit:

The current stable version of Org (8.3.3) handles the link in the question correctly, i.e. this does work:

Working link: [[*heading%20with%20%5B%5Bfile:alink.stuff%5D%5Blinks%5D%5D][heading with links]]
* heading with [[file:alink.stuff][links]]
   - some notes here
  • Org 8.3.3 links to the heading correctly, but the link in the heading is no longer recognized, or are you getting different behavior? – user2699 Jan 26 '16 at 22:44
  • @user2699: It seems to me that the link is recognized. In particular, it is exported correctly and you can follow it with C-c C-o. It is not displayed correctly, though, i.e. regardless of the value of org-descriptive-links it is displayed "literally" --- square brackets and all. – Constantine Jan 27 '16 at 1:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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