From 825e3fcea8f3c9b847c813dc2840f4ee9305520d Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Thu, 4 Aug 2011 16:16:56 -0600 Subject: [PATCH] Scribble Latex: change 'boxed to use a blue vertical bar ... to the left of a definition, instead of a horizontal line before the definition original commit: 378ca5ffc26168a52a03f46fd83bace49b301ead --- collects/scribble/latex-render.rkt | 29 ++++++++++++----------------- collects/scribble/scribble.tex | 5 ++++- 2 files changed, 16 insertions(+), 18 deletions(-) diff --git a/collects/scribble/latex-render.rkt b/collects/scribble/latex-render.rkt index 56e965f7..f541dbb6 100644 --- a/collects/scribble/latex-render.rkt +++ b/collects/scribble/latex-render.rkt @@ -444,8 +444,7 @@ (let ([m (current-table-mode)]) (and m (equal? "bigtabular" (car m)) - (= 1 (length (car (table-blockss (cadr m))))))))] - [boxline "{\\setlength{\\unitlength}{\\linewidth}\\begin{picture}(1,0)\\put(0,0){\\line(1,0){1}}\\end{picture}}"]) + (= 1 (length (car (table-blockss (cadr m))))))))]) (if single-column? (begin (when (string? s-name) @@ -480,21 +479,17 @@ "\\bigtableleftpad" "") (string-append* - (map (lambda (i cell-style) - (format "~a@{}" - (cond - [(memq 'center (style-properties cell-style)) "c"] - [(memq 'right (style-properties cell-style)) "r"] - [else "l"]))) - (car blockss) - (car cell-styless))) - (if boxed? - (if (equal? tableform "bigtabular") - (format "~a \\SEndFirstHead\n" boxline) - (format "\\multicolumn{~a}{@{}l@{}}{~a} \\\\\n" - (length (car blockss)) - boxline)) - ""))]) + (let ([l + (map (lambda (i cell-style) + (format "~a@{}" + (cond + [(memq 'center (style-properties cell-style)) "c"] + [(memq 'right (style-properties cell-style)) "r"] + [else "l"]))) + (car blockss) + (car cell-styless))]) + (if boxed? (cons "@{\\SBoxedLeft}" l) l))) + "")]) (let loop ([blockss blockss] [cell-styless cell-styless]) (let ([flows (car blockss)] diff --git a/collects/scribble/scribble.tex b/collects/scribble/scribble.tex index 4bb39e86..dac40e28 100644 --- a/collects/scribble/scribble.tex +++ b/collects/scribble/scribble.tex @@ -8,6 +8,7 @@ \usepackage{wasysym} \usepackage{skull} \usepackage{textcomp} +\usepackage{framed} \usepackage[htt]{hyphenat} \usepackage[usenames,dvipsnames]{color} \hypersetup{bookmarks=true,bookmarksopen=true,bookmarksnumbered=true} @@ -60,7 +61,9 @@ % The `stabular' environment seems to be the lesser of evils among % page-breaking table environments: \newenvironment{bigtabular}{\begin{stabular}}{\end{stabular}} -% Used to keep the horizontal line for a definition on the same page: +% For the 'boxed table style: +\newcommand{\SBoxedLeft}{\textcolor[rgb]{0.6,0.6,1.0}{\vrule width 3pt\hspace{3pt}}} +% Formerly used to keep the horizontal line for a definition on the same page: \newcommand{\SEndFirstHead}[0]{ \nopagebreak \\ } % Corrects weirdness when a table is the first thing in % an itemization: