Command/setupdocument

Unofficial ConTeXt Wiki mirror

Last modified: 2024-11-04

Summary

The command \setupdocument is used for configuring \startdocument.

Settings

\setupdocument[...,...][...=...,...]
[...,...] name
before command
after command
metadata:author text
metadata:title text
metadata:subject text
metadata:keywords text
key value

Option Explanation
before
Command to run before the text. Default: \directsetup{document:start}
after
Command to run after the text. Default: \directsetup{document:stop}
metadata:author
Value for the PDF metadata /Author field
metadata:title
Value for the PDF metadata /Title field
metadata:subject
Value for the PDF metadata /Subject field
metadata:keywords
Value for the PDF metadata /Keywords field
cd:key
Any user-supplied key

Description

With \setupdocument you can preset values to be used by \startdocument . Any argument passed to \setupdocument can be queried later with \documentvariable .

See \startdocument for an example.

Examples

Example 1

  • \startdocument[myKey=myValue]
    \doifelse
      {\documentvariable{myKey}} {myValue}
      {It is myValue}
      {It is not myValue}
    \stopdocument
    
  • \startdocument[myKey=myValuee]
    \doifelse
      {\documentvariable{myKey}} {myValue}
      {It is myValue}
      {It is not myValue}
    \stopdocument
    

Notes

See also

Help from ConTeXt-Mailinglist/Forum

All issues with: