Command/in

From Wiki
Jump to navigation Jump to search


\in

Summary

The command \in is used for referencing using a number.

Settings

\in{...}{...}[...]
{...}text
{...}text
[...]reference

Description

Inserts a reference to a location in the document which has been marked with a label (e.g. an equation, figure, section, enumerated item). This works only with numbered items! The curly-brace arguments contain prefix and suffix, the square brackets contain the label of the point/object/section to which you are referring.

After the prefix an automatic space is inserted in the output. If this is problematic, for instance because you want parentheses around a referenced number, see \definereferenceformat. That command allows you to define your own in-like commands.

Examples

Example 1

  • \setuppapersize[A5]
    
    \placeformula[eq:pythagoras]
    \startformula
      a^2+b^2=c^2
    \stopformula
    
    This is explained in \in{Equation}{.}[eq:pythagoras]
    

Hide the chapter number

In a magazine, the chapter might be an article without a chapter number. But using \at{section}[sec:something], you’ll get “section 2.5.1“ where you only want “section 5.1”.

Use \setupreferencestructureprefix to omit the first “segment”:

\setupreferencestructureprefix[default][prefixsegments=2:4]

Notes

See also

Help from ConTeXt-Mailinglist/Forum

All issues with: