  
  [1X1 [33X[0;0YIntroduction[133X[101X
  
  
  [1X1.1 [33X[0;0YCore Framework Functions[133X[101X
  
  [33X[0;0Y[5Xtypeset[105X  is  a  package  that implements a typesetting framework that can be
  implemented  for  numerous  typesetting  languages  as a standardised way to
  generate renderable strings.[133X
  
  [33X[0;0YAt  it's core, it implements the function [2XTypeset[102X ([14X1.1-2[114X) which makes use of
  typesetting  language-specific  functions  to generate format strings. These
  strings  are  then populated with a list of the semantic features of the [5XGAP[105X
  objects  they  represent,  which  is  obtained  from  the  operation [2XGenArgs[102X
  ([14X1.2-1[114X).[133X
  
  [33X[0;0YAn example implementation of this framework is also provided by this package
  for LaTeX typesetting within chapter [14X2[114X.[133X
  
  [33X[0;0YGuidelines  for  extending  the  framework  to  support  more  types, or for
  implementing  the  framework  for  another typesetting language can be found
  within the contributing guidelines in the GitHub repository.[133X
  
  [1X1.1-1 InfoTypeset[101X
  
  [33X[1;0Y[29X[2XInfoTypeset[102X [32X info class[133X
  
  [33X[0;0YInfo  class  for  the  [5Xtypeset[105X package. Set this to the following levels for
  different levels of information:[133X
  
  [30X    [33X[0;6Y0 - No messages[133X
  
  [30X    [33X[0;6Y1  -  Problems  only:  messages  describing  what  went wrong, with no
        messages if an operation is successful[133X
  
  [30X    [33X[0;6Y2  -  Required  preamble  packages:  displays  informations  about any
        required  LaTeX  packages  that need to be added to the preamble to be
        rendered.[133X
  
  [30X    [33X[0;6Y3 - Progress: also shows step-by-step progress of operations[133X
  
  [33X[0;0YSet  this  using, for example [10XSetInfoLevel(InfoTypeset, 1)[110X. Default value is
  2.[133X
  
  [1X1.1-2 Typeset[101X
  
  [33X[1;0Y[29X[2XTypeset[102X( [3Xobj[103X[, [3Xoptions[103X] ) [32X function[133X
  [6XReturns:[106X  [33X[0;10YA String, if [10XReturnStr[110X option is set to [10Xtrue[110X[133X
  
  [33X[0;0YGenerates  a mark-up string representing the object [3Xobj[103X in the given mark-up
  language. [5XGAP[105X options can also be added to modify the result:[133X
  
  [30X    [33X[0;6Y[10XReturnStr[110X  :  Whether  the  method  should  return a string ([10Xtrue[110X), or
        simply print the result ([10Xfalse[110X). (default - [10Xfalse[110X)[133X
  
  [30X    [33X[0;6Y[10XLDelim[110X : Left Delimiter for matrices. (default - [10X"("[110X)[133X
  
  [30X    [33X[0;6Y[10XRDelim[110X : Right Delimiter for matrices. (default - [10X")"[110X)[133X
  
  [30X    [33X[0;6Y[10XLang[110X : Markup language of output, currently only [10X"latex"[110X is supported.
        (default - [10X"latex"[110X)[133X
  
  [30X    [33X[0;6Y[10XDigraphOut[110X  : Typesetting method for Digraphs, one of [10X"dot"[110X to use raw
        dot  within  TeX,  or  [10X"dot2tex"[110X  to  convert  the  dot to native TeX.
        (default - [10X"dot"[110X)[133X
  
  [30X    [33X[0;6Y[10XSubCallOpts[110X  :  Alternate  [5XGAP[105X  options  for nested sub-objects, via a
        record  with the same options as the parent (but different values), or
        [10Xfalse[110X  if  all options are to stay the same between sub-calls. Options
        merging  is  handled  by  [2XMergeSubOptions[102X  ([14X1.3-1[114X).  (default - [10Xfalse[110X)
        either  by  specifying  each options as an individual GAP options like
        below:[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XTypeset([[1, 2], [2, 1]] : LDelim := "[", ReturnStr := true);[127X[104X
    [4X[28X"\\left[\\begin{array}{rr}\n1 & 2 \\\\\n2 & 1 \\\\\n\\end{array}\\right)\n"[128X[104X
  [4X[32X[104X
  
  [33X[0;0Yor wrapping them in a record under an [10Xoptions[110X GAP option, like:[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XTypeset([[1, 2], [2, 1]] : options := rec(LDelim := "[", ReturnStr := true));[127X[104X
    [4X[28X"\\left[\\begin{array}{rr}\n1 & 2 \\\\\n2 & 1 \\\\\n\\end{array}\\right)\n"[128X[104X
  [4X[32X[104X
  
  [33X[0;0Yor even simply passing a record object as the optional second argument:[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XTypeset([[1, 2], [2, 1]], rec(LDelim := "[", ReturnStr := true));[127X[104X
    [4X[28X"\\left[\\begin{array}{rr}\n1 & 2 \\\\\n2 & 1 \\\\\n\\end{array}\\right)\n"[128X[104X
  [4X[32X[104X
  
  [1X1.1-3 TypesetInternal[101X
  
  [33X[1;0Y[29X[2XTypesetInternal[102X( [3Xobj[103X ) [32X function[133X
  [6XReturns:[106X  [33X[0;10YA String[133X
  
  [33X[0;0YGenerates  a  string  representation  of a passed [5XGAP[105X object [3Xobj[103X that can be
  rendered  by a typesetter. Called from the top-level method [2XTypeset[102X ([14X1.1-2[114X),
  which also passes a constructed options record as the [10Xoptions[110X [5XGAP[105X option.[133X
  
  
  [1X1.2 [33X[0;0YCore Operations[133X[101X
  
  [1X1.2-1 GenArgs[101X
  
  [33X[1;0Y[29X[2XGenArgs[102X( [3Xobj[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA List of Strings[133X
  
  [33X[0;0YGenerates the arguments describing the semantic definition of the passed [5XGAP[105X
  object [3Xobj[103X. This returns a list that can be used to populate a format string
  in  any  mark-up  language.  If  no  method is installed for a type, it will
  fallback to returning the list [ ViewString(obj) ].[133X
  
  
  [1X1.3 [33X[0;0YConstants and Utility Functions[133X[101X
  
  [1X1.3-1 MergeSubOptions[101X
  
  [33X[1;0Y[29X[2XMergeSubOptions[102X( [3Xopts[103X ) [32X function[133X
  [6XReturns:[106X  [33X[0;10YA Record[133X
  
  [33X[0;0YMerges  the  passed options record [3Xopts[103X to change any values that are set in
  the  [5XGAP[105X  option  [10XSubCallOpts[110X. If this option is not false (default), it can
  contain  a  record  of any [5XGAP[105X options that can be passed to [2XTypeset[102X ([14X1.1-2[114X)
  which should differ for sub-calls.[133X
  
  [33X[0;0YFor  example,  to  alter the delimiters for nested objects so that the outer
  object  is  delimited  by square braces and the inner object by parentheses,
  the following can be set:[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XMergeSubOptions(rec(ReturnStr := false, Lang := "latex", DigraphOut := "dot", RDelim := "]", LDelim := "[", SubCallOpts := rec(RDelim := ")", LDelim := "(")));[127X[104X
    [4X[28Xrec(ReturnStr := false, Lang := "latex", DigraphOut := "dot", RDelim := ")", LDelim := "(", SubCallOpts := false)[128X[104X
  [4X[32X[104X
  
  [33X[0;0YIt  should  be noted that [10XSubCallOpts[110X only changes the options for one level
  of recursion (i.e. it is set back to the default of [10Xfalse[110X once this function
  is  called).  To  change  options for more recursion levels, the [10XSubCallOpts[110X
  option can be nested as many times as necessary.[133X
  
  [1X1.3-2 DEFAULT_TYPESET_OPTIONS[101X
  
  [33X[1;0Y[29X[2XDEFAULT_TYPESET_OPTIONS[102X [32X global variable[133X
  
  [33X[0;0YDefault  options record passed to [2XTypeset[102X ([14X1.1-2[114X). Merged with user-provided
  options to ensure correct construction of options for sub-calls, whilst also
  allowing option-less calls to the method.[133X
  
