Changeset 8759 in project


Ignore:
Timestamp:
02/24/08 13:57:19 (12 years ago)
Author:
Ivan Raikov
Message:

Added Debian files to release 3 branch.

Location:
release/3/stream-wiki/trunk
Files:
4 added
1 edited

Legend:

Unmodified
Added
Removed
  • release/3/stream-wiki/trunk/stream-wiki.scm

    r8354 r8759  
    636636              (format #f "\\end{~A}\n" name)))
    637637
    638 (define (latex-driver class links-base)
     638(define (latex-driver class links-base . rest)
     639  (let-optionals rest ((include-in-toc (list 0 1 2 3 4))
     640                       (newpage-after-section (list))
     641                       )
    639642  (make-driver
    640643    'latex
     
    651654              ((<= real-depth 3)
    652655               (stream-append
     656                 (if (member real-depth newpage-after-section) (string->stream "\\newpage\n") stream-null)
    653657                 (stream #\\ )
    654658                 (stream-concatenate (make-stream (- real-depth 1) (string->stream "sub")))
    655                  (string->stream "section{")))
     659                 (if (member real-depth include-in-toc) (string->stream "section{") (string->stream "section*{"))
     660                 ))
    656661              (else
    657662                (string->stream "\\noindent \\textbf{"))))
     
    724729          ((#\<) "<")
    725730          ((#\>) ">")
     731          ((#\[) "\\[")
     732          ((#\]) "\\]")
    726733          ((copyright) "(C)")
    727734          ((reg) "(R)")
     
    744751    ; anchor
    745752    ; TODO: I think LaTeX does support anchor, we should get them to work.
    746     (constantly stream-null)))
     753    (constantly stream-null))))
    747754
    748755;;; Parsing
     
    952959(define (special-char? x)
    953960  (case x
    954     ((or #\# #\$ #\< #\> #\& #\_ #\\ #\" #\{ #\} #\@) #t)
     961    ((or #\# #\$ #\< #\> #\& #\_ #\\ #\" #\{ #\} #\@ #\[ #\] ) #t)
    955962    (else #f)))
    956963
     
    958965  (and (not (special-char? x))
    959966       (case x
    960          ((#\newline #\' #\[ #\] #\: #\| #\( #\space #\, #\. #\- #\=) #f)
     967         ((#\newline #\' #\: #\| #\( #\space #\, #\. #\- #\=) #f)
    961968         (else #t))))
    962969
     
    13241331(define (wiki->latex str . rest)
    13251332  (stream-delay
    1326     (let-optionals rest ((tail stream-null) (name "") (open (constantly stream-null)) (include (lambda (name tail) tail)) (linktypes (make-hash-table)) (extensions (make-hash-table)) (class *latex-default-document-class*) (links-base identity) (extension-args #f))
    1327       (wiki-parse (latex-driver class links-base) str tail name open include linktypes extensions extension-args))))
     1333    (let-optionals rest ((tail stream-null) (name "") (open (constantly stream-null)) (include (lambda (name tail) tail)) (linktypes (make-hash-table)) (extensions (make-hash-table)) (class *latex-default-document-class*) (links-base identity) (extension-args #f) (include-in-toc (list 0 1 2 3 4)) (newpage-after-section (list)))
     1334      (wiki-parse (latex-driver class links-base include-in-toc newpage-after-section )
     1335                  str tail name open include linktypes extensions extension-args))))
    13281336
    13291337(define (wiki-parse output str . rest)
Note: See TracChangeset for help on using the changeset viewer.