~ubuntu-branches/debian/sid/r5rs-doc/sid

« back to all changes in this revision

Viewing changes to rrrs2txi.scm

  • Committer: Bazaar Package Importer
  • Author(s): Chris Hanson
  • Date: 2002-03-24 09:00:15 UTC
  • Revision ID: james.westby@ubuntu.com-20020324090015-0honsponvqdxu1bs
Tags: 20010328-5
Add build-depends on tetex-extra to get pdflatex files.
(closes: Bug#139650)

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
;material, there shall be no use of my name in any advertising,
18
18
;promotional, or sales literature without prior written consent in
19
19
;each case.
 
20
 
 
21
;;                           -=-=-=-=-=-
 
22
 
 
23
;; Modifications:
 
24
;;
 
25
;; 2001-11-26 cph@debian.org:
 
26
;; Make sure that @var, @t, and @r aren't used in @def commands.
 
27
;; Make sure that "Top" node is properly capitalized.
 
28
;;
 
29
;; 2001-04-17 cph@debian.org:
 
30
;; Remove code that generates Info files; we will handle that in the
 
31
;; debian/rules file.  Change Info directory information to be in
 
32
;; accord with that used by MIT Scheme.
 
33
 
20
34
;;                           -=-=-=-=-=-
21
35
 
22
36
;; This program translates the LaTeX source ".tex" files of the
36
50
;; current directory to texinfo format.  The resulting ".txi" files
37
51
;; are written to the current directory.
38
52
 
39
 
;; If a Scheme report is successfully converted, GO also tries to
40
 
;; compile the new ".txi" file to INFO format.  The resulting info
41
 
;; files are placed in the directory named by the variable
42
 
;; *INFO-VICINITY*, defined here.
43
 
(define *info-vicinity* (make-vicinity "/usr/local/info/"))
44
 
;; Change *INFO-VICINITY*'s value to suit your platform.
45
 
 
46
53
(require 'common-list-functions)
47
54
(require 'string-search)
48
55
(require 'string-port)
269
276
           (and (equal? *previous-labels* *new-labels*)
270
277
                (equal? *previous-nodes* *new-nodes*))))))
271
278
 
272
 
;;;; Use `system' to convert to info format
273
 
(define (txi->info vic base . info-vic)
274
 
  (newline)
275
 
  (set! info-vic (if (null? info-vic) *info-vicinity* (car info-vic)))
276
 
  (and (provided? 'system)
277
 
       (zero? (system (sprintf #f "makeinfo %s%s.txi -o %s%s.info"
278
 
                               vic base info-vic base)))
279
 
       (zero? (system (sprintf #f "install-info %s%s.info %sdir"
280
 
                               info-vic base info-vic)))))
281
 
 
282
279
;;;; Rules
283
280
 
284
281
(define rules append)
772
769
  (set! *name* (if vet-node-name (vet-node-name cmd name) name))
773
770
  (fprintf (current-error-port) " %s \"%s\"\\n" cmd *name*)
774
771
  (if vet-node-name
775
 
      (let ((nod (assoc *name* *previous-nodes*)))
 
772
      (let ((nod (assoc *name* *previous-nodes*))
 
773
            (map-top
 
774
             (lambda (name)
 
775
               (if (string=? "top" name)
 
776
                   "Top"
 
777
                   name))))
776
778
        (cond ((not nod)
777
779
               (fprintf *txi-output-port* "@%s %s\\n" cmd name))
778
780
              (else
779
781
               (fprintf *txi-output-port* "@node %s, %s, %s, %s\\n"
780
 
                        *name*
781
 
                        (or (caddr nod) " ") (or (cadddr nod) " ")
782
 
                        (list-ref nod 4))
 
782
                        (map-top *name*)
 
783
                        (map-top (or (caddr nod) " "))
 
784
                        (map-top (or (cadddr nod) " "))
 
785
                        (map-top (list-ref nod 4)))
783
786
               (fprintf *txi-output-port* "@%s %s\\n" cmd name)
784
787
               (cond ((and (not (eqv? 'top cmd)) (not (null? (list-ref nod 5))))
785
788
                      (emit-menu! nod))))))
1324
1327
                              "@syncodeindex vr cp"
1325
1328
                              "@end iftex" ""
1326
1329
                              "@ifinfo"
1327
 
                              "@dircategory The Algorithmic Language Scheme"
 
1330
                              "@dircategory Programming Languages"
1328
1331
                              "@direntry")
1329
1332
           (fprintf *txi-output-port*
1330
 
                    "* %s: (%s).         The Revised(%c) Report on Scheme.\\n"
 
1333
                    "* %s: (%s).         The Revised(%c) Report on the Algorithmic Language Scheme.\\n"
1331
1334
                    (string-upcase *input-basename*)
1332
1335
                    *input-basename*
1333
1336
                    (string-ref *input-basename* 1))
1461
1464
             (case cmd ((proto) (define-label proc)))
1462
1465
             (set! *entry-type* "deffn"))
1463
1466
           #f)
 
1467
         (rule '(var vr) process-argument-with-rules)
1464
1468
         (rule '(vari vri) postfix "1")
1465
1469
         (rule '(varii vrii) postfix "2")
1466
1470
         (rule '(variii vriii) postfix "3")
1467
1471
         (rule 'vriv postfix "4")
 
1472
         (rule 'hyper process-argument-with-rules "<" ">")
1468
1473
         (rule 'hyperi process-argument-with-rules "<" "1>")
1469
1474
         (rule 'hyperii process-argument-with-rules "<" "2>")
1470
1475
         (rule 'hyperiii process-argument-with-rules "<" "3>")
1492
1497
               ;;(process-argument)
1493
1498
               #\newline
1494
1499
               )))
1495
 
         (rule 'tt ""))
 
1500
         (rule 'tt "")
 
1501
         (rule 'singlequote "' " 1)
 
1502
         (rule 'backquote "` " 1)
 
1503
         (rule '(var vr) process-argument-with-rules)
 
1504
         (rule '(vari vri) postfix "1")
 
1505
         (rule '(varii vrii) postfix "2")
 
1506
         (rule '(variii vriii) postfix "3")
 
1507
         (rule 'vriv postfix "4")
 
1508
         (rule 'hyper process-argument-with-rules "<" ">")
 
1509
         (rule 'hyperi process-argument-with-rules "<" "1>")
 
1510
         (rule 'hyperii process-argument-with-rules "<" "2>")
 
1511
         (rule 'hyperiii process-argument-with-rules "<" "3>")
 
1512
         (rule 'hyperiv process-argument-with-rules "<" "4>")
 
1513
         (rule 'hypern process-argument-with-rules "<" "_n>"))
1496
1514
   (rule 'obeyspaces process-argument-with-rules
1497
1515
         (rule '(bs-bs #\newline #\%) "")
1498
1516
         collapse-spaces)
1569
1587
                             (set! found? #t)
1570
1588
                             (load me)
1571
1589
                             (cond ((tex->txi vic base)
1572
 
                                    (txi->info (user-vicinity) base))
 
1590
                                    #f)
1573
1591
                                   ((begin (load me) (tex->txi vic base))
1574
 
                                    (txi->info (user-vicinity) base))))))))
1575
 
                 ((begin (load me) (tex->txi name))
1576
 
                  (txi->info (user-vicinity) base))
1577
 
                 ((begin (load me) (tex->txi name))
1578
 
                  (txi->info (user-vicinity) base))))))))
 
1592
                                    #f)))))))
 
1593
                 ((begin (load me) (tex->txi name))
 
1594
                  #f)
 
1595
                 ((begin (load me) (tex->txi name))
 
1596
                  #f)))))))