Open main menu

Changes

3,153 bytes added ,  18:13, 5 September 2020
Created page with "Documentation for \ref"
<cd:commandgroup name="ref" xmlns:cd="http://wiki.contextgarden.net/commanddoc/20200807">
<cd:shortdesc>The command <tt>\ref</tt> is used for referencing.
</cd:shortdesc>
<cd:variants>
<cd:command category="references" file="strc-ref.mkvi" interfacedate="2020-07-14T09:24" interfacefile="i-references.xml" level="document" name="ref" variantnumber="1">
<cd:arguments>
<cd:keywords ordinal="1">
<cd:keywordsdoc></cd:keywordsdoc>
<cd:constant type="default"></cd:constant>
<cd:constant type="text">The "text" of the label</cd:constant>
<cd:constant type="title">The "title" of the label</cd:constant>
<cd:constant type="number">The "number" of the label</cd:constant>
<cd:constant type="page">The "user" page number on which the label is</cd:constant>
<cd:constant type="realpage">The real page number on which the label is</cd:constant>
</cd:keywords>
<cd:keywords ordinal="2">
<cd:keywordsdoc></cd:keywordsdoc>
<cd:constant type="cd:reference"></cd:constant>
</cd:keywords>
</cd:arguments>
</cd:command>
</cd:variants>
<cd:description>This command looks up some property of some reference (e.g., a section, example, figure or custom reference made with {{cmd|reference}}).

You should not normally have to use this command. Links are better made using {{cmd|in}} or {{cmd|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 {{cmd|goto}} command for making the reference clickable.
</cd:description>
<cd:examples><cd:example title=""><context source="yes">
\setuppapersize[A7,landscape]

\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 title: \NC \ref[title] [ref] \NC \ref[title] [sec] \NC \NR
\NC number: \NC \ref[number] [ref] \NC \ref[number] [sec] \NC \NR
\NC text: \NC \ref[text] [ref] \NC \ref[text] [sec] \NC \NR
\NC realpage: \NC \ref[realpage][ref] \NC \ref[realpage][sec] \NC \NR
\NC page number: \NC \ref[page] [ref] \NC \ref[page] [sec] \NC \NR
\stoptabulate
</context>
</cd:example></cd:examples>
<cd:notes></cd:notes>
<cd:seealso>
<cd:source file="strc-ref.mkvi" originator="system"></cd:source>
<cd:wikipage originator="system" page="Category:References"></cd:wikipage>
<cd:commandref name="in"></cd:commandref>
<cd:commandref name="at"></cd:commandref>
<cd:commandref name="reference"></cd:commandref></cd:seealso>
</cd:commandgroup>