Search code examples
hyperlinkorg-modeheading

Internal link to a hyperlink heading


In a document, I'd like to create an internal link. That works as expected on regular links. But when the heading is itself a hyperlink, that doesn't work. How ought one accomplish this?

Trying to link to [[Heading1]] and [[???]]

* Heading1 

These are some contents.

* [[http://example.com][Heading2]]

These are some more contents. 


Solution

  • Go to the second heading and do C-c l to store the link (assuming you have set up the key binding as suggested in the manual: if not, just say M-x org-store-link RET).

    Then go to the place where you want to insert the link and do C-c C-l (or M-x org-insert-link RET).

    Now try your new link: it worked fine for me.

    For the record, this is what the working result looks like:

    Trying to link to [[Heading1]] and [[*\[\[http://example.com\]\[Heading2\]\]][Heading2]]
    
    * Heading1 
    
    These are some contents.
    
    * [[http://example.com][Heading2]]
    
    These are some more contents.