Search code examples
emacsorg-mode

how to link to second-level heading in external org file?


How can I create, in an org mode file, a link to a second-level heading located in another org mode file?

I can do this for a first-level file with

[[file:external-file.org::*first-level heading][description]]

but I haven't been able to find a way to do this for second level headings. I've already tried with

[[file:external-file.org::*first-level heading**second-level][description]]
[[file:external-file.org::*first-level heading/**second-level][description]]
[[file:external-file.org::*first-level heading::**second-level][description]]

and none of them work.


Solution

  • The documentation says this:

    file:projects.org::*task title heading search in Org file

    Note that this says "heading search", not "level-one heading search". No mention is made of the number of asterisks having to match the heading level. In your example, this should work:

    [[file:external-file.org::*second-level][description]]