Internal links in Orgmode

I always forget the syntax for Orgmode internal links. Usually I scrounge around for 20 minutes to find a solution. For future reference I’m putting the answer here as a note in a bottle to my future confused myself.

Internal link HOWTO

The internal link is constructed with the usual square brackets, like this:

This is [[what-i-want-to-link-to][what I want to link to]].

The anchor (where the link goes to) is constructed with angle brackets, like this:

And this is the anchor: 
<<what-i-want-to-link-to>>

When Org exports the HTML, it matches the target with the anchor, generates the anchor tags, and looks like this:

<p>
This is <a href="#what-i-want-to-link-to">what I want to link to</a>.
</p>

<p>
And this is the anchor: 
<a id="what-i-want-to-link-to" name="what-i-want-to-link-to"></a>
</p>

Sweet.

Take the Emacs Tour
 

Orgmode --- your life in plain text