
(/VERSIONCHECK 2) 

(DEFUN |TEX;new;$;1| ($) (VECTOR (LIST "$$") (LIST "") (LIST "$$"))) 

(DEFUN |TEX;newWithNum| (|stepNum| $)
  (PROG (|num|)
    (RETURN
      (SEQ (LETT |num|
                 (STRCONC (STRCONC "\\leqno(" (STRINGIMAGE |stepNum|))
                          ")")
                 |TEX;newWithNum|)
           (EXIT (VECTOR (LIST "$$") (LIST "") (LIST |num| "$$"))))))) 

(DEFUN |TEX;coerce;Of$;3| (|expr| $)
  (PROG (|f|)
    (RETURN
      (SEQ (LETT |f| (SPADCALL (QREFELT $ 22)) |TEX;coerce;Of$;3|)
           (QSETVELT |f| 1
               (LIST (|TEX;postcondition|
                         (|TEX;formatTex| (|TEX;precondition| |expr| $)
                             (QREFELT $ 9) $)
                         $)))
           (EXIT |f|))))) 

(DEFUN |TEX;convert;OfI$;4| (|expr| |stepNum| $)
  (PROG (|f|)
    (RETURN
      (SEQ (LETT |f| (|TEX;newWithNum| |stepNum| $)
                 |TEX;convert;OfI$;4|)
           (QSETVELT |f| 1
               (LIST (|TEX;postcondition|
                         (|TEX;formatTex| (|TEX;precondition| |expr| $)
                             (QREFELT $ 9) $)
                         $)))
           (EXIT |f|))))) 

(DEFUN |TEX;display;$IV;5| (|f| |len| $)
  (PROG (#0=#:G1865 #1=#:G1866 |t| #2=#:G1867 |s| #3=#:G1868)
    (RETURN
      (SEQ (SEQ (LETT |s| NIL . #4=(|TEX;display;$IV;5|))
                (LETT #0# (QVELT |f| 0) . #4#) G190
                (COND
                  ((OR (ATOM #0#)
                       (PROGN (LETT |s| (CAR #0#) . #4#) NIL))
                   #5=(GO G191)))
                (SEQ (EXIT (|sayTeX| |s|))) (LETT #0# (CDR #0#) . #4#)
                #6=(GO G190) G191 (EXIT NIL))
           (SEQ (LETT |s| NIL . #4#) (LETT #1# (QVELT |f| 1) . #4#)
                G190
                (COND
                  ((OR (ATOM #1#)
                       (PROGN (LETT |s| (CAR #1#) . #4#) NIL))
                   #5#))
                (SEQ (EXIT (SEQ (LETT |t| NIL . #4#)
                                (LETT #2#
                                      (|TEX;splitLong| |s| |len| $) . #4#)
                                G190
                                (COND
                                  ((OR (ATOM #2#)
                                    (PROGN
                                      (LETT |t| (CAR #2#) . #4#)
                                      NIL))
                                   #5#))
                                (SEQ (EXIT (|sayTeX| |t|)))
                                (LETT #2# (CDR #2#) . #4#) #6# G191
                                (EXIT NIL))))
                (LETT #1# (CDR #1#) . #4#) #6# G191 (EXIT NIL))
           (SEQ (LETT |s| NIL . #4#) (LETT #3# (QVELT |f| 2) . #4#)
                G190
                (COND
                  ((OR (ATOM #3#)
                       (PROGN (LETT |s| (CAR #3#) . #4#) NIL))
                   #5#))
                (SEQ (EXIT (|sayTeX| |s|))) (LETT #3# (CDR #3#) . #4#)
                #6# G191 (EXIT NIL))
           (EXIT (SPADCALL (QREFELT $ 28))))))) 

(DEFUN |TEX;display;$V;6| (|f| $)
  (SPADCALL |f| $LINELENGTH (QREFELT $ 29))) 

(PUT '|TEX;prologue;$L;7| '|SPADreplace| '(XLAM (|f|) (QVELT |f| 0))) 

(DEFUN |TEX;prologue;$L;7| (|f| $) (QVELT |f| 0)) 

(PUT '|TEX;tex;$L;8| '|SPADreplace| '(XLAM (|f|) (QVELT |f| 1))) 

(DEFUN |TEX;tex;$L;8| (|f| $) (QVELT |f| 1)) 

(PUT '|TEX;epilogue;$L;9| '|SPADreplace| '(XLAM (|f|) (QVELT |f| 2))) 

(DEFUN |TEX;epilogue;$L;9| (|f| $) (QVELT |f| 2)) 

(PUT '|TEX;setPrologue!;$2L;10| '|SPADreplace|
     '(XLAM (|f| |l|) (QSETVELT |f| 0 |l|))) 

(DEFUN |TEX;setPrologue!;$2L;10| (|f| |l| $) (QSETVELT |f| 0 |l|)) 

(PUT '|TEX;setTex!;$2L;11| '|SPADreplace|
     '(XLAM (|f| |l|) (QSETVELT |f| 1 |l|))) 

(DEFUN |TEX;setTex!;$2L;11| (|f| |l| $) (QSETVELT |f| 1 |l|)) 

(PUT '|TEX;setEpilogue!;$2L;12| '|SPADreplace|
     '(XLAM (|f| |l|) (QSETVELT |f| 2 |l|))) 

(DEFUN |TEX;setEpilogue!;$2L;12| (|f| |l| $) (QSETVELT |f| 2 |l|)) 

(DEFUN |TEX;coerce;$Of;13| (|f| $)
  (PROG (#0=#:G1882 #1=#:G1883 |t| #2=#:G1884 |s| #3=#:G1885 |l|)
    (RETURN
      (SEQ (LETT |l| NIL . #4=(|TEX;coerce;$Of;13|))
           (SEQ (LETT |s| NIL . #4#) (LETT #0# (QVELT |f| 0) . #4#)
                G190
                (COND
                  ((OR (ATOM #0#)
                       (PROGN (LETT |s| (CAR #0#) . #4#) NIL))
                   #5=(GO G191)))
                (SEQ (EXIT (LETT |l| (CONS |s| |l|) . #4#)))
                (LETT #0# (CDR #0#) . #4#) #6=(GO G190) G191
                (EXIT NIL))
           (SEQ (LETT |s| NIL . #4#) (LETT #1# (QVELT |f| 1) . #4#)
                G190
                (COND
                  ((OR (ATOM #1#)
                       (PROGN (LETT |s| (CAR #1#) . #4#) NIL))
                   #5#))
                (SEQ (EXIT (SEQ (LETT |t| NIL . #4#)
                                (LETT #2#
                                      (|TEX;splitLong| |s|
                                       (- $LINELENGTH 4) $) . #4#)
                                G190
                                (COND
                                  ((OR (ATOM #2#)
                                    (PROGN
                                      (LETT |t| (CAR #2#) . #4#)
                                      NIL))
                                   #5#))
                                (SEQ (EXIT
                                      (LETT |l| (CONS |t| |l|) . #4#)))
                                (LETT #2# (CDR #2#) . #4#) #6# G191
                                (EXIT NIL))))
                (LETT #1# (CDR #1#) . #4#) #6# G191 (EXIT NIL))
           (SEQ (LETT |s| NIL . #4#) (LETT #3# (QVELT |f| 2) . #4#)
                G190
                (COND
                  ((OR (ATOM #3#)
                       (PROGN (LETT |s| (CAR #3#) . #4#) NIL))
                   #5#))
                (SEQ (EXIT (LETT |l| (CONS |s| |l|) . #4#)))
                (LETT #3# (CDR #3#) . #4#) #6# G191 (EXIT NIL))
           (EXIT (SPADCALL (REVERSE |l|) (QREFELT $ 38))))))) 

(DEFUN |TEX;ungroup| (|str| $)
  (PROG (|len| |lbrace| |rbrace| |u|)
    (RETURN
      (SEQ (LETT |len| (QCSIZE |str|) . #0=(|TEX;ungroup|))
           (EXIT (COND
                   ((< |len| 2) |str|)
                   ('T
                    (SEQ (LETT |lbrace|
                               (SPADCALL "{" (QREFELT $ 42)) . #0#)
                         (LETT |rbrace|
                               (SPADCALL "}" (QREFELT $ 42)) . #0#)
                         (COND
                           ((SPADCALL (SPADCALL |str| 1 (QREFELT $ 43))
                                |lbrace| (QREFELT $ 45))
                            (COND
                              ((SPADCALL
                                   (SPADCALL |str| |len|
                                    (QREFELT $ 43))
                                   |rbrace| (QREFELT $ 45))
                               (SEQ (LETT |u|
                                     (SPADCALL 2 (- |len| 1)
                                      (QREFELT $ 47)) . #0#)
                                    (EXIT
                                     (LETT |str|
                                      (SPADCALL |str| |u|
                                       (QREFELT $ 48)) . #0#)))))))
                         (EXIT |str|))))))))) 

(DEFUN |TEX;postcondition| (|str| $)
  (PROG (|len| |plus| |minus| |i| #0=#:G1898)
    (RETURN
      (SEQ (LETT |str| (|TEX;ungroup| |str| $)
                 . #1=(|TEX;postcondition|))
           (LETT |len| (QCSIZE |str|) . #1#)
           (LETT |plus| (SPADCALL "+" (QREFELT $ 42)) . #1#)
           (LETT |minus| (SPADCALL "-" (QREFELT $ 42)) . #1#)
           (EXIT (COND
                   ((< |len| 4) |str|)
                   ('T
                    (SEQ (SEQ (LETT |i| 1 . #1#)
                              (LETT #0# (- |len| 1) . #1#) G190
                              (COND ((QSGREATERP |i| #0#) (GO G191)))
                              (SEQ (EXIT
                                    (COND
                                      ((SPADCALL
                                        (SPADCALL |str| |i|
                                         (QREFELT $ 43))
                                        |plus| (QREFELT $ 45))
                                       (COND
                                         ((SPADCALL
                                           (SPADCALL |str| (+ |i| 1)
                                            (QREFELT $ 43))
                                           |minus| (QREFELT $ 45))
                                          (SPADCALL |str| |i|
                                           (SPADCALL " "
                                            (QREFELT $ 42))
                                           (QREFELT $ 49))))))))
                              (LETT |i| (QSADD1 |i|) . #1#) (GO G190)
                              G191 (EXIT NIL))
                         (EXIT |str|))))))))) 

(PUT '|TEX;stringify| '|SPADreplace| '|object2String|) 

(DEFUN |TEX;stringify| (|expr| $) (|object2String| |expr|)) 

(DEFUN |TEX;lineConcat| (|line| |lines| $)
  (PROG (|length|)
    (RETURN
      (SEQ (LETT |length| (QCSIZE |line|) . #0=(|TEX;lineConcat|))
           (COND
             ((< 0 |length|)
              (SEQ (COND
                     ((SPADCALL
                          (SPADCALL |line| |length| (QREFELT $ 43))
                          (SPADCALL "\\" (QREFELT $ 42))
                          (QREFELT $ 45))
                      (LETT |line| (STRCONC |line| " ") . #0#)))
                   (COND
                     ((SPADCALL (SPADCALL |line| 1 (QREFELT $ 43))
                          (SPADCALL "%" (QREFELT $ 42)) (QREFELT $ 45))
                      (LETT |line| (STRCONC " \\" |line|) . #0#))
                     ((SPADCALL (SPADCALL |line| 1 (QREFELT $ 43))
                          (SPADCALL "\\" (QREFELT $ 42))
                          (QREFELT $ 45))
                      (COND
                        ((< 1 |length|)
                         (COND
                           ((SPADCALL
                                (SPADCALL |line| 2 (QREFELT $ 43))
                                (SPADCALL "%" (QREFELT $ 42))
                                (QREFELT $ 45))
                            (LETT |line| (STRCONC " " |line|) . #0#)))))))
                   (EXIT (LETT |lines| (CONS |line| |lines|) . #0#)))))
           (EXIT |lines|))))) 

(DEFUN |TEX;splitLong| (|str| |len| $)
  (SEQ (COND ((< |len| 20) (LETT |len| $LINELENGTH |TEX;splitLong|)))
       (EXIT (|TEX;splitLong1| |str| |len| $)))) 

(DEFUN |TEX;splitLong1| (|str| |len| $)
  (PROG (|ss| #0=#:G1928 |lss| |u| |ownLine| |ls| |s| |l|)
    (RETURN
      (SEQ (LETT |l| NIL . #1=(|TEX;splitLong1|)) (LETT |s| "" . #1#)
           (LETT |ls| 0 . #1#)
           (SEQ (LETT |ss| NIL . #1#)
                (LETT #0#
                      (SPADCALL |str| (SPADCALL " " (QREFELT $ 42))
                          (QREFELT $ 51)) . #1#)
                G190
                (COND
                  ((OR (ATOM #0#)
                       (PROGN (LETT |ss| (CAR #0#) . #1#) NIL))
                   (GO G191)))
                (SEQ (EXIT (COND
                             ((EQUAL |ss| "\\\\")
                              (SEQ (LETT |l|
                                    (|TEX;lineConcat|
                                     (STRCONC |s| |ss|) |l| $) . #1#)
                                   (LETT |s| "" . #1#)
                                   (EXIT (LETT |ls| 0 . #1#))))
                             ('T
                              (SEQ (LETT |lss| (QCSIZE |ss|) . #1#)
                                   (LETT |ownLine|
                                    (SEQ
                                     (LETT |u|
                                      (SPADCALL 1 4 (QREFELT $ 47)) . #1#)
                                     (COND
                                       ((< 3 |lss|)
                                        (COND
                                          ((EQUAL "\\end"
                                            (SPADCALL |ss| |u|
                                             (QREFELT $ 48)))
                                           (EXIT 'T)))))
                                     (LETT |u|
                                      (SPADCALL 1 5 (QREFELT $ 47)) . #1#)
                                     (COND
                                       ((< 4 |lss|)
                                        (COND
                                          ((EQUAL "\\left"
                                            (SPADCALL |ss| |u|
                                             (QREFELT $ 48)))
                                           (EXIT 'T)))))
                                     (LETT |u|
                                      (SPADCALL 1 6 (QREFELT $ 47)) . #1#)
                                     (COND
                                       ((< 5 |lss|)
                                        (COND
                                          ((OR
                                            (EQUAL "\\right"
                                             (SPADCALL |ss| |u|
                                              (QREFELT $ 48)))
                                            (EQUAL "\\begin"
                                             (SPADCALL |ss| |u|
                                              (QREFELT $ 48))))
                                           (EXIT 'T)))))
                                     (EXIT 'NIL)) . #1#)
                                   (COND
                                     ((OR |ownLine|
                                       (< |len| (+ |ls| |lss|)))
                                      (SEQ
                                       (COND
                                         ((NULL
                                           (SPADCALL |s|
                                            (QREFELT $ 52)))
                                          (LETT |l|
                                           (|TEX;lineConcat| |s| |l| $) . #1#)))
                                       (LETT |s| "" . #1#)
                                       (EXIT (LETT |ls| 0 . #1#)))))
                                   (COND
                                     ((OR |ownLine| (< |len| |lss|))
                                      (EXIT
                                       (LETT |l|
                                        (|TEX;lineConcat| |ss| |l| $) . #1#))))
                                   (COND
                                     ((EQL |lss| 1)
                                      (COND
                                        ((SPADCALL
                                          (SPADCALL |ss| 1
                                           (QREFELT $ 43))
                                          (SPADCALL "\\"
                                           (QREFELT $ 42))
                                          (QREFELT $ 45))
                                         (EXIT
                                          (SEQ
                                           (LETT |ls|
                                            (+ (+ |ls| |lss|) 2) . #1#)
                                           (EXIT
                                            (LETT |s|
                                             (STRCONC |s|
                                              (STRCONC |ss| "  ")) . #1#))))))))
                                   (LETT |ls|
                                    (+ (+ |ls| |lss|) 1) . #1#)
                                   (EXIT
                                    (LETT |s|
                                     (STRCONC |s| (STRCONC |ss| " ")) . #1#)))))))
                (LETT #0# (CDR #0#) . #1#) (GO G190) G191 (EXIT NIL))
           (COND
             ((< 0 |ls|) (LETT |l| (|TEX;lineConcat| |s| |l| $) . #1#)))
           (EXIT (REVERSE |l|)))))) 

(DEFUN |TEX;group| (|str| $)
  (SPADCALL (LIST "{" |str| "}") (QREFELT $ 53))) 

(DEFUN |TEX;addBraces| (|str| $)
  (SPADCALL (LIST "\\left\\{ " |str| " \\right\\}") (QREFELT $ 53))) 

(DEFUN |TEX;addBrackets| (|str| $)
  (SPADCALL (LIST "\\left[ " |str| " \\right]") (QREFELT $ 53))) 

(DEFUN |TEX;parenthesize| (|str| $)
  (SPADCALL (LIST "\\left( " |str| " \\right)") (QREFELT $ 53))) 

(PUT '|TEX;precondition| '|SPADreplace| '|outputTran|) 

(DEFUN |TEX;precondition| (|expr| $) (|outputTran| |expr|)) 

(DEFUN |TEX;formatSpecial| (|op| |args| |prec| $)
  (PROG (#0=#:G1949 |u| #1=#:G1950 |form| |prescript| |tmp|)
    (RETURN
      (SEQ (LETT |prescript| 'NIL . #2=(|TEX;formatSpecial|))
           (EXIT (COND
                   ((EQUAL |op| "theMap") "\\mbox{theMap(...)}")
                   ((EQUAL |op| "AGGLST")
                    (|TEX;formatNary| "," |args| |prec| $))
                   ((EQUAL |op| "AGGSET")
                    (|TEX;formatNary| ";" |args| |prec| $))
                   ((EQUAL |op| "TAG")
                    (|TEX;group|
                        (SPADCALL
                            (LIST (|TEX;formatTex| (|SPADfirst| |args|)
                                      |prec| $)
                                  "\\rightarrow"
                                  (|TEX;formatTex|
                                      (SPADCALL |args| (QREFELT $ 55))
                                      |prec| $))
                            (QREFELT $ 53))
                        $))
                   ((EQUAL |op| "VCONCAT")
                    (|TEX;group|
                        (STRCONC "\\begin{array}{c}"
                                 (STRCONC (SPADCALL
                                           (PROGN
                                             (LETT #0# NIL . #2#)
                                             (SEQ (LETT |u| NIL . #2#)
                                              (LETT #1# |args| . #2#)
                                              G190
                                              (COND
                                                ((OR (ATOM #1#)
                                                  (PROGN
                                                    (LETT |u|
                                                     (CAR #1#) . #2#)
                                                    NIL))
                                                 (GO G191)))
                                              (SEQ
                                               (EXIT
                                                (LETT #0#
                                                 (CONS
                                                  (STRCONC
                                                   (|TEX;formatTex| |u|
                                                    (QREFELT $ 9) $)
                                                   "\\\\")
                                                  #0#) . #2#)))
                                              (LETT #1#
                                               (CDR #1#) . #2#)
                                              (GO G190) G191
                                              (EXIT (NREVERSE0 #0#))))
                                           (QREFELT $ 53))
                                          "\\end{array}"))
                        $))
                   ((EQUAL |op| "CONCATB")
                    (|TEX;formatNary| " " |args| |prec| $))
                   ((EQUAL |op| "CONCAT")
                    (|TEX;formatNary| "" |args| (QREFELT $ 9) $))
                   ((EQUAL |op| "QUOTE")
                    (|TEX;group|
                        (STRCONC "{\\tt '}"
                                 (|TEX;formatTex| (|SPADfirst| |args|)
                                     (QREFELT $ 9) $))
                        $))
                   ((EQUAL |op| "BRACKET")
                    (|TEX;group|
                        (|TEX;addBrackets|
                            (|TEX;ungroup|
                                (|TEX;formatTex| (|SPADfirst| |args|)
                                    (QREFELT $ 9) $)
                                $)
                            $)
                        $))
                   ((EQUAL |op| "BRACE")
                    (|TEX;group|
                        (|TEX;addBraces|
                            (|TEX;ungroup|
                                (|TEX;formatTex| (|SPADfirst| |args|)
                                    (QREFELT $ 9) $)
                                $)
                            $)
                        $))
                   ((EQUAL |op| "PAREN")
                    (|TEX;group|
                        (|TEX;parenthesize|
                            (|TEX;ungroup|
                                (|TEX;formatTex| (|SPADfirst| |args|)
                                    (QREFELT $ 9) $)
                                $)
                            $)
                        $))
                   ((EQUAL |op| "OVERBAR")
                    (COND
                      ((NULL |args|) "")
                      (#3='T
                       (|TEX;group|
                           (SPADCALL
                               (LIST "\\overline "
                                     (|TEX;formatTex|
                                      (|SPADfirst| |args|)
                                      (QREFELT $ 9) $))
                               (QREFELT $ 53))
                           $))))
                   ((EQUAL |op| "ROOT")
                    (COND
                      ((NULL |args|) "")
                      (#3#
                       (SEQ (LETT |tmp|
                                  (|TEX;group|
                                      (|TEX;formatTex|
                                       (|SPADfirst| |args|)
                                       (QREFELT $ 9) $)
                                      $) . #2#)
                            (EXIT (COND
                                    ((NULL (CDR |args|))
                                     (|TEX;group|
                                      (SPADCALL (LIST "\\sqrt " |tmp|)
                                       (QREFELT $ 53))
                                      $))
                                    ('T
                                     (|TEX;group|
                                      (SPADCALL
                                       (LIST "\\root "
                                        (|TEX;group|
                                         (|TEX;formatTex|
                                          (|SPADfirst| (CDR |args|))
                                          (QREFELT $ 9) $)
                                         $)
                                        " \\of " |tmp|)
                                       (QREFELT $ 53))
                                      $))))))))
                   ((EQUAL |op| "SEGMENT")
                    (SEQ (LETT |tmp|
                               (SPADCALL
                                   (LIST
                                    (|TEX;formatTex|
                                     (|SPADfirst| |args|) (QREFELT $ 9)
                                     $)
                                    "..")
                                   (QREFELT $ 53)) . #2#)
                         (EXIT (|TEX;group|
                                   (COND
                                     ((NULL (CDR |args|)) |tmp|)
                                     ('T
                                      (SPADCALL
                                       (LIST |tmp|
                                        (|TEX;formatTex|
                                         (|SPADfirst| (CDR |args|))
                                         (QREFELT $ 9) $))
                                       (QREFELT $ 53))))
                                   $))))
                   ((EQUAL |op| "SUB")
                    (|TEX;group|
                        (SPADCALL
                            (LIST (|TEX;formatTex| (|SPADfirst| |args|)
                                      (QREFELT $ 9) $)
                                  " \\sb "
                                  (|TEX;formatSpecial| "AGGLST"
                                      (CDR |args|) (QREFELT $ 9) $))
                            (QREFELT $ 53))
                        $))
                   ((EQUAL |op| "SUPERSUB")
                    (SEQ (LETT |form|
                               (LIST (|TEX;formatTex|
                                      (|SPADfirst| |args|)
                                      (QREFELT $ 9) $)) . #2#)
                         (LETT |args| (CDR |args|) . #2#)
                         (EXIT (COND
                                 ((NULL |args|)
                                  (SPADCALL |form| (QREFELT $ 53)))
                                 (#3#
                                  (SEQ (LETT |tmp|
                                        (|TEX;formatTex|
                                         (|SPADfirst| |args|)
                                         (QREFELT $ 9) $) . #2#)
                                       (COND
                                         ((NULL (EQUAL |tmp| ""))
                                          (COND
                                            ((NULL (EQUAL |tmp| "{}"))
                                             (COND
                                               ((NULL
                                                 (EQUAL |tmp| " "))
                                                (LETT |form|
                                                 (APPEND |form|
                                                  (LIST " \\sb "
                                                   (|TEX;group| |tmp|
                                                    $))) . #2#)))))))
                                       (LETT |args| (CDR |args|) . #2#)
                                       (EXIT
                                        (COND
                                          ((NULL |args|)
                                           (|TEX;group|
                                            (SPADCALL |form|
                                             (QREFELT $ 53))
                                            $))
                                          (#3#
                                           (SEQ
                                            (LETT |tmp|
                                             (|TEX;formatTex|
                                              (|SPADfirst| |args|)
                                              (QREFELT $ 9) $) . #2#)
                                            (COND
                                              ((NULL (EQUAL |tmp| ""))
                                               (COND
                                                 ((NULL
                                                   (EQUAL |tmp| "{}"))
                                                  (COND
                                                    ((NULL
                                                      (EQUAL |tmp| " "))
                                                     (LETT |form|
                                                      (APPEND |form|
                                                       (LIST " \\sp "
                                                        (|TEX;group|
                                                         |tmp| $))) . #2#)))))))
                                            (LETT |args|
                                             (CDR |args|) . #2#)
                                            (EXIT
                                             (COND
                                               ((NULL |args|)
                                                (|TEX;group|
                                                 (SPADCALL |form|
                                                  (QREFELT $ 53))
                                                 $))
                                               (#3#
                                                (SEQ
                                                 (LETT |tmp|
                                                  (|TEX;formatTex|
                                                   (|SPADfirst| |args|)
                                                   (QREFELT $ 9) $) . #2#)
                                                 (COND
                                                   ((NULL
                                                     (EQUAL |tmp| ""))
                                                    (COND
                                                      ((NULL
                                                        (EQUAL |tmp|
                                                         "{}"))
                                                       (COND
                                                         ((NULL
                                                           (EQUAL |tmp|
                                                            " "))
                                                          (SEQ
                                                           (LETT |form|
                                                            (APPEND
                                                             (LIST
                                                              " \\sp "
                                                              (|TEX;group|
                                                               |tmp| $))
                                                             |form|) . #2#)
                                                           (EXIT
                                                            (LETT
                                                             |prescript|
                                                             'T . #2#)))))))))
                                                 (LETT |args|
                                                  (CDR |args|) . #2#)
                                                 (EXIT
                                                  (COND
                                                    ((NULL |args|)
                                                     (|TEX;group|
                                                      (SPADCALL
                                                       (COND
                                                         (|prescript|
                                                          (CONS "{}"
                                                           |form|))
                                                         (#3# |form|))
                                                       (QREFELT $ 53))
                                                      $))
                                                    (#3#
                                                     (SEQ
                                                      (LETT |tmp|
                                                       (|TEX;formatTex|
                                                        (|SPADfirst|
                                                         |args|)
                                                        (QREFELT $ 9)
                                                        $) . #2#)
                                                      (COND
                                                        ((NULL
                                                          (EQUAL |tmp|
                                                           ""))
                                                         (COND
                                                           ((NULL
                                                             (EQUAL
                                                              |tmp|
                                                              "{}"))
                                                            (COND
                                                              ((NULL
                                                                (EQUAL
                                                                 |tmp|
                                                                 " "))
                                                               (SEQ
                                                                (LETT
                                                                 |form|
                                                                 (APPEND
                                                                  (LIST
                                                                   " \\sb "
                                                                   (|TEX;group|
                                                                    |tmp|
                                                                    $))
                                                                  |form|) . #2#)
                                                                (EXIT
                                                                 (LETT
                                                                  |prescript|
                                                                  'T . #2#)))))))))
                                                      (EXIT
                                                       (|TEX;group|
                                                        (SPADCALL
                                                         (COND
                                                           (|prescript|
                                                            (CONS "{}"
                                                             |form|))
                                                           (#3# |form|))
                                                         (QREFELT $ 53))
                                                        $))))))))))))))))))))
                   ((EQUAL |op| "SC")
                    (COND
                      ((NULL |args|) "")
                      (#3#
                       (SEQ (LETT |tmp|
                                  (|TEX;formatNaryNoGroup| " \\\\ "
                                      |args| (QREFELT $ 9) $) . #2#)
                            (EXIT (|TEX;group|
                                      (SPADCALL
                                       (LIST "\\begin{array}{l} " |tmp|
                                        " \\end{array} ")
                                       (QREFELT $ 53))
                                      $))))))
                   ((EQUAL |op| "MATRIX")
                    (|TEX;formatMatrix| (CDR |args|) $))
                   ((EQUAL |op| "ZAG")
                    (SPADCALL
                        (LIST " \\zag{"
                              (|TEX;formatTex| (|SPADfirst| |args|)
                                  (QREFELT $ 9) $)
                              "}{"
                              (|TEX;formatTex|
                                  (|SPADfirst| (CDR |args|))
                                  (QREFELT $ 9) $)
                              "}")
                        (QREFELT $ 53)))
                   (#3#
                    (SPADCALL (LIST "not done yet for " |op|)
                        (QREFELT $ 53))))))))) 

(DEFUN |TEX;formatPlex| (|op| |args| |prec| $)
  (PROG (|p| |opPrec| |n| |hold| |s|)
    (RETURN
      (SEQ (LETT |p| (SPADCALL |op| (QREFELT $ 17) (QREFELT $ 56))
                 . #0=(|TEX;formatPlex|))
           (EXIT (COND
                   ((< |p| 1) (|error| "unknown Tex unary op"))
                   (#1='T
                    (SEQ (LETT |opPrec|
                               (SPADCALL (QREFELT $ 18) |p|
                                   (QREFELT $ 58)) . #0#)
                         (LETT |n| (LENGTH |args|) . #0#)
                         (COND
                           ((NULL (EQL |n| 2))
                            (COND
                              ((NULL (EQL |n| 3))
                               (EXIT (|error|
                                      "wrong number of arguments for plex"))))))
                         (LETT |s|
                               (COND
                                 ((OR (EQUAL |op| "SIGMA")
                                      (EQUAL |op| "SIGMA2"))
                                  "\\sum")
                                 ((OR (EQUAL |op| "PI")
                                      (EQUAL |op| "PI2"))
                                  "\\prod")
                                 ((OR (EQUAL |op| "INTSIGN")
                                      (EQUAL |op| "INDEFINTEGRAL"))
                                  "\\int")
                                 (#1# "????")) . #0#)
                         (LETT |hold|
                               (|TEX;formatTex| (|SPADfirst| |args|)
                                   (QREFELT $ 9) $) . #0#)
                         (LETT |args| (CDR |args|) . #0#)
                         (COND
                           ((EQUAL |op| "INDEFINTEGRAL")
                            (SEQ (LETT |hold|
                                       (|TEX;group|
                                        (SPADCALL
                                         (LIST |hold| " "
                                          (|TEX;formatTex|
                                           (|SPADfirst| |args|)
                                           (QREFELT $ 9) $))
                                         (QREFELT $ 53))
                                        $) . #0#)
                                 (EXIT (LETT |s|
                                        (SPADCALL (LIST |s| " " |hold|)
                                         (QREFELT $ 53)) . #0#))))
                           (#1#
                            (SEQ (COND
                                   ((NULL (EQUAL |hold| ""))
                                    (LETT |s|
                                     (SPADCALL
                                      (LIST |s| " \\sb"
                                       (|TEX;group|
                                        (SPADCALL
                                         (LIST "\\displaystyle "
                                          |hold|)
                                         (QREFELT $ 53))
                                        $))
                                      (QREFELT $ 53)) . #0#)))
                                 (COND
                                   ((NULL (NULL (CDR |args|)))
                                    (SEQ
                                     (LETT |hold|
                                      (|TEX;formatTex|
                                       (|SPADfirst| |args|)
                                       (QREFELT $ 9) $) . #0#)
                                     (COND
                                       ((NULL (EQUAL |hold| ""))
                                        (LETT |s|
                                         (SPADCALL
                                          (LIST |s| " \\sp"
                                           (|TEX;group|
                                            (SPADCALL
                                             (LIST "\\displaystyle "
                                              |hold|)
                                             (QREFELT $ 53))
                                            $))
                                          (QREFELT $ 53)) . #0#)))
                                     (EXIT
                                      (LETT |args| (CDR |args|) . #0#)))))
                                 (EXIT (LETT |s|
                                        (SPADCALL
                                         (LIST |s| " "
                                          (|TEX;formatTex|
                                           (|SPADfirst| |args|)
                                           (QREFELT $ 9) $))
                                         (QREFELT $ 53)) . #0#)))))
                         (COND
                           ((< |opPrec| |prec|)
                            (LETT |s| (|TEX;parenthesize| |s| $) . #0#)))
                         (EXIT (|TEX;group| |s| $)))))))))) 

(DEFUN |TEX;formatMatrix| (|args| $)
  (PROG (|i| #0=#:G1962 |cols|)
    (RETURN
      (SEQ (LETT |cols| "{" . #1=(|TEX;formatMatrix|))
           (SEQ (LETT |i| 2 . #1#)
                (LETT #0# (LENGTH (|SPADfirst| |args|)) . #1#) G190
                (COND ((QSGREATERP |i| #0#) (GO G191)))
                (SEQ (EXIT (LETT |cols| (STRCONC |cols| "c") . #1#)))
                (LETT |i| (QSADD1 |i|) . #1#) (GO G190) G191
                (EXIT NIL))
           (LETT |cols| (STRCONC |cols| "} ") . #1#)
           (EXIT (|TEX;group|
                     (|TEX;addBrackets|
                         (SPADCALL
                             (LIST "\\begin{array}" |cols|
                                   (|TEX;formatNaryNoGroup| " \\\\ "
                                    |args| (QREFELT $ 9) $)
                                   " \\end{array} ")
                             (QREFELT $ 53))
                         $)
                     $)))))) 

(DEFUN |TEX;formatFunction| (|op| |args| |prec| $)
  (|TEX;group|
      (SPADCALL
          (LIST |op| " "
                (|TEX;parenthesize|
                    (|TEX;formatNary| "," |args| (QREFELT $ 9) $) $))
          (QREFELT $ 53))
      $)) 

(DEFUN |TEX;formatNullary| (|op| $)
  (COND
    ((EQUAL |op| "NOTHING") "")
    ('T (|TEX;group| (SPADCALL (LIST |op| "()") (QREFELT $ 53)) $)))) 

(DEFUN |TEX;formatUnary| (|op| |arg| |prec| $)
  (PROG (|p| |opPrec| |s|)
    (RETURN
      (SEQ (LETT |p| (SPADCALL |op| (QREFELT $ 10) (QREFELT $ 56))
                 . #0=(|TEX;formatUnary|))
           (EXIT (COND
                   ((< |p| 1) (|error| "unknown Tex unary op"))
                   (#1='T
                    (SEQ (LETT |opPrec|
                               (SPADCALL (QREFELT $ 11) |p|
                                   (QREFELT $ 58)) . #0#)
                         (LETT |s|
                               (SPADCALL
                                   (LIST |op|
                                    (|TEX;formatTex| |arg| |opPrec| $))
                                   (QREFELT $ 53)) . #0#)
                         (EXIT (COND
                                 ((< |opPrec| |prec|)
                                  (|TEX;group|
                                      (|TEX;parenthesize| |s| $) $))
                                 ((EQUAL |op| "-") |s|)
                                 (#1# (|TEX;group| |s| $)))))))))))) 

(DEFUN |TEX;formatBinary| (|op| |args| |prec| $)
  (PROG (|p| |opPrec| |s|)
    (RETURN
      (SEQ (LETT |p| (SPADCALL |op| (QREFELT $ 12) (QREFELT $ 56))
                 . #0=(|TEX;formatBinary|))
           (EXIT (COND
                   ((< |p| 1) (|error| "unknown Tex binary op"))
                   (#1='T
                    (SEQ (LETT |op|
                               (COND
                                 ((EQUAL |op| "|") " \\mid ")
                                 ((EQUAL |op| "**") " \\sp ")
                                 ((OR (EQUAL |op| "/")
                                      (EQUAL |op| "OVER"))
                                  " \\over ")
                                 ((EQUAL |op| "+->") " \\mapsto ")
                                 (#1# |op|)) . #0#)
                         (LETT |opPrec|
                               (SPADCALL (QREFELT $ 13) |p|
                                   (QREFELT $ 58)) . #0#)
                         (LETT |s|
                               (|TEX;formatTex| (|SPADfirst| |args|)
                                   |opPrec| $) . #0#)
                         (LETT |s|
                               (SPADCALL
                                   (LIST |s| |op|
                                    (|TEX;formatTex|
                                     (|SPADfirst| (CDR |args|))
                                     |opPrec| $))
                                   (QREFELT $ 53)) . #0#)
                         (EXIT (|TEX;group|
                                   (COND
                                     ((OR (EQUAL |op| " \\over ")
                                       (NULL (< |opPrec| |prec|)))
                                      |s|)
                                     ('T (|TEX;parenthesize| |s| $)))
                                   $)))))))))) 

(DEFUN |TEX;formatNary| (|op| |args| |prec| $)
  (|TEX;group| (|TEX;formatNaryNoGroup| |op| |args| |prec| $) $)) 

(DEFUN |TEX;formatNaryNoGroup| (|op| |args| |prec| $)
  (PROG (|p| |opPrec| |a| #0=#:G1980 |l| |s|)
    (RETURN
      (SEQ (COND
             ((NULL |args|) "")
             (#1='T
              (SEQ (LETT |p|
                         (SPADCALL |op| (QREFELT $ 14) (QREFELT $ 56))
                         . #2=(|TEX;formatNaryNoGroup|))
                   (EXIT (COND
                           ((< |p| 1) (|error| "unknown Tex nary op"))
                           (#1#
                            (SEQ (LETT |op|
                                       (COND
                                         ((EQUAL |op| ",") ", \\: ")
                                         ((EQUAL |op| ";") "; \\: ")
                                         ((EQUAL |op| "*")
                                          (QREFELT $ 7))
                                         ((EQUAL |op| " ") " \\ ")
                                         ((EQUAL |op| "ROW") " & ")
                                         (#1# |op|)) . #2#)
                                 (LETT |l| NIL . #2#)
                                 (LETT |opPrec|
                                       (SPADCALL (QREFELT $ 15) |p|
                                        (QREFELT $ 58)) . #2#)
                                 (SEQ (LETT |a| NIL . #2#)
                                      (LETT #0# |args| . #2#) G190
                                      (COND
                                        ((OR (ATOM #0#)
                                          (PROGN
                                            (LETT |a| (CAR #0#) . #2#)
                                            NIL))
                                         (GO G191)))
                                      (SEQ
                                       (EXIT
                                        (LETT |l|
                                         (CONS |op|
                                          (CONS
                                           (|TEX;formatTex| |a|
                                            |opPrec| $)
                                           |l|)) . #2#)))
                                      (LETT #0# (CDR #0#) . #2#)
                                      (GO G190) G191 (EXIT NIL))
                                 (LETT |s|
                                       (SPADCALL (REVERSE (CDR |l|))
                                        (QREFELT $ 53)) . #2#)
                                 (EXIT (COND
                                         ((< |opPrec| |prec|)
                                          (|TEX;parenthesize| |s| $))
                                         (#1# |s|)))))))))))))) 

(DEFUN |TEX;formatTex| (|expr| |prec| $)
  (PROG (|intSplitLen| |len| |str| |nstr| |u| |i| |l| |args| |nargs|
            |op|)
    (RETURN
      (SEQ (LETT |intSplitLen| 20 . #0=(|TEX;formatTex|))
           (EXIT (COND
                   ((ATOM |expr|)
                    (SEQ (LETT |str| (|TEX;stringify| |expr| $) . #0#)
                         (LETT |len| (QCSIZE |str|) . #0#)
                         (EXIT (COND
                                 ((FIXP |expr|)
                                  (SEQ (LETT |i| |expr| . #0#)
                                       (EXIT
                                        (COND
                                          ((OR (< |i| 0) (< 9 |i|))
                                           (|TEX;group|
                                            (SEQ (LETT |nstr| "" . #0#)
                                             (SEQ G190
                                              (COND
                                                ((NULL
                                                  (< |intSplitLen|
                                                   (LETT |len|
                                                    (QCSIZE |str|) . #0#)))
                                                 (GO G191)))
                                              (SEQ
                                               (LETT |nstr|
                                                (SPADCALL
                                                 (LIST |nstr| " "
                                                  (SPADCALL |str|
                                                   (SPADCALL 1
                                                    |intSplitLen|
                                                    (QREFELT $ 47))
                                                   (QREFELT $ 48)))
                                                 (QREFELT $ 53)) . #0#)
                                               (EXIT
                                                (LETT |str|
                                                 (SPADCALL |str|
                                                  (SPADCALL
                                                   (+ |intSplitLen| 1)
                                                   (QREFELT $ 59))
                                                  (QREFELT $ 48)) . #0#)))
                                              NIL (GO G190) G191
                                              (EXIT NIL))
                                             (EXIT
                                              (COND
                                                ((SPADCALL |nstr|
                                                  (QREFELT $ 52))
                                                 |str|)
                                                ('T
                                                 (SEQ
                                                  (LETT |nstr|
                                                   (COND
                                                     ((SPADCALL |str|
                                                       (QREFELT $ 52))
                                                      |nstr|)
                                                     ('T
                                                      (SPADCALL
                                                       (LIST |nstr| " "
                                                        |str|)
                                                       (QREFELT $ 53)))) . #0#)
                                                  (EXIT
                                                   (SPADCALL |nstr|
                                                    (SPADCALL 2
                                                     (QREFELT $ 59))
                                                    (QREFELT $ 48))))))))
                                            $))
                                          ('T |str|)))))
                                 ((EQUAL |str| "%pi") "\\pi")
                                 ((EQUAL |str| "%e") "e")
                                 ((EQUAL |str| "%i") "i")
                                 ('T
                                  (SEQ (COND
                                         ((< 1 |len|)
                                          (COND
                                            ((SPADCALL
                                              (SPADCALL |str| 1
                                               (QREFELT $ 43))
                                              (SPADCALL "%"
                                               (QREFELT $ 42))
                                              (QREFELT $ 45))
                                             (COND
                                               ((SPADCALL
                                                 (SPADCALL |str| 2
                                                  (QREFELT $ 43))
                                                 (SPADCALL "%"
                                                  (QREFELT $ 42))
                                                 (QREFELT $ 45))
                                                (EXIT
                                                 (SEQ
                                                  (LETT |u|
                                                   (SPADCALL 3 |len|
                                                    (QREFELT $ 47)) . #0#)
                                                  (EXIT
                                                   (STRCONC " \\%\\%"
                                                    (SPADCALL |str| |u|
                                                     (QREFELT $ 48))))))))))))
                                       (COND
                                         ((< 0 |len|)
                                          (COND
                                            ((SPADCALL
                                              (SPADCALL |str| 1
                                               (QREFELT $ 43))
                                              (SPADCALL "%"
                                               (QREFELT $ 42))
                                              (QREFELT $ 45))
                                             (EXIT
                                              (STRCONC " \\" |str|))))))
                                       (COND
                                         ((< 1 |len|)
                                          (COND
                                            ((SPADCALL
                                              (SPADCALL |str| 1
                                               (QREFELT $ 43))
                                              (QREFELT $ 60))
                                             (EXIT
                                              (|TEX;group| |str| $))))))
                                       (COND
                                         ((< 0 |len|)
                                          (COND
                                            ((SPADCALL
                                              (SPADCALL |str| 1
                                               (QREFELT $ 43))
                                              (SPADCALL "\""
                                               (QREFELT $ 42))
                                              (QREFELT $ 45))
                                             (EXIT
                                              (STRCONC
                                               (STRCONC " \\mbox{\\tt "
                                                |str|)
                                               "} "))))))
                                       (COND
                                         ((EQL |len| 1)
                                          (COND
                                            ((SPADCALL
                                              (SPADCALL |str| 1
                                               (QREFELT $ 43))
                                              (SPADCALL " "
                                               (QREFELT $ 42))
                                              (QREFELT $ 45))
                                             (EXIT "{\\ }")))))
                                       (LETT |i|
                                        (SPADCALL |str| (QREFELT $ 20)
                                         (QREFELT $ 56)) . #0#)
                                       (EXIT
                                        (COND
                                          ((< 0 |i|)
                                           (SPADCALL (QREFELT $ 21) |i|
                                            (QREFELT $ 61)))
                                          ('T
                                           (SEQ
                                            (LETT |i|
                                             (SPADCALL
                                              (SPADCALL " "
                                               (QREFELT $ 42))
                                              |str| (QREFELT $ 62)) . #0#)
                                            (EXIT
                                             (COND
                                               ((< 0 |i|)
                                                (STRCONC
                                                 (STRCONC
                                                  " \\mbox{\\rm "
                                                  |str|)
                                                 "} "))
                                               ('T |str|)))))))))))))
                   ('T
                    (SEQ (LETT |l| |expr| . #0#)
                         (EXIT (COND
                                 ((NULL |l|) (QREFELT $ 7))
                                 ('T
                                  (SEQ (LETT |op|
                                        (|TEX;stringify|
                                         (|SPADfirst| |l|) $) . #0#)
                                       (LETT |args| (CDR |l|) . #0#)
                                       (LETT |nargs|
                                        (LENGTH |args|) . #0#)
                                       (EXIT
                                        (COND
                                          ((SPADCALL |op|
                                            (QREFELT $ 19)
                                            (QREFELT $ 63))
                                           (|TEX;formatSpecial| |op|
                                            |args| |prec| $))
                                          ((SPADCALL |op|
                                            (QREFELT $ 17)
                                            (QREFELT $ 63))
                                           (|TEX;formatPlex| |op|
                                            |args| |prec| $))
                                          ((EQL 0 |nargs|)
                                           (|TEX;formatNullary| |op| $))
                                          ('T
                                           (SEQ
                                            (COND
                                              ((EQL 1 |nargs|)
                                               (COND
                                                 ((SPADCALL |op|
                                                   (QREFELT $ 10)
                                                   (QREFELT $ 63))
                                                  (EXIT
                                                   (|TEX;formatUnary|
                                                    |op|
                                                    (|SPADfirst|
                                                     |args|)
                                                    |prec| $))))))
                                            (COND
                                              ((EQL 2 |nargs|)
                                               (COND
                                                 ((SPADCALL |op|
                                                   (QREFELT $ 12)
                                                   (QREFELT $ 63))
                                                  (EXIT
                                                   (|TEX;formatBinary|
                                                    |op| |args| |prec|
                                                    $))))))
                                            (EXIT
                                             (COND
                                               ((SPADCALL |op|
                                                 (QREFELT $ 16)
                                                 (QREFELT $ 63))
                                                (|TEX;formatNaryNoGroup|
                                                 |op| |args| |prec| $))
                                               ((SPADCALL |op|
                                                 (QREFELT $ 14)
                                                 (QREFELT $ 63))
                                                (|TEX;formatNary| |op|
                                                 |args| |prec| $))
                                               ('T
                                                (SEQ
                                                 (LETT |op|
                                                  (|TEX;formatTex|
                                                   (|SPADfirst| |l|)
                                                   (QREFELT $ 9) $) . #0#)
                                                 (EXIT
                                                  (|TEX;formatFunction|
                                                   |op| |args| |prec|
                                                   $)))))))))))))))))))))) 

(DEFUN |TexFormat| ()
  (PROG ()
    (RETURN
      (PROG (#0=#:G2014)
        (RETURN
          (COND
            ((LETT #0# (HGET |$ConstructorCache| '|TexFormat|)
                   . #1=(|TexFormat|))
             (|CDRwithIncrement| (CDAR #0#)))
            ('T
             (UNWIND-PROTECT
               (PROG1 (CDDAR (HPUT |$ConstructorCache| '|TexFormat|
                                   (LIST
                                    (CONS NIL (CONS 1 (|TexFormat;|))))))
                 (LETT #0# T . #1#))
               (COND
                 ((NOT #0#) (HREM |$ConstructorCache| '|TexFormat|))))))))))) 

(DEFUN |TexFormat;| ()
  (PROG (|dv$| $ |pv$|)
    (RETURN
      (PROGN
        (LETT |dv$| '(|TexFormat|) . #0=(|TexFormat|))
        (LETT $ (GETREFV 65) . #0#)
        (QSETREFV $ 0 |dv$|)
        (QSETREFV $ 3 (LETT |pv$| (|buildPredVector| 0 0 NIL) . #0#))
        (|haddProp| |$ConstructorCache| '|TexFormat| NIL (CONS 1 $))
        (|stuffDomainSlots| $)
        (QSETREFV $ 6
            (|Record| (|:| |prolog| (|List| (|String|)))
                (|:| |TeX| (|List| (|String|)))
                (|:| |epilog| (|List| (|String|)))))
        (QSETREFV $ 7 " \\  ")
        (QSETREFV $ 8 1000000)
        (QSETREFV $ 9 0)
        (QSETREFV $ 10 (LIST "-"))
        (QSETREFV $ 11 '(700))
        (QSETREFV $ 12 (LIST "+->" "|" "**" "/" "<" ">" "=" "OVER"))
        (QSETREFV $ 13 (LIST 0 0 900 700 400 400 400 700))
        (QSETREFV $ 14
            (LIST "-" "+" "*" (QREFELT $ 7) "," ";" " " "ROW" ""
                  " \\cr " "&" " \\\\ "))
        (QSETREFV $ 15 (LIST 700 700 800 800 110 110 0 0 0 0 0 0))
        (QSETREFV $ 16 (LIST "ROW" "&"))
        (QSETREFV $ 17
            (LIST "SIGMA" "SIGMA2" "PI" "PI2" "INTSIGN"
                  "INDEFINTEGRAL"))
        (QSETREFV $ 18 '(700 800 700 800 700 700))
        (QSETREFV $ 19
            (LIST "MATRIX" "BRACKET" "BRACE" "CONCATB" "VCONCAT"
                  "AGGLST" "CONCAT" "OVERBAR" "ROOT" "SUB" "TAG"
                  "SUPERSUB" "ZAG" "AGGSET" "SC" "PAREN" "SEGMENT"
                  "QUOTE" "theMap"))
        (QSETREFV $ 20
                  (LIST "cos" "cot" "csc" "log" "sec" "sin" "tan"
                        "cosh" "coth" "csch" "sech" "sinh" "tanh"
                        "acos" "asin" "atan" "erf" "..." "$" "infinity"
                        "Gamma"))
        (QSETREFV $ 21
            (LIST "\\cos" "\\cot" "\\csc" "\\log" "\\sec" "\\sin"
                  "\\tan" "\\cosh" "\\coth" "\\csch" "\\sech" "\\sinh"
                  "\\tanh" "\\arccos" "\\arcsin" "\\arctan" "\\erf"
                  "\\ldots" "\\$" "\\infty" "\\Gamma"))
        $)))) 

(MAKEPROP '|TexFormat| '|infovec|
    (LIST '#(NIL NIL NIL NIL NIL NIL '|Rep| '|blank| '|maxPrec|
             '|minPrec| '|unaryOps| '|unaryPrecs| '|binaryOps|
             '|binaryPrecs| '|naryOps| '|naryPrecs| '|naryNGOps|
             '|plexOps| '|plexPrecs| '|specialOps| '|specialStrings|
             '|specialStringsInTeX| |TEX;new;$;1| (|OutputForm|)
             |TEX;coerce;Of$;3| (|Integer|) |TEX;convert;OfI$;4|
             (|Void|) (0 . |void|) |TEX;display;$IV;5|
             |TEX;display;$V;6| (|List| 40) |TEX;prologue;$L;7|
             |TEX;tex;$L;8| |TEX;epilogue;$L;9|
             |TEX;setPrologue!;$2L;10| |TEX;setTex!;$2L;11|
             |TEX;setEpilogue!;$2L;12| (4 . |coerce|)
             |TEX;coerce;$Of;13| (|String|) (|Character|) (9 . |char|)
             (14 . |elt|) (|Boolean|) (20 . =) (|UniversalSegment| 25)
             (26 . |segment|) (32 . |elt|) (38 . |setelt|) (|List| $)
             (45 . |split|) (51 . |empty?|) (56 . |concat|) (|List| 23)
             (61 . |second|) (66 . |position|) (|List| 25) (72 . |elt|)
             (78 . |segment|) (83 . |digit?|) (88 . |elt|)
             (94 . |position|) (100 . |member?|) (|SingleInteger|))
          '#(~= 106 |tex| 112 |setTex!| 117 |setPrologue!| 123
             |setEpilogue!| 129 |prologue| 135 |new| 140 |latex| 144
             |hash| 149 |epilogue| 154 |display| 159 |convert| 170
             |coerce| 183 = 193)
          'NIL
          (CONS (|makeByteWordVec2| 1 '(0 0 0))
                (CONS '#(|SetCategory&| |BasicType&| NIL)
                      (CONS '#((|SetCategory|) (|BasicType|)
                               (|CoercibleTo| 23))
                            (|makeByteWordVec2| 64
                                '(0 27 0 28 1 31 23 0 38 1 41 0 40 42 2
                                  40 41 0 25 43 2 41 44 0 0 45 2 46 0
                                  25 25 47 2 40 0 0 46 48 3 40 41 0 25
                                  41 49 2 40 50 0 41 51 1 40 44 0 52 1
                                  40 0 50 53 1 54 23 0 55 2 31 25 40 0
                                  56 2 57 25 0 25 58 1 46 0 25 59 1 41
                                  44 0 60 2 31 40 0 25 61 2 40 25 41 0
                                  62 2 31 44 40 0 63 2 0 44 0 0 1 1 0
                                  31 0 33 2 0 31 0 31 36 2 0 31 0 31 35
                                  2 0 31 0 31 37 1 0 31 0 32 0 0 0 22 1
                                  0 40 0 1 1 0 64 0 1 1 0 31 0 34 1 0
                                  27 0 30 2 0 27 0 25 29 3 0 0 23 25 23
                                  1 2 0 0 23 25 26 1 0 0 23 24 1 0 23 0
                                  39 2 0 44 0 0 1)))))
          '|lookupComplete|)) 

(MAKEPROP '|TexFormat| 'NILADIC T) 
