manpagez: man pages & more
info texinfo
Home | html | info | man
[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.5 @anchor: Defining Arbitrary Cross-reference Targets

An anchor is a position in your document, labeled so that cross-references can refer to it, just as they can to nodes. You create an anchor with the @anchor command, and give the label as a normal brace-delimited argument. For example:

 
This marks the @anchor{x-spot}spot.
…
@xref{x-spot,,the spot}.

produces:

 
This marks the spot.
…
See [the spot], page 1.

As you can see, the @anchor command itself produces no output. This example defines an anchor `x-spot' just before the word `spot'. You can refer to it later with an @xref or other cross-reference command, as shown. See section Cross References, for details on the cross-reference commands.

It is best to put @anchor commands just before the position you wish to refer to; that way, the reader's eye is led on to the correct text when they jump to the anchor. You can put the @anchor command on a line by itself if that helps readability of the source. Whitespace (including newlines) is ignored after @anchor.

Anchor names and node names may not conflict. Anchors and nodes are given similar treatment in some ways; for example, the goto-node command in standalone Info takes either an anchor name or a node name as an argument. (See (info-stnd)goto-node section `goto-node' in GNU Info.)

Also like node names, anchor names cannot include some characters (see section @node Line Requirements).


© manpagez.com 2000-2025
Individual documents may contain additional copyright information.