commit 5318f776fd67998f878b9494b7e85c93b58128d0
parent e6c900ec2bf1fce4114f903a4dce60fc5229270a
Author: Matthew Flatt <mflatt@racket-lang.org>
Date: Fri, 7 Jan 2011 07:05:07 -0700
add `._' and `.__' to `scribble/base' for abbrev- and setence-ending periods
original commit: 5998c0ac95b6b47f965b336b717406155a6f055c
Diffstat:
4 files changed, 43 insertions(+), 0 deletions(-)
diff --git a/collects/scribble/base.rkt b/collects/scribble/base.rkt
@@ -262,6 +262,13 @@
;; ----------------------------------------
+(provide ._ .__)
+
+(define ._ (make-element (make-style "Sendabbrev" null) "."))
+(define .__ (make-element (make-style "Sendsentence" null) "."))
+
+;; ----------------------------------------
+
(define elem-like-contract
(->* () () #:rest (listof pre-content?) element?))
diff --git a/collects/scribble/scribble.tex b/collects/scribble/scribble.tex
@@ -83,6 +83,10 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Etc.
+% ._ and .__
+\newcommand{\Sendabbrev}[1]{#1\@}
+\newcommand{\Sendsentence}[1]{\@#1}
+
% Default style for a nested flow:
\newenvironment{Subflow}{\begin{list}{}{\topsep=0pt\partopsep=0pt%
\listparindent=0pt\itemindent=0pt\labelwidth=0pt\leftmargin=0pt\rightmargin=0pt%
diff --git a/collects/scribblings/scribble/base.scrbl b/collects/scribblings/scribble/base.scrbl
@@ -348,6 +348,33 @@ See also @racket[verbatim].}
}
+@defthing[._ element?]{
+
+Generates a period that ends an abbreviation in the middle of a
+sentence, as opposed to a period that ends a sentence (since the
+latter may be typeset with extra space). Use @litchar|{@._}| in a
+document instead of just @litchar{.} for an abbreviation-ending period
+that is preceded by a lowercase letter and followed by a space.
+
+See @racket[.__] for an example.}
+
+
+@defthing[.__ element?]{
+
+Generates a period that ends a sentence (which may be typeset with
+extra space), as opposed to a period that ends an abbreviation in the
+middle of a sentence. Use @litchar|{@.__}| in a document instead of just
+@litchar{.} for a sentence-ending period that is preceded by an
+uppercase letter.
+
+The following example illustrates both @racket[._] and @racket[.__]:
+
+@codeblock|{
+ #lang scribble/base
+ My name is Mr@._ T@.__ I pity the fool who can't typeset punctuation.
+}|}
+
+
@; ------------------------------------------------------------------------
@section[#:tag "base-links"]{Links}
diff --git a/collects/scribblings/scribble/style.scrbl b/collects/scribblings/scribble/style.scrbl
@@ -77,6 +77,11 @@ procedure should have a single definition point. (Scribble issues a
warning when a binding has multiple definition points.) Instead, use
@racket[defproc*] or @racket[defform*].
+For function arguments, use @racket[v] as the meta-variable for ``any
+value.'' Use @racket[x] as a meta-variable only for numerical
+values. Other conventions include @racket[lst] for a list and
+@racket[proc] for a procedure.
+
Pay attention to the difference between identifiers and meta-variables
when using @racket[racket], especially outside of @racket[defproc] or
@racket[defform]. Prefix a meta-variable with @litchar{_}; for