
(/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;formatExpr| (|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;formatExpr| (|TEX;precondition| |expr| $)
                       (QREFELT $ 9) $)
                      $)))
          (EXIT |f|))))) 

(PUT '|TEX;sayExpr| '|SPADreplace| '|sayTeX|) 

(DEFUN |TEX;sayExpr| (|s| $) (|sayTeX| |s|)) 

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

(DEFUN |TEX;postcondition| (|str| $)
  (PROG (#1=#:G1924 |i| |minus| |plus| |len|)
    (RETURN
     (SEQ (LETT |str| (|TEX;ungroup| |str| $) . #2=(|TEX;postcondition|))
          (LETT |len| (QCSIZE |str|) . #2#)
          (LETT |plus| (SPADCALL "+" (QREFELT $ 42)) . #2#)
          (LETT |minus| (SPADCALL "-" (QREFELT $ 42)) . #2#)
          (EXIT
           (COND ((< |len| 4) |str|)
                 ('T
                  (SEQ
                   (SEQ (LETT |i| 1 . #2#) (LETT #1# (- |len| 1) . #2#) G190
                        (COND ((QSGREATERP |i| #1#) (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|) . #2#) (GO G190) G191
                        (EXIT NIL))
                   (EXIT |str|))))))))) 

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

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

(DEFUN |TEX;lineConcat| (|line| |lines| $)
  (PROG (|length|)
    (RETURN
     (SEQ (LETT |length| (QCSIZE |line|) . #1=(|TEX;lineConcat|))
          (COND
           ((< 0 |length|)
            (SEQ
             (COND
              ((SPADCALL (SPADCALL |line| |length| (QREFELT $ 43))
                         (SPADCALL "\\" (QREFELT $ 42)) (QREFELT $ 45))
               (LETT |line| (STRCONC |line| " ") . #1#)))
             (COND
              ((SPADCALL (SPADCALL |line| 1 (QREFELT $ 43))
                         (SPADCALL "%" (QREFELT $ 42)) (QREFELT $ 45))
               (LETT |line| (STRCONC " \\" |line|) . #1#))
              ((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|) . #1#)))))))
             (EXIT (LETT |lines| (CONS |line| |lines|) . #1#)))))
          (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 (|l| |s| |ls| |ownLine| |u| |lss| #1=#:G1954 |ss|)
    (RETURN
     (SEQ (LETT |l| NIL . #2=(|TEX;splitLong1|)) (LETT |s| "" . #2#)
          (LETT |ls| 0 . #2#)
          (SEQ (LETT |ss| NIL . #2#)
               (LETT #1#
                     (SPADCALL |str| (SPADCALL " " (QREFELT $ 42))
                               (QREFELT $ 51))
                     . #2#)
               G190
               (COND
                ((OR (ATOM #1#) (PROGN (LETT |ss| (CAR #1#) . #2#) NIL))
                 (GO G191)))
               (SEQ
                (EXIT
                 (COND
                  ((EQUAL |ss| "\\\\")
                   (SEQ
                    (LETT |l| (|TEX;lineConcat| (STRCONC |s| |ss|) |l| $)
                          . #2#)
                    (LETT |s| "" . #2#) (EXIT (LETT |ls| 0 . #2#))))
                  ('T
                   (SEQ (LETT |lss| (QCSIZE |ss|) . #2#)
                        (LETT |ownLine|
                              (SEQ
                               (LETT |u| (SPADCALL 1 4 (QREFELT $ 47)) . #2#)
                               (COND
                                ((< 3 |lss|)
                                 (COND
                                  ((EQUAL "\\end"
                                          (SPADCALL |ss| |u| (QREFELT $ 48)))
                                   (EXIT 'T)))))
                               (LETT |u| (SPADCALL 1 5 (QREFELT $ 47)) . #2#)
                               (COND
                                ((< 4 |lss|)
                                 (COND
                                  ((EQUAL "\\left"
                                          (SPADCALL |ss| |u| (QREFELT $ 48)))
                                   (EXIT 'T)))))
                               (LETT |u| (SPADCALL 1 6 (QREFELT $ 47)) . #2#)
                               (COND
                                ((< 5 |lss|)
                                 (COND
                                  ((OR
                                    (EQUAL "\\right"
                                           (SPADCALL |ss| |u| (QREFELT $ 48)))
                                    (EQUAL "\\begin"
                                           (SPADCALL |ss| |u| (QREFELT $ 48))))
                                   (EXIT 'T)))))
                               (EXIT 'NIL))
                              . #2#)
                        (COND
                         ((OR |ownLine| (< |len| (+ |ls| |lss|)))
                          (SEQ
                           (COND
                            ((NULL (SPADCALL |s| (QREFELT $ 52)))
                             (LETT |l| (|TEX;lineConcat| |s| |l| $) . #2#)))
                           (LETT |s| "" . #2#) (EXIT (LETT |ls| 0 . #2#)))))
                        (COND
                         ((OR |ownLine| (< |len| |lss|))
                          (EXIT
                           (LETT |l| (|TEX;lineConcat| |ss| |l| $) . #2#))))
                        (COND
                         ((EQL |lss| 1)
                          (COND
                           ((SPADCALL (SPADCALL |ss| 1 (QREFELT $ 43))
                                      (SPADCALL "\\" (QREFELT $ 42))
                                      (QREFELT $ 45))
                            (EXIT
                             (SEQ (LETT |ls| (+ (+ |ls| |lss|) 2) . #2#)
                                  (EXIT
                                   (LETT |s| (STRCONC |s| (STRCONC |ss| "  "))
                                         . #2#))))))))
                        (LETT |ls| (+ (+ |ls| |lss|) 1) . #2#)
                        (EXIT
                         (LETT |s| (STRCONC |s| (STRCONC |ss| " "))
                               . #2#)))))))
               (LETT #1# (CDR #1#) . #2#) (GO G190) G191 (EXIT NIL))
          (COND ((< 0 |ls|) (LETT |l| (|TEX;lineConcat| |s| |l| $) . #2#)))
          (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 (|tmp| |prescript| |form| #1=#:G2004 |u| #2=#:G2003)
    (RETURN
     (SEQ (LETT |prescript| 'NIL . #3=(|TEX;formatSpecial|))
          (EXIT
           (COND ((EQUAL |op| '|theMap|) "\\mbox{theMap(...)}")
                 ((EQUAL |op| 'AGGLST)
                  (|TEX;formatNary| '|,| "" 0 |args| |prec| $))
                 ((EQUAL |op| 'AGGSET)
                  (|TEX;formatNary| '|;| "" 0 |args| |prec| $))
                 ((EQUAL |op| 'TAG)
                  (|TEX;group|
                   (SPADCALL
                    (LIST (|TEX;formatExpr| (|SPADfirst| |args|) |prec| $)
                          "\\rightarrow"
                          (|TEX;formatExpr| (SPADCALL |args| (QREFELT $ 55))
                           |prec| $))
                    (QREFELT $ 53))
                   $))
                 ((EQUAL |op| 'SLASH)
                  (|TEX;group|
                   (SPADCALL
                    (LIST (|TEX;formatExpr| (|SPADfirst| |args|) |prec| $) "/"
                          (|TEX;formatExpr| (SPADCALL |args| (QREFELT $ 55))
                           |prec| $))
                    (QREFELT $ 53))
                   $))
                 ((EQUAL |op| 'VCONCAT)
                  (|TEX;group|
                   (STRCONC "\\begin{array}{c}"
                            (STRCONC
                             (SPADCALL
                              (PROGN
                               (LETT #2# NIL . #3#)
                               (SEQ (LETT |u| NIL . #3#)
                                    (LETT #1# |args| . #3#) G190
                                    (COND
                                     ((OR (ATOM #1#)
                                          (PROGN
                                           (LETT |u| (CAR #1#) . #3#)
                                           NIL))
                                      (GO G191)))
                                    (SEQ
                                     (EXIT
                                      (LETT #2#
                                            (CONS
                                             (STRCONC
                                              (|TEX;formatExpr| |u|
                                               (QREFELT $ 9) $)
                                              "\\\\")
                                             #2#)
                                            . #3#)))
                                    (LETT #1# (CDR #1#) . #3#) (GO G190) G191
                                    (EXIT (NREVERSE0 #2#))))
                              (QREFELT $ 53))
                             "\\end{array}"))
                   $))
                 ((EQUAL |op| 'CONCATB)
                  (|TEX;formatNary| 'STRSEP " \\ " 0 |args| |prec| $))
                 ((EQUAL |op| 'CONCAT)
                  (|TEX;formatNary| 'STRSEP "" 0 |args| (QREFELT $ 9) $))
                 ((EQUAL |op| 'QUOTE)
                  (|TEX;group|
                   (STRCONC "{\\tt '}"
                            (|TEX;formatExpr| (|SPADfirst| |args|)
                             (QREFELT $ 9) $))
                   $))
                 ((EQUAL |op| 'BRACKET)
                  (|TEX;group|
                   (|TEX;addBrackets|
                    (|TEX;ungroup|
                     (|TEX;formatExpr| (|SPADfirst| |args|) (QREFELT $ 9) $) $)
                    $)
                   $))
                 ((EQUAL |op| 'BRACE)
                  (|TEX;group|
                   (|TEX;addBraces|
                    (|TEX;ungroup|
                     (|TEX;formatExpr| (|SPADfirst| |args|) (QREFELT $ 9) $) $)
                    $)
                   $))
                 ((EQUAL |op| 'PAREN)
                  (|TEX;group|
                   (|TEX;parenthesize|
                    (|TEX;ungroup|
                     (|TEX;formatExpr| (|SPADfirst| |args|) (QREFELT $ 9) $) $)
                    $)
                   $))
                 ((EQUAL |op| 'PRIME)
                  (|TEX;formatSpecial| 'SUPERSUB
                   (LIST (|SPADfirst| |args|) " "
                         (SPADCALL |args| (QREFELT $ 55)))
                   |prec| $))
                 ((EQUAL |op| 'OVERBAR)
                  (COND ((NULL |args|) "")
                        (#4='T
                         (|TEX;group|
                          (SPADCALL
                           (LIST "\\overline "
                                 (|TEX;formatExpr| (|SPADfirst| |args|)
                                  (QREFELT $ 9) $))
                           (QREFELT $ 53))
                          $))))
                 ((EQUAL |op| 'ROOT)
                  (COND ((NULL |args|) "")
                        (#4#
                         (SEQ
                          (LETT |tmp|
                                (|TEX;group|
                                 (|TEX;formatExpr| (|SPADfirst| |args|)
                                  (QREFELT $ 9) $)
                                 $)
                                . #3#)
                          (EXIT
                           (COND
                            ((NULL (CDR |args|))
                             (|TEX;group|
                              (SPADCALL (LIST "\\sqrt " |tmp|) (QREFELT $ 53))
                              $))
                            (#4#
                             (|TEX;group|
                              (SPADCALL
                               (LIST "\\root "
                                     (|TEX;group|
                                      (|TEX;formatExpr|
                                       (|SPADfirst| (CDR |args|)) (QREFELT $ 9)
                                       $)
                                      $)
                                     " \\of " |tmp|)
                               (QREFELT $ 53))
                              $))))))))
                 ((EQUAL |op| 'SEGMENT)
                  (SEQ
                   (LETT |tmp|
                         (SPADCALL
                          (LIST
                           (|TEX;formatExpr| (|SPADfirst| |args|) (QREFELT $ 9)
                            $)
                           "..")
                          (QREFELT $ 53))
                         . #3#)
                   (EXIT
                    (|TEX;group|
                     (COND ((NULL (CDR |args|)) |tmp|)
                           (#4#
                            (SPADCALL
                             (LIST |tmp|
                                   (|TEX;formatExpr| (|SPADfirst| (CDR |args|))
                                    (QREFELT $ 9) $))
                             (QREFELT $ 53))))
                     $))))
                 ((EQUAL |op| 'SUB)
                  (|TEX;group|
                   (SPADCALL
                    (LIST
                     (|TEX;formatExpr| (|SPADfirst| |args|) (QREFELT $ 9) $)
                     " \\sb "
                     (|TEX;formatSpecial| 'AGGLST (CDR |args|) (QREFELT $ 9)
                      $))
                    (QREFELT $ 53))
                   $))
                 ((EQUAL |op| 'SUPERSUB)
                  (SEQ
                   (LETT |form|
                         (LIST
                          (|TEX;formatExpr| (|SPADfirst| |args|) (QREFELT $ 9)
                           $))
                         . #3#)
                   (LETT |args| (CDR |args|) . #3#)
                   (EXIT
                    (COND ((NULL |args|) (SPADCALL |form| (QREFELT $ 53)))
                          (#4#
                           (SEQ
                            (LETT |tmp|
                                  (|TEX;formatExpr| (|SPADfirst| |args|)
                                   (QREFELT $ 9) $)
                                  . #3#)
                            (COND
                             ((NULL (EQUAL |tmp| ""))
                              (COND
                               ((NULL (EQUAL |tmp| "{}"))
                                (COND
                                 ((NULL (EQUAL |tmp| " "))
                                  (LETT |form|
                                        (APPEND |form|
                                                (LIST " \\sb "
                                                      (|TEX;group| |tmp| $)))
                                        . #3#)))))))
                            (LETT |args| (CDR |args|) . #3#)
                            (EXIT
                             (COND
                              ((NULL |args|)
                               (|TEX;group| (SPADCALL |form| (QREFELT $ 53))
                                $))
                              (#4#
                               (SEQ
                                (LETT |tmp|
                                      (|TEX;formatExpr| (|SPADfirst| |args|)
                                       (QREFELT $ 9) $)
                                      . #3#)
                                (COND
                                 ((NULL (EQUAL |tmp| ""))
                                  (COND
                                   ((NULL (EQUAL |tmp| "{}"))
                                    (COND
                                     ((NULL (EQUAL |tmp| " "))
                                      (LETT |form|
                                            (APPEND |form|
                                                    (LIST " \\sp "
                                                          (|TEX;group| |tmp|
                                                           $)))
                                            . #3#)))))))
                                (LETT |args| (CDR |args|) . #3#)
                                (EXIT
                                 (COND
                                  ((NULL |args|)
                                   (|TEX;group|
                                    (SPADCALL |form| (QREFELT $ 53)) $))
                                  (#4#
                                   (SEQ
                                    (LETT |tmp|
                                          (|TEX;formatExpr|
                                           (|SPADfirst| |args|) (QREFELT $ 9)
                                           $)
                                          . #3#)
                                    (COND
                                     ((NULL (EQUAL |tmp| ""))
                                      (COND
                                       ((NULL (EQUAL |tmp| "{}"))
                                        (COND
                                         ((NULL (EQUAL |tmp| " "))
                                          (SEQ
                                           (LETT |form|
                                                 (APPEND
                                                  (LIST " \\sp "
                                                        (|TEX;group| |tmp| $))
                                                  |form|)
                                                 . #3#)
                                           (EXIT
                                            (LETT |prescript| 'T . #3#)))))))))
                                    (LETT |args| (CDR |args|) . #3#)
                                    (EXIT
                                     (COND
                                      ((NULL |args|)
                                       (|TEX;group|
                                        (SPADCALL
                                         (COND (|prescript| (CONS "{}" |form|))
                                               (#4# |form|))
                                         (QREFELT $ 53))
                                        $))
                                      (#4#
                                       (SEQ
                                        (LETT |tmp|
                                              (|TEX;formatExpr|
                                               (|SPADfirst| |args|)
                                               (QREFELT $ 9) $)
                                              . #3#)
                                        (COND
                                         ((NULL (EQUAL |tmp| ""))
                                          (COND
                                           ((NULL (EQUAL |tmp| "{}"))
                                            (COND
                                             ((NULL (EQUAL |tmp| " "))
                                              (SEQ
                                               (LETT |form|
                                                     (APPEND
                                                      (LIST " \\sb "
                                                            (|TEX;group| |tmp|
                                                             $))
                                                      |form|)
                                                     . #3#)
                                               (EXIT
                                                (LETT |prescript| 'T
                                                      . #3#)))))))))
                                        (EXIT
                                         (|TEX;group|
                                          (SPADCALL
                                           (COND
                                            (|prescript| (CONS "{}" |form|))
                                            (#4# |form|))
                                           (QREFELT $ 53))
                                          $))))))))))))))))))))
                 ((EQUAL |op| 'SC)
                  (COND ((NULL |args|) "")
                        (#4#
                         (SEQ
                          (LETT |tmp|
                                (|TEX;formatNaryNoGroup| 'STRSEP " \\\\ " 800
                                 |args| (QREFELT $ 9) $)
                                . #3#)
                          (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;formatExpr| (|SPADfirst| |args|) (QREFELT $ 9)
                          $)
                         "}{"
                         (|TEX;formatExpr| (|SPADfirst| (CDR |args|))
                          (QREFELT $ 9) $)
                         "}")
                   (QREFELT $ 53)))
                 (#4#
                  (SPADCALL
                   (LIST "not done yet for " (SPADCALL |op| (QREFELT $ 57)))
                   (QREFELT $ 53))))))))) 

(DEFUN |TEX;formatPlex| (|op| |args| |prec| $)
  (PROG (|s| |hold| |n| |opPrec| |p|)
    (RETURN
     (SEQ
      (LETT |p| (SPADCALL |op| (QREFELT $ 17) (QREFELT $ 59))
            . #1=(|TEX;formatPlex|))
      (EXIT
       (COND ((< |p| 1) (|error| "unknown plex op"))
             (#2='T
              (SEQ
               (LETT |opPrec| (SPADCALL (QREFELT $ 18) |p| (QREFELT $ 61))
                     . #1#)
               (LETT |n| (LENGTH |args|) . #1#)
               (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")
                      ('T "????"))
                     . #1#)
               (LETT |hold|
                     (|TEX;formatExpr| (|SPADfirst| |args|) (QREFELT $ 9) $)
                     . #1#)
               (LETT |args| (CDR |args|) . #1#)
               (COND
                ((EQUAL |op| 'INDEFINTEGRAL)
                 (SEQ
                  (LETT |hold|
                        (|TEX;group|
                         (SPADCALL
                          (LIST |hold| " "
                                (|TEX;formatExpr| (|SPADfirst| |args|)
                                 (QREFELT $ 9) $))
                          (QREFELT $ 53))
                         $)
                        . #1#)
                  (EXIT
                   (LETT |s| (SPADCALL (LIST |s| " " |hold|) (QREFELT $ 53))
                         . #1#))))
                (#2#
                 (SEQ
                  (COND
                   ((NULL (EQUAL |hold| ""))
                    (LETT |s|
                          (SPADCALL
                           (LIST |s| " \\sb"
                                 (|TEX;group|
                                  (SPADCALL (LIST "\\displaystyle " |hold|)
                                            (QREFELT $ 53))
                                  $))
                           (QREFELT $ 53))
                          . #1#)))
                  (COND
                   ((NULL (NULL (CDR |args|)))
                    (SEQ
                     (LETT |hold|
                           (|TEX;formatExpr| (|SPADfirst| |args|) (QREFELT $ 9)
                            $)
                           . #1#)
                     (COND
                      ((NULL (EQUAL |hold| ""))
                       (LETT |s|
                             (SPADCALL
                              (LIST |s| " \\sp"
                                    (|TEX;group|
                                     (SPADCALL (LIST "\\displaystyle " |hold|)
                                               (QREFELT $ 53))
                                     $))
                              (QREFELT $ 53))
                             . #1#)))
                     (EXIT (LETT |args| (CDR |args|) . #1#)))))
                  (EXIT
                   (LETT |s|
                         (SPADCALL
                          (LIST |s| " "
                                (|TEX;formatExpr| (|SPADfirst| |args|) |opPrec|
                                 $))
                          (QREFELT $ 53))
                         . #1#)))))
               (COND
                ((< |opPrec| |prec|)
                 (LETT |s| (|TEX;parenthesize| |s| $) . #1#)))
               (EXIT (|TEX;group| |s| $)))))))))) 

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

(DEFUN |TEX;formatFunction| (|op| |args| |prec| $)
  (PROG (|ops|)
    (RETURN
     (SEQ
      (LETT |ops| (|TEX;formatExpr| |op| (QREFELT $ 9) $) |TEX;formatFunction|)
      (EXIT
       (|TEX;group|
        (SPADCALL
         (LIST |ops| " "
               (|TEX;parenthesize|
                (|TEX;formatNary| '|,| "" 0 |args| (QREFELT $ 9) $) $))
         (QREFELT $ 53))
        $)))))) 

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

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

(DEFUN |TEX;formatBinary| (|op| |args| |prec| $)
  (PROG (|s| |ops| |s2| |s1| |opPrec| |p|)
    (RETURN
     (SEQ
      (LETT |p| (SPADCALL |op| (QREFELT $ 12) (QREFELT $ 59))
            . #1=(|TEX;formatBinary|))
      (EXIT
       (COND ((< |p| 1) (|error| "unknown binary op"))
             (#2='T
              (SEQ
               (LETT |opPrec| (SPADCALL (QREFELT $ 13) |p| (QREFELT $ 61))
                     . #1#)
               (LETT |s1| (|TEX;formatExpr| (|SPADfirst| |args|) |opPrec| $)
                     . #1#)
               (LETT |s2|
                     (|TEX;formatExpr| (|SPADfirst| (CDR |args|)) |opPrec| $)
                     . #1#)
               (LETT |ops|
                     (COND ((EQUAL |op| '|\||) " \\mid ")
                           ((EQUAL |op| '^) " \\sp ")
                           ((EQUAL |op| '/) " \\over ")
                           (#2#
                            (COND ((EQUAL |op| 'OVER) " \\over ")
                                  ((EQUAL |op| '+->) " \\mapsto ")
                                  ((EQUAL |op| '~=) " \\ne ")
                                  ((EQUAL |op| '<=) " \\leq ")
                                  ((EQUAL |op| '>=) " \\geq ")
                                  (#2#
                                   (COND ((EQUAL |op| 'LET) " := ")
                                         (#2#
                                          (SPADCALL |op| (QREFELT $ 57))))))))
                     . #1#)
               (LETT |s| (SPADCALL (LIST |s1| |ops| |s2|) (QREFELT $ 53))
                     . #1#)
               (EXIT
                (|TEX;group|
                 (COND
                  ((OR (OR (EQUAL |op| '/) (EQUAL |op| 'OVER))
                       (NULL (< |opPrec| |prec|)))
                   |s|)
                  ('T (|TEX;parenthesize| |s| $)))
                 $)))))))))) 

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

(DEFUN |TEX;formatNaryNoGroup| (|op| |sep| |opprec| |args| |prec| $)
  (PROG (|s| |l| #1=#:G2056 |a| |opPrec| |ops| |p|)
    (RETURN
     (SEQ
      (COND ((NULL |args|) "")
            (#2='T
             (SEQ
              (LETT |p| (SPADCALL |op| (QREFELT $ 14) (QREFELT $ 59))
                    . #3=(|TEX;formatNaryNoGroup|))
              (EXIT
               (COND ((< |p| 1) (|error| "unknown nary op"))
                     (#2#
                      (SEQ
                       (LETT |ops|
                             (COND ((EQUAL |op| 'STRSEP) |sep|)
                                   ((EQUAL |op| '|,|) ", \\: ")
                                   ((EQUAL |op| '|;|) "; \\: ")
                                   ((EQUAL |op| '*) (QREFELT $ 7))
                                   (#2#
                                    (COND ((EQUAL |op| '| |) " \\ ")
                                          ((EQUAL |op| 'ROW) " & ")
                                          ((EQUAL |op| 'TENSOR) " \\otimes ")
                                          (#2#
                                           (SPADCALL |op| (QREFELT $ 57))))))
                             . #3#)
                       (LETT |l| NIL . #3#)
                       (LETT |opPrec|
                             (COND ((EQUAL |op| 'STRSEP) |opprec|)
                                   (#2#
                                    (SPADCALL (QREFELT $ 15) |p|
                                              (QREFELT $ 61))))
                             . #3#)
                       (SEQ (LETT |a| NIL . #3#) (LETT #1# |args| . #3#) G190
                            (COND
                             ((OR (ATOM #1#)
                                  (PROGN (LETT |a| (CAR #1#) . #3#) NIL))
                              (GO G191)))
                            (SEQ
                             (EXIT
                              (LETT |l|
                                    (CONS |ops|
                                          (CONS
                                           (|TEX;formatExpr| |a| |opPrec| $)
                                           |l|))
                                    . #3#)))
                            (LETT #1# (CDR #1#) . #3#) (GO G190) G191
                            (EXIT NIL))
                       (LETT |s| (SPADCALL (REVERSE (CDR |l|)) (QREFELT $ 53))
                             . #3#)
                       (EXIT
                        (COND ((< |opPrec| |prec|) (|TEX;parenthesize| |s| $))
                              (#2# |s|)))))))))))))) 

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

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

(DEFUN |TexFormat;| ()
  (PROG (|dv$| $ |pv$|)
    (RETURN
     (PROGN
      (LETT |dv$| '(|TexFormat|) . #1=(|TexFormat|))
      (LETT $ (GETREFV 68) . #1#)
      (QSETREFV $ 0 |dv$|)
      (QSETREFV $ 3 (LETT |pv$| (|buildPredVector| 0 0 NIL) . #1#))
      (|haddProp| |$ConstructorCache| '|TexFormat| NIL (CONS 1 $))
      (|stuffDomainSlots| $)
      (SETF |pv$| (QREFELT $ 3))
      (QSETREFV $ 6
                (|Record| (|:| |prolog| (|List| (|String|)))
                          (|:| |TeX| (|List| (|String|)))
                          (|:| |epilog| (|List| (|String|)))))
      (QSETREFV $ 7 " \\  ")
      (QSETREFV $ 8 1000000)
      (QSETREFV $ 9 0)
      (QSETREFV $ 10 '(-))
      (QSETREFV $ 11 '(710))
      (QSETREFV $ 12 '(+-> |\|| ^ / = ~= < <= > >= OVER LET))
      (QSETREFV $ 13 (LIST 0 0 900 700 400 400 400 400 400 400 700 125))
      (QSETREFV $ 14 '(- + * |,| |;| ROW STRSEP TENSOR))
      (QSETREFV $ 15 (LIST 700 700 800 110 110 0 0 850))
      (QSETREFV $ 16 '(ROW))
      (QSETREFV $ 17 '(SIGMA SIGMA2 PI PI2 INTSIGN INDEFINTEGRAL))
      (QSETREFV $ 18 '(750 750 750 750 700 700))
      (QSETREFV $ 19
                '(MATRIX BRACKET BRACE CONCATB VCONCAT AGGLST CONCAT OVERBAR
                  ROOT SUB TAG SUPERSUB ZAG AGGSET SC PAREN SEGMENT QUOTE
                  |theMap| SLASH PRIME))
      (QSETREFV $ 20
                '(|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;6|
              |TEX;display;$V;7| (|List| 40) |TEX;prologue;$L;8| |TEX;tex;$L;9|
              |TEX;epilogue;$L;10| |TEX;setPrologue!;$2L;11|
              |TEX;setTex!;$2L;12| |TEX;setEpilogue!;$2L;13| (4 . |coerce|)
              |TEX;coerce;$Of;14| (|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|) (|Symbol|) (66 . |string|) (|List| 56)
              (71 . |position|) (|List| 25) (77 . |elt|) (83 . |segment|)
              (88 . |digit?|) (93 . |elt|) (99 . |position|) (105 . |member?|)
              (|SingleInteger|))
           '#(~= 111 |tex| 117 |setTex!| 122 |setPrologue!| 128 |setEpilogue!|
              134 |prologue| 140 |new| 145 |latex| 149 |hash| 154 |epilogue|
              159 |display| 164 |convert| 175 |coerce| 188 = 198)
           'NIL
           (CONS (|makeByteWordVec2| 1 '(0 0 0))
                 (CONS '#(|SetCategory&| |BasicType&| NIL)
                       (CONS
                        '#((|SetCategory|) (|BasicType|) (|CoercibleTo| 23))
                        (|makeByteWordVec2| 67
                                            '(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 1 56 40 0 57 2 58 25 56 0 59
                                              2 60 25 0 25 61 1 46 0 25 62 1 41
                                              44 0 63 2 31 40 0 25 64 2 40 25
                                              41 0 65 2 58 44 56 0 66 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
                                              67 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) 
