2.7 Grouping (or Scope)
A segment of code may be grouped by placing it
within { and } (curly braces).
Most commands that occur within a group will be
local to that group. For example, \bfseries
changes
the font weight to bold, so the following segment of code:
will appear in the typeset document looking like:
As can be seen, the font change only stays in effect until it
reaches the end of the group (signified by the closing curly brace
}.) For a command to be in the same
scope as another command, both commands must be within the same group.
For example, in the following, \bfseries
and
\itshape
are in the same scope:
But below, they are in different scopes:
Environments form an implicit scope.
This book is also available as A4 PDF or 12.8cm x 9.6cm PDF or paperback (ISBN 978-1-909440-00-5).