Command/at

From Wiki
< Command
Revision as of 18:00, 5 September 2020 by Taco (talk | contribs)
Jump to navigation Jump to search

<cd:commandgroup name="at" xmlns:cd="http://wiki.contextgarden.net/commanddoc/20200807"> <cd:shortdesc>The command \at is used for referencing using a page number. </cd:shortdesc> <cd:variants> <cd:command category="references" file="strc-ref.mkvi" interfacedate="2020-07-14T09:24" interfacefile="i-references.xml" level="document" name="at" variantnumber="1">

  <cd:arguments>
   <cd:keywords delimiters="braces" optional="yes" ordinal="1">
    <cd:keywordsdoc>Prefix of the referenced label</cd:keywordsdoc>
    <cd:constant type="cd:text"></cd:constant>
   </cd:keywords>
   <cd:keywords delimiters="braces" optional="yes" ordinal="2">
    <cd:keywordsdoc>Suffix of the referenced label</cd:keywordsdoc>
    <cd:constant type="cd:text"></cd:constant>
   </cd:keywords>
   <cd:keywords ordinal="3">
    <cd:keywordsdoc></cd:keywordsdoc>
    <cd:constant type="cd:reference"></cd:constant>
   </cd:keywords>
  </cd:arguments>
 </cd:command>

</cd:variants> <cd:description>Inserts the page number of a location in the document which has been marked with a label (e.g. an equation, figure, section, enumerated item). The curly braces are optional and contain prefix and suffix, the square brackets contain the logical label to which you are referring.

</cd:description> <cd:examples><cd:example title="">The following example shows all three variants of the command \at.

Note: In the third sentence a whitespace after the referenced page number is forced with ~ (tilde).

\setuppapersize[A5]

\placeformula[eq:pythagoras]
\startformula
a^2 + b^2 = c^2
\stopformula

Pythagoras' theorem is shown on \at[eq:pythagoras].

Pythagoras' theorem is shown on \at{page}[eq:pythagoras].

Pythagoras' theorem is shown on \at{page}{~and page 2}[eq:pythagoras].

produces

</cd:example><cd:example title="">to make \at work with \externalfigure, add a derivation of \placefloat such as \placefigure (used in the example) to generate the reference

\setupcaption[number=no]
\starttext
\placefigure[][my-cow-label]{}{\externalfigure[cow.pdf][width=7mm]}
\at{page }[my-cow-label] refers to a cow
\stoptext

produces

</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="about">to insert the title of a referenced item.</cd:commandref> <cd:commandref name="in">to insert the number of a referenced item.</cd:commandref> <cd:commandref name="setupinteraction">to control the color and contrast color of links</cd:commandref> <cd:commandref name="ref"></cd:commandref></cd:seealso> </cd:commandgroup>