System Macros/Scratch Variables

From Wiki
< System Macros
Revision as of 09:17, 1 August 2006 by Taco (talk | contribs) (split off section)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

System_Macros

Because we often need counters on a temporary basis, we define the <counter> \scratchcounter. This is a real <counter>, and not a pseudo one, as we will meet further on. The others are analogous scratch registers.

A warning is in order here. Yes, you can use these registers in your own macrocode. But not across calls to internal ConTeXt macros. While ConTeXt always makes sure that the registers are cleared on entry to the call, it usually doesn't bother to restore your user supplied value when it returns.

ConTeXt also uses a rather large collection of other internal scratch registers. Their names all look like this: \!!XXXXXY, where XXXXX is something like 'count' or 'depth', and Y is a letter starting from a (e.g. \!!counta). The fact that their names start with !! is a clear statement: Don't touch them, it's dangerous. If you need scratch registers, define your own.

ConTeXt uses yet another set of constants and variables to store all sorts of string values in (macro names occupy less space in TeX's memory than the strings themselves).

For this reason, you should also not touch the definitions of macros that start with

  • \s! (constant string),
  • \c! (constant),
  • \p! (parameter),
  • \v! (variable),
  • \@@ (multi-lingual interface parameter expansion),
  • \?? (multi-lingual interface parameter call).

Redefining these macros can have disastrous results.