From Wiki
Jump to navigation Jump to search

When writing a long document with many cross references, at the stage of proof reading, it comes handy if one could visualize what are the names given to various nodes (in ConTeXt parlance « nodes.destinations ») and also to visualize what destinations are invoked in the text (in ConTeXt they are named « nodes.references »).

There is a command named


which just does this: it prints in small fonts, to the left of each such node the name of the destination, or the name of the reference used at that point. Let us show it in action in the following (not so minimal) example (to be typeset with mkiv):












\startchapter[title=Some references,reference=ch:New]

\startsection[title=Some facts,reference=sec:First]
We have
a^2 + 2ab + b^2 = (a + b)^2,
for $a,b\in {\Bbb C}$. Also,
\NC \alpha^2 -2\alpha\beta + \beta^2 \NC = (\alpha - \beta)^2. \NR[eq:Identity]
\NC ||x||^2 + ||y||^2 \NC= (x+y|x+y) \NR[eq:Pythagore]
Note that \eqref[eq:Square] is true whenever we have $ab = ba$ for $b,a \in {\Bbb A}$. This is not the case when ${\Bbb A}$ is the ring of the matrices.
It is clear that \eqref[eq:Identity] is a consequence of \eqref[eq:Square].


Testing items to see where are the reference points and names.

Testing items for show reference


See \in{item}[it:2] in \in{section}[sec:First].


See \in{figure}[fig:1], and then have a look at \in{section}[sec:Testing] of \in{chapter}[ch:New].


\startsection[title=Testing \type{\showreferences},reference=sec:Testing]

\input knuth.tex



When typeset, with mkiv, this gives all the informations used for cross referencing.

There is also a module, which is invoked by saying:


which does somewhat more: not only the command \showreferences is activated, but on the top right corner of each page, a short list of all the references on that page is printed.

Actually, due to the fact that some of the informations is written between lines, depending on the bodyfont used in the document, one may need to fine tune more or less the position of the small prints: you can play with the following commands


by changing the numerical values according to your needs (remember nodes.destinations means the point where you have given a name to a certain object, and nodes.references corresponds to the point at which you refer to those objects).

Another useful information is that the command


is an alias for the following command


and you may enable only the tracking of either of the nodes, for instance by saying


you can visualize only the destinations nodes, or you may say


to see only where the references are invoked.

Finally, there is a command


which allows to visualize the objects which are destination or reference nodes (again, the above command can be split in two).