\startcomponent ma-cb-en-references

\product ma-cb-en

\chapter{Refering to text elements}

\index{refering}
\index{label}

\Command{\tex{in}}
\Command{\tex{at}}
\Command{\tex{pagereference}}

For referring to one location in a document from another you
can use the command:

\shortsetup{in}

The curly braces contain text, the brackets contain a
logical label. If you have written a chapter header like
this:

\starttyping
\chapter[hotel]{Hotels in Hasselt}
\stoptyping

then you can refer to this chapter with:

\starttyping
\in{chapter}[hotel]
\stoptyping

After processing the chapter number is available and the
reference could look something like: {\em chapter 23}.
You can use \type{\in} for any references to text elements
like chapters, sections, figures, tables, formulae
etc.

Another example:

\startbuffer
There are a number of things you can do in Hasselt:

\startitemize[n,packed]
\item swimming
\item sailing
\item[hiking] hiking
\item biking
\stopitemize

Activities like \in{activity}[hiking] described on \at{page}[hiking]
are very tiring.
\stopbuffer

\typebuffer

This would look like this:

\getbuffer

As you can see, it is also possible to  refer to pages. This is done with:

\shortsetup{at}

For example with:

\starttyping
\at{page}[hiking]
\stoptyping

This command can be used in combination with:

\shortsetup{pagereference}

and

\shortsetup{textreference}

If you want to refer to the chapter {\em Hotels in Hasselt}
you could type:

\startbuffer
Look in \in{chapter}[hotel] on \at{page}[hotel] for a complete
overview of accomodations in \pagereference[accomodation]Hasselt.
\stopbuffer

\typebuffer

A chapter number and a page number will be generated when
processing the input file. On another spot in the document
you can refer to \type{accomodation} with
\type{\at{page}[accomodation]}.

You can also define a set of labels separated by commas.

\startbuffer
\placefigure
  [here]
  [fig:canals,fig:boats]
  {A characteristic picture of Hasselt.}
  {\externalfigure[ma-cb-08][width=10cm]}

There are many canals in Hasselt (see \in{figure}[fig:canals]).
.
.
.
Boats can be moored in the canals of Hasselt (see
\in{figure}[fig:boats]).
\stopbuffer

\typebuffer

This might look like this:

\getbuffer

\stopcomponent
