add ._' and .__' to `scribble/base' for abbrev- and setence-ending periods

original commit: 5998c0ac95b6b47f965b336b717406155a6f055c
This commit is contained in:
Matthew Flatt 2011-01-07 07:05:07 -07:00
commit 5318f776fd
4 changed files with 43 additions and 0 deletions

View File

@ -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?))

View File

@ -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%

View File

@ -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}

View File

@ -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