Link to heading in node?

Is there a way to link to an org (sub)heading in another node?

Yes and no.

Org-roam does not add to Org’s link syntax. ID links in Org mode only link to an ID; there is no syntactical way to link to an ID’s (sub)heading. So… This is not correct Org’s link.

[[ID:<id>::*heading-description]] 

You can use Org’s file link synax like these, but I don’t think these are not recognized as backlinks by Org-roam – you can try:

‘file:projects.org::*task title’ (headline search)
‘file:projects.org::#custom-id’ (headline search)

I wonder if this information is up-to-date? I tried [[id:<id>::*heading]] and the link works for me, although as the sub-heading doesn’t have a node the backlink doesn’t get recognised.

What’s your Org version? Are you using Doom?

[[ID:<id>::*heading-description]]
is an extension done within Doom.

1 Like

Its a custom advice done by doom emacs devs – easy enough to port to vanilla, but isn’t supported by default in org.

I am! Thank you, I was getting confused as to why I couldn’t find the feature documented anywhere.

Just documenting the location for anyone coming across this in the future. Thanks again.

1 Like