You are using a browser which doesn't fully support Cascading Style Sheets. This site will look much better in a browser that supports web standards, but its content is accessible to any browser or Internet device.

A Question of Variables

When using \INCLUDE for teamwork variables of the different authors could clash. Inclusion is substitution, there is no file scoping - which means a variable defined - or overwritten! - in an included document remains valid after the included part.

This effect can be intended - as for central definition files. Definitions loaded from a file should remain established after processing of that file. So, by including a central file with global variables all sources can access these definitions.

On the other hand, local variables have their uses, too. Central macros could access them to be adapted to the individual meanings. Likewise, target processors can include their values. Authors name and mail address, document date and version variables are good examples: a page layout could make use of them to present the author of each page and page specific document data.

What we need to make this work is something like variable localization, so that variables in an included document do not affect variables with the same name outside. This meachanism is there and is available with the localize option of \INCLUDE. localize takes a name of a variable, or a comma separated list of several names. All variables specified in this list are backed up before the new file is included, and restored when it is processed completely.

    $docAuthor=Jochen Stenzel
  
    $docVersion=0.01
  
    \INCLUDE{src="nested.pp" localize="docAuthor, docVersion"}
  
    Version and author: $docVersion, $docAuthor.

With this declaration, $docAuthor and $docVersion in the last example line will be Jochen Stenzel und 0.01 whether they are set in nested.pp or not.

Please note that the variable names in the localize list have no $ prefix, to avoid variable substitution by the parser.