commit 8fa810e842e27c425dc69942f139816fe8b83a21
parent 34fd91425fcb550da3428d08250547ba2e555f7a
Author: Matthew Flatt <mflatt@racket-lang.org>
Date: Thu, 4 Jun 2009 03:20:39 +0000
Scrible latex output: fix (mostly) interaction of tables and itemization; DrScheme doc improvements
svn: r15072
original commit: e96941407c3348abb3af7e00561e17f38424cd5b
Diffstat:
3 files changed, 173 insertions(+), 28 deletions(-)
diff --git a/collects/scribble/latex-render.ss b/collects/scribble/latex-render.ss
@@ -252,10 +252,9 @@
[index? (eq? 'index (table-style t))]
[tableform
(cond [index? "list"]
- [(and (not (current-table-mode)) (not inline-table?))
- "bigtabular"]
+ [(not (current-table-mode)) "bigtabular"]
[else "tabular"])]
- [opt (cond [(equal? tableform "bigtabular") "[l]"]
+ [opt (cond [(equal? tableform "bigtabular") ""]
[(equal? tableform "tabular") "[t]"]
[else ""])]
[flowss (if index? (cddr (table-flowss t)) (table-flowss t))]
@@ -285,12 +284,18 @@
[index? (printf "\\begin{list}{}{\\parsep=0pt \\itemsep=1pt \\leftmargin=2ex \\itemindent=-2ex}\n")]
[inline? (void)]
[else
- (printf "~a\\begin{~a}~a{@{}~a}\n~a"
+ (printf "~a~a\\begin{~a}~a{@{~a}~a}\n~a"
+ (if (and inline-table? (equal? tableform "bigtabular"))
+ "\\bigtableinlinecorrect"
+ "")
(if (string? (table-style t))
(format "\\begin{~a}" (table-style t))
"")
tableform
opt
+ (if (equal? tableform "bigtabular")
+ "\\bigtableleftpad"
+ "")
(string-append*
(map (lambda (i align)
(format "~a@{}"
@@ -397,7 +402,7 @@
(eq? (styled-itemization-style t) 'ordered))
"enumerate"
"itemize"))])
- (printf "\\begin{~a}" mode)
+ (printf "\\begin{~a}\\atItemizeStart" mode)
(for ([flow (itemization-flows t)])
(printf "\n\n\\~a" (if style-str
(format "~aItem{" style-str)
@@ -469,24 +474,152 @@
[(#\# #\% #\& #\$) (format "\\~a" c)]
[(#\uA0) "~"]
[(#\uDF) "{\\ss}"]
- [(#\u039A) "K"] ; kappa
- [(#\u0391) "A"] ; alpha
- [(#\u039F) "O"] ; omicron
- [(#\u03A3) "$\\Sigma$"]
- [(#\u03BA) "$\\kappa$"]
- [(#\u03B1) "$\\alpha$"]
- [(#\u03B2) "$\\beta$"]
- [(#\u03B3) "$\\gamma$"]
- [(#\u03BF) "o"] ; omicron
- [(#\u03C3) "$\\sigma$"]
- [(#\u03C2) "$\\varsigma$"]
- [(#\u03BB) "$\\lambda$"]
- [(#\u039B) "$\\Lambda$"]
- [(#\u03BC) "$\\mu$"]
- [(#\u03C0) "$\\pi$"]
- [(#\∞) "$\\infty$"]
- [(#\à) "\\`{a}"]
- [else c])))
+ [else
+ (if ((char->integer c) . > . 127)
+ (case c
+ [(#\u039A) "K"] ; kappa
+ [(#\u0391) "A"] ; alpha
+ [(#\u039F) "O"] ; omicron
+ [(#\u03A3) "$\\Sigma$"]
+ [(#\u03BA) "$\\kappa$"]
+ [(#\u03B1) "$\\alpha$"]
+ [(#\u03B2) "$\\beta$"]
+ [(#\u03B3) "$\\gamma$"]
+ [(#\u03BF) "o"] ; omicron
+ [(#\u03C3) "$\\sigma$"]
+ [(#\u03C2) "$\\varsigma$"]
+ [(#\u03BB) "$\\lambda$"]
+ [(#\u039B) "$\\Lambda$"]
+ [(#\u03BC) "$\\mu$"]
+ [(#\u03C0) "$\\pi$"]
+ [(#\∞) "$\\infty$"]
+ [(#\⇓) "$\\Downarrow$"]
+ [(#\↖) "$\\nwarrow$"]
+ [(#\↓) "$\\downarrow$"]
+ [(#\⇒) "$\\Rightarrow$"]
+ [(#\→) "$\\rightarrow$"]
+ [(#\↘) "$\\searrow$"]
+ [(#\↙) "$\\swarrow$"]
+ [(#\←) "$\\leftarrow$"]
+ [(#\↑) "$\\uparrow$"]
+ [(#\⇐) "$\\Leftarrow$"]
+ [(#\−) "$\\longrightarrow$"]
+ [(#\⇑) "$\\Uparrow$"]
+ [(#\⇔) "$\\Leftrightarrow$"]
+ [(#\↕) "$\\updownarrow$"]
+ [(#\↔) "$\\leftrightarrow$"]
+ [(#\↗) "$\\nearrow$"]
+ [(#\⇕) "$\\Updownarrow$"]
+ [(#\א) "$\\aleph$"]
+ [(#\′) "$\\prime$"]
+ [(#\∅) "$\\emptyset$"]
+ [(#\∇) "$\\nabla$"]
+ [(#\♦) "$\\diamondsuit$"]
+ [(#\♠) "$\\spadesuit$"]
+ [(#\♣) "$\\clubsuit$"]
+ [(#\♥) "$\\heartsuit$"]
+ [(#\♯) "$\\sharp$"]
+ [(#\♭) "$\\flat$"]
+ [(#\♮) "$\\natural$"]
+ [(#\√) "$\\surd$"]
+ [(#\¬) "$\\neg$"]
+ [(#\△) "$\\triangle$"]
+ [(#\∀) "$\\forall$"]
+ [(#\∃) "$\\exists$"]
+ [(#\∘) "$\\circ$"]
+ [(#\θ) "$\\theta$"]
+ [(#\τ) "$\\tau$"]
+ [(#\υ) "$\\upsilon$"]
+ [(#\φ) "$\\phi$"]
+ [(#\δ) "$\\delta$"]
+ [(#\ρ) "$\\rho$"]
+ [(#\ε) "$\\epsilon$"]
+ [(#\χ) "$\\chi$"]
+ [(#\ψ) "$\\psi$"]
+ [(#\ζ) "$\\zeta$"]
+ [(#\ν) "$\\nu$"]
+ [(#\ω) "$\\omega$"]
+ [(#\η) "$\\eta$"]
+ [(#\ξ) "$\\xi$"]
+ [(#\Γ) "$\\Gamma$"]
+ [(#\Ψ) "$\\Psi$"]
+ [(#\∆) "$\\Delta$"]
+ [(#\Ξ) "$\\Xi$"]
+ [(#\Υ) "$\\Upsilon$"]
+ [(#\Ω) "$\\Omega$"]
+ [(#\Θ) "$\\Theta$"]
+ [(#\Π) "$\\Pi$"]
+ [(#\Φ) "$\\Phi$"]
+ [(#\±) "$\\pm$"]
+ [(#\∩) "$\\cap$"]
+ [(#\◇) "$\\diamond$"]
+ [(#\⊕) "$\\oplus$"]
+ [(#\∓) "$\\mp$"]
+ [(#\∪) "$\\cup$"]
+ [(#\△) "$\\bigtriangleup$"]
+ [(#\⊖) "$\\ominus$"]
+ [(#\×) "$\\times$"]
+ [(#\⊎) "$\\uplus$"]
+ [(#\▽) "$\\bigtriangledown$"]
+ [(#\⊗) "$\\otimes$"]
+ [(#\÷) "$\\div$"]
+ [(#\⊓) "$\\sqcap$"]
+ [(#\▹) "$\\triangleleft$"]
+ [(#\⊘) "$\\oslash$"]
+ [(#\∗) "$\\ast$"]
+ [(#\⊔) "$\\sqcup$"]
+ [(#\∨) "$\\vee$"]
+ [(#\∧) "$\\wedge$"]
+ [(#\◃) "$\\triangleright$"]
+ [(#\⊙) "$\\odot$"]
+ [(#\★) "$\\star$"]
+ [(#\†) "$\\dagger$"]
+ [(#\•) "$\\bullet$"]
+ [(#\‡) "$\\ddagger$"]
+ [(#\≀) "$\\wr$"]
+ [(#\⨿) "$\\amalg$"]
+ [(#\≤) "$\\leq$"]
+ [(#\≥) "$\\geq$"]
+ [(#\≡) "$\\equiv$"]
+ [(#\⊨) "$\\models$"]
+ [(#\≺) "$\\prec$"]
+ [(#\≻) "$\\succ$"]
+ [(#\∼) "$\\sim$"]
+ [(#\⊥) "$\\perp$"]
+ [(#\≼) "$\\preceq$"]
+ [(#\≽) "$\\succeq$"]
+ [(#\≃) "$\\simeq$"]
+ [(#\≪) "$\\ll$"]
+ [(#\≫) "$\\gg$"]
+ [(#\≍) "$\\asymp$"]
+ [(#\∥) "$\\parallel$"]
+ [(#\⊂) "$\\subset$"]
+ [(#\⊃) "$\\supset$"]
+ [(#\≈) "$\\approx$"]
+ [(#\⋈) "$\\bowtie$"]
+ [(#\⊆) "$\\subseteq$"]
+ [(#\⊇) "$\\supseteq$"]
+ [(#\≌) "$\\cong$"]
+ [(#\⊏) "$\\sqsubset$"]
+ [(#\⊐) "$\\sqsupset$"]
+ [(#\≠) "$\\neq$"]
+ [(#\⌣) "$\\smile$"]
+ [(#\⊑) "$\\sqsubseteq$"]
+ [(#\⊒) "$\\sqsupseteq$"]
+ [(#\≐) "$\\doteq$"]
+ [(#\⌢) "$\\frown$"]
+ [(#\∈) "$\\in$"]
+ [(#\∋) "$\\ni$"]
+ [(#\∝) "$\\propto$"]
+ [(#\⊢) "$\\vdash$"]
+ [(#\⊣) "$\\dashv$"]
+ [(#\☠) "$\\skull$"]
+ [(#\☺) "$\\smiley$"]
+ [(#\☻) "$\\blacksmiley$"]
+ [(#\☹) "$\\frownie$"]
+ [(#\à) "\\`{a}"]
+ [else c])
+ c)])))
(loop (add1 i)))))))
;; ----------------------------------------
diff --git a/collects/scribble/scribble-prefix.tex b/collects/scribble/scribble-prefix.tex
@@ -3,6 +3,7 @@
\parskip=10pt
\parindent=0pt
+\partopsep=0pt
% Adjust margins to match HTML width for
% fixed-width font
diff --git a/collects/scribble/scribble.tex b/collects/scribble/scribble.tex
@@ -5,6 +5,8 @@
\renewcommand{\rmdefault}{ptm}
\usepackage{stabular}
\usepackage{relsize}
+\usepackage{wasysym}
+\usepackage{skull}
\usepackage[htt]{hyphenat}
\usepackage[usenames,dvipsnames]{color}
\hypersetup{bookmarks=true,bookmarksopen=true,bookmarksnumbered=true}
@@ -77,12 +79,21 @@
\newcommand{\bibentry}[1]{\parbox[t]{0.8\linewidth}{#1}}
-\newenvironment{bigtabular}{\vspace{0ex}
-
-\begin{stabular}}{\end{stabular}
-
-\vspace{0ex}}
+% stabular seems to be the lesser of all page-breaking table evironments
+\newenvironment{bigtabular}{\begin{stabular}}{\end{stabular}}
+% used to keep the horizontal line for a definition on the same page:
\newcommand{\SEndFirstHead}[0]{ \nopagebreak \\ }
+% attempts to correct weirdness when a table is the first thing in
+% an itemization:
+\newcommand{\bigtableinlinecorrect}[0]{~
+
+\vspace{-\baselineskip}\vspace{\parskip}}
+% used to indent the table correctly in an itemization, since that's
+% one of the things stabular gets wrong
+\newlength{\stabLeft}
+\newcommand{\bigtableleftpad}{\hspace{\stabLeft}}
+\newcommand{\atItemizeStart}[0]{\addtolength{\stabLeft}{\labelsep}
+ \addtolength{\stabLeft}{\labelwidth}}
\newenvironment{schemeblock}{}{}
\newenvironment{defmodule}{}{}