function defineEnvironment(names, props, handler) {
      if (typeof names === "string") {
          names = [names];
      }
      if (typeof props === "number") {
          props = { numArgs: props };
      }
      // Set default values of environments
      var data = {
          numArgs: props.numArgs || 0,
          argTypes: props.argTypes,
          greediness: 1,
          allowedInText: !!props.allowedInText,
          numOptionalArgs: props.numOptionalArgs || 0,
          handler: handler
      };
      for (var i = 0; i < names.length; ++i) {
          module.exports[names[i]] = data;
      }
  }
/*
   * An environment definition is very similar to a function definition:
   * it is declared with a name or a list of names, a set of properties
   * and a handler containing the actual implementation.
   *
   * The properties include:
   *  - numArgs: The number of arguments after the \begin{name} function.
   *  - argTypes: (optional) Just like for a function
   *  - allowedInText: (optional) Whether or not the environment is allowed inside
   *                   text mode (default false) (not enforced yet)
   *  - numOptionalArgs: (optional) Just like for a function
   * A bare number instead of that object indicates the numArgs value.
   *
   * The handler function will receive two arguments
   *  - context: information and references provided by the parser
   *  - args: an array of arguments passed to \begin{name}
   * The context contains the following properties:
   *  - envName: the name of the environment, one of the listed names.
   *  - parser: the parser object
   *  - lexer: the lexer object
   *  - positions: the positions associated with these arguments from args.
   * The handler must return a ParseResult.
   */
An environment definition is very similar to a function definition:
it is declared with a name or a list of names, a set of properties
and a handler containing the actual implementation.

The properties include:
- numArgs: The number of arguments after the \begin{name} function.
- argTypes: (optional) Just like for a function
- allowedInText: (optional) Whether or not the environment is allowed inside
text mode (default false) (not enforced yet)
- numOptionalArgs: (optional) Just like for a function
A bare number instead of that object indicates the numArgs value.

The handler function will receive two arguments
- context: information and references provided by the parser
- args: an array of arguments passed to \begin{name}
The context contains the following properties:
- envName: the name of the environment, one of the listed names.
- parser: the parser object
- lexer: the lexer object
- positions: the positions associated with these arguments from args.
The handler must return a ParseResult.
An environment definition is very similar to a function definition : it is declared with a name or a list of names a set of properties and a handler containing the actual implementation . The properties include : - numArgs : The number of arguments after the \ begin { name } function . - argTypes : ( optional ) Just like for a function - allowedInText : ( optional ) Whether or not the environment is allowed inside text mode ( default false ) ( not enforced yet ) - numOptionalArgs : ( optional ) Just like for a function A bare number instead of that object indicates the numArgs value . The handler function will receive two arguments - context : information and references provided by the parser - args : an array of arguments passed to \ begin { name } The context contains the following properties : - envName : the name of the environment one of the listed names . - parser : the parser object - lexer : the lexer object - positions : the positions associated with these arguments from args . The handler must return a ParseResult .
function defineEnvironment(names, props, handler) {
      if (typeof names === "string") {
          names = [names];
      }
      if (typeof props === "number") {
          props = { numArgs: props };
      }
      var data = {
          numArgs: props.numArgs || 0,
          argTypes: props.argTypes,
          greediness: 1,
          allowedInText: !!props.allowedInText,
          numOptionalArgs: props.numOptionalArgs || 0,
          handler: handler
      };
      for (var i = 0; i < names.length; ++i) {
          module.exports[names[i]] = data;
      }
  }
function defineEnvironment ( names , props , handler ) { if ( typeof names === "string" ) { names = [ names ] ; } if ( typeof props === "number" ) { props = { numArgs : props } ; } var data = { numArgs : props . numArgs || 0 , argTypes : props . argTypes , greediness : 1 , allowedInText : ! ! props . allowedInText , numOptionalArgs : props . numOptionalArgs || 0 , handler : handler } ; for ( var i = 0 ; i < names . length ; ++ i ) { module . exports [ names [ i ] ] = data ; } }
An environment definition is very similar to a function definition:
 it is declared with a name or a list of names, a set of properties
 and a handler containing the actual implementation.
An environment definition is very similar to a function definition : it is declared with a name or a list of names a set of properties and a handler containing the actual implementation .
// Set default values of environments