9

In Org-mode buffers, table or code block can have #+NAME: title. But I don't know how to reference them in current buffer or in other files with org-mode hyperlink. (like one link format: [[file:some-file.org::*headline]])

Org-mode has support for some Custom Search functions. By default, Org-mode does not supprt this.

Does anybody knows how to add this support?

stardiviner
  • 1,888
  • 26
  • 45
  • Can you make your question more clear? Provide an example text with the expected behaviour, and your research so far; with links to these "custom search" facilities in org mode. – Juancho Dec 27 '15 at 15:48

1 Answers1

14

I found the solution, Org-mode radio target can be used here. here is the doc: http://orgmode.org/org.html#Internal-links Like this:

Here is a named table.

#+NAME: my target
| x | y |
| 1 | 2 |

I can reference it with its name. Like this:
[[my target]]

There are also table remote references further explained by an example in the following.

First we define a table with a name TBL_origin to have something to play with. The two numbers in the row Average are referenced in the tables further below.

  #+NAME: TBL_origin
  | Leaders  | Caption 1 | Caption 2 |
  |----------+-----------+-----------|
  | Average  |        16 |        17 |
  |----------+-----------+-----------|
  | Leader 1 |        11 |        12 |
  | Leader 2 |        21 |        22 |
  #+TBLFM: @2$2=vmean(@II$2..@III$2)::@2$3=vmean(@II$3..@III$3)

The vector of the two numeric cells in row Average of table TBL_origin are referenced in the table formulas of the next tables.

  | Use table reference |
  |---------------------|
  |                16.5 |
  #+TBLFM: @2$1=vmean(remote(TBL_origin,@2$2..@2$3))

Note that you can not directly assign remote references to table ranges (see the posting Re: [Orgmode] remote reference in the orgmode mailing list).

A workaround is demonstrated in the following table:

  | Refer to averages |
  |-------------------|
  |                16 |
  |                17 |
  #+TBLFM: $1=subscr(remote(TBL_origin,@2$2..@2$3),@#-1)
Tobias
  • 32,569
  • 1
  • 34
  • 75
stardiviner
  • 1,888
  • 26
  • 45
  • 1
    A note on [remote references in org-table formulas](http://orgmode.org/manual/References.html#References) would be a valuable extension of this answer. Please have a look for the syntax `remote(NAME-OR-ID,REF)` on [the linked page](http://orgmode.org/manual/References.html#index-remote-references-352). – Tobias Dec 28 '15 at 08:43
  • You are welcome. May I edit your answer and give a usage example for remote references (when I find time)? – Tobias Dec 28 '15 at 10:21
  • Of course. edit it. – stardiviner Dec 28 '15 at 10:47
  • 3
    But how do I call `remote` from elisp? I usually write all my formulas in elisp and cannot mix with `remove(...)` inside an elisp formula. I also tried `(remote ...)`, but no luck. – Zelphir Kaltstahl Nov 03 '18 at 13:25
  • Hi, sorry, but those aren't actually radio targets, which are `<<>>`. Were you saying internal links? – Alessandro Bertulli Aug 25 '22 at 16:14