Difference between revisions of "Command/somewhere"

From Wiki
Jump to navigation Jump to search
(Created page with "Documentation for \somewhere")
 
 
Line 1: Line 1:
 
<cd:commandgroup name="somewhere" xmlns:cd="http://wiki.contextgarden.net/commanddoc/20200807">
 
<cd:commandgroup name="somewhere" xmlns:cd="http://wiki.contextgarden.net/commanddoc/20200807">
<cd:shortdesc><!-- a short command summary goes here -->
+
<cd:shortdesc>The command <tt>\somewhere</tt> is used for variable reference text.
The command <tt>\somewhere</tt> is used for ...
 
 
</cd:shortdesc>
 
</cd:shortdesc>
 
<cd:variants>
 
<cd:variants>
Line 21: Line 20:
 
   </cd:command>
 
   </cd:command>
 
</cd:variants>
 
</cd:variants>
<cd:description><!-- the long description of the command goes here -->
+
<cd:description>Typesets the first or the second argument depending on if the reference target is preceding or following its use. If the reference cannot be found, typesets the reference label itself instead.
</cd:description>
+
 
 +
With interaction turned on, the chosen argument becomes a hyperlink to the target as well.</cd:description>
 
<cd:examples><cd:example title=""><context mode="mkiv" source="yes">
 
<cd:examples><cd:example title=""><context mode="mkiv" source="yes">
 
\setuppapersize[A8,landscape][A6,landscape]
 
\setuppapersize[A8,landscape][A6,landscape]
 
\setuppaper[nx=2,ny=2]
 
\setuppaper[nx=2,ny=2]
 
\setuparranging[XY]
 
\setuparranging[XY]
 +
\setupinteraction[state=start]
  
 
\starttext
 
\starttext
Line 45: Line 46:
 
<cd:commandref name="in"></cd:commandref>
 
<cd:commandref name="in"></cd:commandref>
 
<cd:commandref name="at"></cd:commandref>
 
<cd:commandref name="at"></cd:commandref>
<cd:commandref name="goto"></cd:commandref></cd:seealso>
+
<cd:commandref name="goto"></cd:commandref>
 +
<cd:wikipage page="Interaction"></cd:wikipage></cd:seealso>
 
</cd:commandgroup>
 
</cd:commandgroup>

Latest revision as of 15:23, 19 November 2021


\somewhere

Summary

The command \somewhere is used for variable reference text.

Settings

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

Description

Typesets the first or the second argument depending on if the reference target is preceding or following its use. If the reference cannot be found, typesets the reference label itself instead.

With interaction turned on, the chosen argument becomes a hyperlink to the target as well.

Examples

Example 1

\setuppapersize[A8,landscape][A6,landscape]
\setuppaper[nx=2,ny=2]
\setuparranging[XY]
\setupinteraction[state=start]

\starttext
Hi, \somewhere{preceding}{following}[sec] there is a section.

\page
\section[sec]{A section title}
\page

Hi again, \somewhere{preceding}{following}[sec] there is a section.

\stoptext

Notes

See also

Help from ConTeXt-Mailinglist/Forum

All issues with: