Difference between revisions of "Command/ref"

From ConTeXt wiki
 
Line 4: Line 4:
 
}}
 
}}
  
== [[Help:Reference|Syntax]] (autogenerated)] ==
+
== [[Help:Reference|Syntax]] (autogenerated) ==
 
<syntax>ref</syntax>
 
<syntax>ref</syntax>
 
== [[Help:Reference|Syntax]] ==
 
== [[Help:Reference|Syntax]] ==

Latest revision as of 14:36, 13 October 2019

\ref

Syntax (autogenerated)

\ref[...][...]
[...]default text title number page realpage
[...]reference


Syntax

\ref[...][ref]
[...] t p r s e
[ref]

Description

This command looks up some property of some reference (e.g., a section, example, figure or custom reference made with \reference).

You should not normally have to use this command. Links are better made using \in or \at, which are more conceptual (and create a clickable link as well).

If you want to implement some custom command for building references, this command is useful. You might also want to use the \goto command for making the reference clickable.

This commands takes two arguments. The first is the property of the reference you want to display:

p   The "user" page number on which the label is
r   The real page number on which the label is
s   The "sub text" of the the label is
t   The "text" of the label
e   The "extra text" of the label

In Mark IV, the "text" and "extra text" seem to refer to the same thing.

Example

% mode=mkii

\setuppapersize[A5]
\enableregime[utf]
\setuplines[space=yes]

\section{Glory be to God for dappled things---}
\startlines
  For skies of couple-colour as a brinded cow;	
    For rose-moles all in stipple upon trout that swim;
Fresh-firecoal chestnut-falls; finches’ wings;	
  Landscape plotted and pieced—fold, fallow, and plough;
    And áll trádes, their gear and tackle and trim.
\stoplines

\section[sec]{All things counter, original, spare, strange;}
\startlines
  Whatever is fickle, freckled (who knows how?)	
    With swift, slow; sweet, sour; adazzle, dim;	
He fathers-forth whose beauty is past change:
          Praise him.
\stoplines

\reference[ref]{Gerald Manley} 
---Gerald Manley Hopkins

\section{References}

\starttabulate[|l|l|l|]
\NC text:        \NC \ref[t][ref] \NC \ref[t][sec] \NC \NR
\NC subtext:     \NC \ref[s][ref] \NC \ref[s][sec] \NC \NR
\NC extra text:  \NC \ref[e][ref] \NC \ref[e][sec] \NC \NR
\NC realpage:    \NC \ref[r][ref] \NC \ref[r][sec] \NC \NR
\NC page number: \NC \ref[p][ref] \NC \ref[p][sec] \NC \NR
\stoptabulate

See also

Help from ConTeXt-Mailinglist/Forum

All issues with: