Org-mode Hyperlinks


1. URLs

1.1. Info

Use the info link type to link to an Info manual or a specific node.
Link format: info:manual-name#optional node name.

  • To link to the Org manual:
    see [[info:org][the Org manual]] → see the Org manual;
  • To link to the "User Input" node of the Emacs manual:
    see [[info:emacs#User Input][Kinds of User Input]] → see Kinds of User Input.

3. Files

You can go to a specific line in a file with by appending ::N at the end of file name, e.g. [[./org-hyperlink.org::10]]. However, this can't be exported to HTML.

4. Named Elements

Elements can be given a name:

#+name: named source block
#+caption: simple code
#+begin_src elisp
  (let ((x 2))
    (coderef)
    (1+ x))
#+end_src

Three main elements that can be named:

  • image: exported as "Figure N"
  • table: exported as "Table N"
  • code block: exported as "Listing N" in HTML and "Figure N" in LaTeX.
  • even a paragraph can be given a name

You can refer to named elements using [[named source block]], e.g. Fig. 1, Listing 1, and Table 1.

Adding #+caption: xxx is highly recommended, for without it, caption numbers like "Figure N" whould not show.

When targeting a ‘NAME’ keyword, the ‘CAPTION’ keyword is mandatory in order to get proper numbering. —Org manual 4.2 Internal Links

5. Dedicated Targets

Dedicated targets can be used to refer to a paragraph or an item in a list.

  • paragraph: [[target][prefixed sentence]]prefixed sentence
  • unordered list: the [[unordered target]]^th in the list → the 3th in the list
  • ordered list: [[ordered target][lalala]]lalala

6. Radio Targets

A radio target radiates its position. It is enclosed in three angular brackets, e.g. <<<thebesttv>>> and <<<do re me>>> in section 7.

When a radio target is defined, any occurence of that word (or the words) in the document, e.g. thebesttv, is automatically linked to the originating target. This can be used for linking all the occurences of a terminology with its definition. See the song of "do re me".

See the manual: 4.3 Radio Targets. Again, thebesttv and do re me.

7. Something to Refer to

This section presents some example code and their exported results for later use.

<<target>> This is a sentence prefixed with a /dedicated target/.

- unordered list
- some item
- <<unordered target>> target in an unordered list


1. ordered list
2. <<ordered target>> target in an ordered list

This word---​<<<thebesttv>>>​---is a radio target.
<<<Do re me>>>, a radio target, also a song.

This is a sentence prefixed with a dedicated target.

  • unordered list
  • some item
  • target in an unordered list
  1. ordered list
  2. target in an ordered list

This word—thebesttv—is a radio target. Do re me, a radio target, also a song.

7.1. A sub-section

{{{image(50)}}}
#+name: named image
#+caption: sample image
../daily/2021-05-20/lights-3.jpg

#+name: named source block
#+caption: sample code
#+begin_src elisp
  (let ((x 2))
    (coderef)
    (1+ x))
#+end_src

#+name: named table
#+caption: sample table
| a | b | c | d |
|---+---+---+---|
| 1 | 2 | 3 | 4 |
lights-3.jpg
图1  sample image
(let ((x 2))
  (coderef)
  (1+ x))
表1  sample table
a b c d
1 2 3 4

Authorthebesttv
Created2022-09-22 20:15
Modified2022-12-04 18:20
Generated2024-06-11 02:39
VersionEmacs 29.3 (Org mode 9.6.15)
Raworg-hyperlink.org