tighten Scribble Latex output to avoid unnecessary newlines
svn: r14470 original commit: 9f2e546f017d0535df1333e5cb3be47aa034ffef
This commit is contained in:
parent
37fd1a723a
commit
adf5092219
|
@ -31,8 +31,7 @@
|
|||
|
||||
(define/override (get-suffix) #".tex")
|
||||
|
||||
(inherit render-flow
|
||||
render-block
|
||||
(inherit render-block
|
||||
render-content
|
||||
install-file
|
||||
format-number
|
||||
|
@ -68,7 +67,7 @@
|
|||
(render-content (part-title-content d) d ri)
|
||||
(printf "}{~a}\n" vers)))
|
||||
(render-part d ri)
|
||||
(printf "\\postDoc\n\\end{document}\n")))
|
||||
(printf "\n\n\\postDoc\n\\end{document}\n")))
|
||||
|
||||
(define/override (render-part d ri)
|
||||
(let ([number (collected-info-number (part-collected-info d ri))])
|
||||
|
@ -97,7 +96,7 @@
|
|||
(printf "}")
|
||||
(when (part-style? d 'index) (printf "\n\n")))
|
||||
(for ([t (part-tags d)])
|
||||
(printf "\\label{t:~a}" (t-encode (tag-key t ri))))
|
||||
(printf "\\label{t:~a}\n\n" (t-encode (tag-key t ri))))
|
||||
(render-flow (part-flow d) d ri #f)
|
||||
(for ([sec (part-parts d)]) (render-part sec ri))
|
||||
(when (part-style? d 'index) (printf "\\onecolumn\n\n"))
|
||||
|
@ -121,14 +120,12 @@
|
|||
s)))])
|
||||
(unless (and (not author?)
|
||||
(equal? style "author"))
|
||||
(printf "\n\n")
|
||||
(when (string? style)
|
||||
(printf "\\~a{" style))
|
||||
(if (toc-paragraph? p)
|
||||
(printf "\\newpage \\tableofcontents \\newpage")
|
||||
(super render-paragraph p part ri))
|
||||
(when (string? style) (printf "}"))
|
||||
(printf "\n\n")))
|
||||
(when (string? style) (printf "}"))))
|
||||
null)
|
||||
|
||||
(define/override (render-element e part ri)
|
||||
|
@ -233,6 +230,16 @@
|
|||
[else (format "x~x" (char->integer c))]))
|
||||
(string->list (format "~s" s)))))
|
||||
|
||||
(define/override (render-flow p part ri start-inline?)
|
||||
(if (null? (flow-paragraphs p))
|
||||
null
|
||||
(begin
|
||||
(render-block (car (flow-paragraphs p)) part ri start-inline?)
|
||||
(for ([b (in-list (cdr (flow-paragraphs p)))])
|
||||
(printf "\n\n")
|
||||
(render-block b part ri #f))
|
||||
null)))
|
||||
|
||||
(define/override (render-table t part ri inline-table?)
|
||||
(let* ([boxed? (eq? 'boxed (table-style t))]
|
||||
[index? (eq? 'index (table-style t))]
|
||||
|
@ -271,7 +278,7 @@
|
|||
[index? (printf "\\begin{list}{}{\\parsep=0pt \\itemsep=1pt \\leftmargin=2ex \\itemindent=-2ex}\n")]
|
||||
[inline? (void)]
|
||||
[else
|
||||
(printf "\n\n~a\\begin{~a}~a{@{}~a}\n~a"
|
||||
(printf "~a\\begin{~a}~a{@{}~a}\n~a"
|
||||
(if (string? (table-style t))
|
||||
(format "\\begin{~a}" (table-style t))
|
||||
"")
|
||||
|
@ -329,8 +336,7 @@
|
|||
(unless (null? (cdr flowss))
|
||||
(loop (cdr flowss) (cdr row-styles)))))
|
||||
(unless inline?
|
||||
(printf "~a\n\n\\end{~a}~a\n"
|
||||
""
|
||||
(printf "\\end{~a}~a"
|
||||
tableform
|
||||
(if (string? (table-style t))
|
||||
(format "\\end{~a}" (table-style t))
|
||||
|
@ -372,7 +378,7 @@
|
|||
(printf " ~ \\\\\n"))
|
||||
(loop (cdr ps))))]))
|
||||
(when in-table?
|
||||
(printf "\n\\end{tabular}\n"))
|
||||
(printf "\n\\end{tabular}"))
|
||||
null))
|
||||
|
||||
(define/override (render-itemization t part ri)
|
||||
|
@ -384,7 +390,7 @@
|
|||
(eq? (styled-itemization-style t) 'ordered))
|
||||
"enumerate"
|
||||
"itemize"))])
|
||||
(printf "\n\n\\begin{~a}\n" mode)
|
||||
(printf "\\begin{~a}" mode)
|
||||
(for ([flow (itemization-flows t)])
|
||||
(printf "\n\n\\~a" (if style-str
|
||||
(format "~aItem{" style-str)
|
||||
|
@ -392,15 +398,15 @@
|
|||
(render-flow flow part ri #t)
|
||||
(when style-str
|
||||
(printf "}")))
|
||||
(printf "\n\n\\end{~a}\n" mode)
|
||||
(printf "\\end{~a}" mode)
|
||||
null))
|
||||
|
||||
(define/override (render-blockquote t part ri)
|
||||
(let ([kind (or (blockquote-style t) "quote")])
|
||||
(printf "\n\n\\begin{~a}\n" kind)
|
||||
(printf "\\begin{~a}" kind)
|
||||
(parameterize ([current-table-mode (list "blockquote" t)])
|
||||
(for ([e (blockquote-paragraphs t)]) (render-block e part ri #f)))
|
||||
(printf "\n\n\\end{~a}\n" kind)
|
||||
(render-flow (make-flow (blockquote-paragraphs t)) part ri #f))
|
||||
(printf "\\end{~a}" kind)
|
||||
null))
|
||||
|
||||
(define/override (render-other i part ri)
|
||||
|
|
|
@ -74,7 +74,7 @@
|
|||
\newenvironment{leftindent}{\begin{quote}}{\end{quote}}
|
||||
\newenvironment{insetpara}{\begin{quote}}{\end{quote}}
|
||||
|
||||
\newenvironment{bibentry}[1]{\parbox[t]{0.8\linewidth}{#1}}
|
||||
\newcommand{\bibentry}[1]{\parbox[t]{0.8\linewidth}{#1}}
|
||||
|
||||
\newenvironment{bigtabular}{\begin{longtable}}{\end{longtable}\vspace{-3ex}}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user