References notes and floats/Tutorials

Unofficial ConTeXt Wiki mirror

Last modified: 2025-01-19

PDF Navigation

To activate navigation features of PDF, two key commands:

Will do the same but open only chapter ones by default:

Reference

Within the document

Many element have a reference option like \startsection. \placefigure and \placetable directly require a reference as argument.

Then you can use:

You can also define a reference anywhere you like with \reference[reflabel]{text}.

To URL (web adress)

Hyperlinks can be defined with \goto{the text} [url(the url.org)]. The url should be specified within url(…). Without it, \goto can be used to refer to internal references.


Usually, one uses the same url reference several times. One can define it once with \useurl [arg1] [arg2] [arg3] [arg4] (in the setup area for example) and uses it several times with \goto or \from or Template:url

to be displayed as a hypertext link as provided as 4th argument of \useurl

Citation and bibliography

Four commands are key

Index and register

Words to use as entry of the index are defined with \index and the index itself is inserted with \placeindex. As you see, the text used for the \index command is not inserted at the place of the command.

Notes

Footnotes

The \footnote[label]{the note content} command places the text given as an argument as a footnote, and it is possible to indicate a label between square brackets in order to refer to it later with the \note command.

Margin notes

To place note in the margin, use the \inouter{the note content} or the other sisters commands. \setupmargindata is used to configure the typesetting.

Attachment

The \attachment (or \startattachment) command is used to insert a document as an attachment. Do not forget \setupinteraction[state=start] to make it effective.

2 remarks for this demo: we have to use a buffer to produce the file to be attached, and the rendering contains a glitch that you will not get locally.

Customization is performed with \setupattachment and a \placeattachments is also available.

For example, with location=none, your attachments get collected until \placeattachments.


You can link to an attachment if it is a PDF file and that you use its name as prefix:

\attachment[method=hidden, file={other.pdf}]
\goto{Click here to open other}[other::]

Synonyms and glossary

First we define a category of synonyms with \definesynonyms and then we can define each term with \abbreviation. Each newly defined term is then available as a command.

Floats and captions

Floating Objects (floats) are placed (and numbered) automatically with \placefloat (or its sister commands \placefigure, \placetable…). It allows to create floating figures or table with caption.

Floats are placed at an appropriate position determined by the TeX float placement algorithm. The algorithm has a number of options that can influence float placement.

Floats include "figure", "table", and "intermezzo". Additional floats can be defined using \definefloat.

Additionally, you have access to commands like \placelistoffigures, \placelistoftables which creates a list of the "figures" / "tables" / "intermezzos" used in the document.

\placefloat[location][reference]{caption}{the content of the float}

To tweak the numbering scheme, please see Section numbering