This is LaTeX document style option `examples.sty', for making numbered examples. Written by Alexander Holt, Centre for Cognitive Science, University of Edinburgh . examples.txt,v 1.1 2000/12/19 12:11:31 mef Exp ====================================================================== This document style option defines the environment "examples", intended for the display of linguistic examples. Examples resemble equations with the document style options "leqno" (left hand equation numbering) and "fleqn" (flush-left equations) in force. The "examples" environment can be nested two or three deep, to create subexamples and subsubexamples respectively. Subexamples are displayed as lists numbered by arabic letters, subsubexamples with roman letters. The main difference is that examples are made with the standard displayed paragraph environment "list", whereas equations use displaymath mode. A further difference is in the vertical positioning of the number: example numbers come at the top of the display, equation numbers in the centre. By default, examples and equations share the same numbering sequence. Example numbers always appear on the left; this style option forces equation numbers to appear on the left too, for consistency, by automatically selecting the leqno option. Whether equations themselves are centred or left-aligned, however, is at the discretion of the user. They are centred by default in LaTeX. The fleqn option makes them left-aligned; if this option is used, it should ideally precede "examples" on the options list, to ensure that equations and examples have the same indentation. The "examples" environment is used like this (note that \label and \ref work as might be expected): Consider now the following data, in particular (\ref{ex:johnmary}): \begin{examples} \item \label{ex:johnmary} \begin{examples} \item John loves Mary. \item Mary loves John. \item \sqz{*} loves John Mary. \label{ex:jmbad} \end{examples} \item ... \end{examples} It is also possible to use \label and \ref to refer to subexample numbering. When \label is used within a nested examples environment it will record the letter corresponding to the current (sub)subexample. So given the example above, one may refer to \ref{ex:johnmary}\ref{ex:jmbad} in order to get something like "34c". If you prefer brackets round the subexample letter, just do \ref{ex:johnmary}(\ref{ex:jmbad}) to get "34(c)". Similarly for subsubexamples. In the above, the command \sqz{*} has the effect of `squeezing' an asterisk in front of the sentence "loves John Mary". Users might find it worthwhile to define their own commands which call \sqz, for example, \newcommand{\bad}{\sqz{*}} which has the advantage of localizing the choice of letter. Collections of subexamples and subsubexamples will not be split over page breaks (except possibly between the paragraphs of a item containing multiple paragraphs). If you don't want this behaviour, the environment "examples*" allows page breaks anywhere, but is otherwise identical to the unstarred version. A couple of remarks on vertical space: first, if you wish to display more than one example consecutively, you should use a single examples environment to do so; using a sequence of one-item examples environments will result in too much space between them. Second, there should not be a blank line before an "example" environment, as this indicates to LaTeX the start of a paragraph, and it will add extra vertical space. Similarly, there should be no blank line after the environment either, unless you actually intend to start a new paragraph at that point. This comment applies to any LaTeX environment. Recall that you can use lines starting with the "%" character to space out your input file harmlessly. There is provision for arbitrary numbering of examples at all levels. the numbers being provided by the user. This is typically used for repeating earlier examples with the same number. You do this by giving the \item command an argument, in square brackets, consisting of the required number. (In the case of (sub)subexamples this will normally be a letter, of course -- though there is nothing to stop you using any symbol you like at any level.) For example: \begin{examples} \item[\ref{ex:johnmary}] \begin{examples} \item[\ref{ex:jmbad}] \sqz{*} loves John Mary. \end{examples} ... \item[XV] \begin{examples} \item[i] Roman numbering, provided by the user. \item[iii] I've chosen to leave out (ii). \end{examples} \end{examples} If an `empty' number is specified, with "[]", then the numbering position will be left completely blank. One cautionary note: sometimes one may have an example which uses square brackets in the example text itself (for example, to indicate constituent structure). In these cases one must follow the \item command with something before the first "[" to avoid part of the example being taken as a user-supplied number. A good thing to use is "{}": \begin{examples} \item{} [Mary] [loves John]. \end{examples} There are a number of parameters which the user can modify in his or her LaTeX document in order to change the appearance of examples. The commands \theexample, \thesubexample and \thesubsubexample do the actual numbering (or lettering), and may be redefined if desired. Note, however, that if \theexample is not defined to be \theequation (as it is by default), then it will be necessary to define a new counter for examples, which will then be quite independent of the equation counter. Hence it will usually be preferable to redefine \theequation instead, so as to keep equation and example numbering in sync. The other parameter which the user may like to change is \exampleindent, which determines the inital indent of example text. By default, it is set to 5/3 of the value of \leftmargini. If \exampleindent is changed and the document style option fleqn is in effect, it may be desired to change \mathindent to the same new value. Finally, there are two ancilliary commands for use with the examples environment -- \attop and \atcenter. They can be used to change the positioning of the example number when something other than ordinary text -- for example, a picture of some kind -- is the example material. With most included pictures, the example number will by default be aligned with the bottom of the picture. If you wish the number to be aligned (vertically) with the centre of the picture you can do something like this: \begin{ex} \atcenter{\input{mypicture}} \end{ex} Similarly for \attop. Deprecated, but present for backwards compatibility with earlier versions, are the following environments: ex, subex, subex*, subexamples, subexamples*, subsubexamples, subsubexamples*.