Fix citation disabiguation when authors differ.

original commit: 29cfc48c5e9361fa1608a315f0558311e416a0d2
This commit is contained in:
Vincent St-Amour 2012-11-10 14:49:38 -05:00
commit 8193c3e1ec
12 changed files with 209 additions and 55 deletions

View File

@ -890,7 +890,7 @@
(list (make-element (if (include-navigation?) (list (make-element (if (include-navigation?)
"version" "version"
"versionNoNav") "versionNoNav")
(list "Version: " v))) v))
d d
ri)))))) ri))))))
@ -1597,7 +1597,7 @@
(list name))))))) (list name)))))))
(define in-plt? (define in-plt?
(let ([roots (map explode (list (find-doc-dir) (find-collects-dir)))]) (let ([roots (map explode (filter values (list (find-doc-dir) (find-collects-dir))))])
(lambda (path) (lambda (path)
(ormap (lambda (root) (ormap (lambda (root)
(let loop ([path path] [root root]) (let loop ([path path] [root root])

View File

@ -965,6 +965,10 @@
[(#\u2079) "$^9$"] [(#\u2079) "$^9$"]
[(#\u207a) "$^+$"] [(#\u207a) "$^+$"]
[(#\u207b) "$^-$"] [(#\u207b) "$^-$"]
[else
(cond
[(char<=? #\uAC00 c #\uD7AF) ; Korean Hangul
(format "\\begin{CJK}{UTF8}{mj}~a\\end{CJK}" c)]
[else [else
;; Detect characters that can be formed with combining characters ;; Detect characters that can be formed with combining characters
;; and translate them to Latex combinations: ;; and translate them to Latex combinations:
@ -992,7 +996,7 @@
(= 1 (string-length base))) (= 1 (string-length base)))
(format combiner (char-loop (string-ref base 0))) (format combiner (char-loop (string-ref base 0)))
c)] c)]
[else c])]) [else c])])])
c)]))) c)])))
(loop (add1 i))))))) (loop (add1 i)))))))

View File

@ -154,6 +154,10 @@ table td {
font-size: xx-small; /* avoid overlap with author */ font-size: xx-small; /* avoid overlap with author */
} }
.version:before, .versionNoNav:before {
content: "Version ";
}
/* ---------------------------------------- */ /* ---------------------------------------- */
/* Margin notes */ /* Margin notes */

View File

@ -11,6 +11,8 @@
\usepackage[htt]{hyphenat} \usepackage[htt]{hyphenat}
\usepackage[usenames,dvipsnames]{color} \usepackage[usenames,dvipsnames]{color}
\hypersetup{bookmarks=true,bookmarksopen=true,bookmarksnumbered=true} \hypersetup{bookmarks=true,bookmarksopen=true,bookmarksnumbered=true}
\IfFileExists{tocstyle.sty}{\usepackage{tocstyle}\usetocstyle{standard}}{}
\IfFileExists{CJK.sty}{\usepackage{CJK}}{}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Configuration that is especially meant to be overridden: % Configuration that is especially meant to be overridden:
@ -139,12 +141,13 @@
\newenvironment{refcolumnleft}{\begin{refcolumn}}{\end{refcolumn}} \newenvironment{refcolumnleft}{\begin{refcolumn}}{\end{refcolumn}}
% Macros used by `title' and `author': % Macros used by `title' and `author':
\newcommand{\titleAndVersionAndAuthors}[3]{\title{#1\\{\normalsize Version #2}}\author{#3}\maketitle} \newcommand{\titleAndVersionAndAuthors}[3]{\title{#1\\{\normalsize \SVersionBefore{}#2}}\author{#3}\maketitle}
\newcommand{\titleAndVersionAndEmptyAuthors}[3]{\title{#1\\{\normalsize Version #2}}#3\maketitle} \newcommand{\titleAndVersionAndEmptyAuthors}[3]{\title{#1\\{\normalsize \SVersionBefore{}#2}}#3\maketitle}
\newcommand{\titleAndEmptyVersionAndAuthors}[3]{\title{#1}\author{#3}\maketitle} \newcommand{\titleAndEmptyVersionAndAuthors}[3]{\title{#1}\author{#3}\maketitle}
\newcommand{\titleAndEmptyVersionAndEmptyAuthors}[3]{\title{#1}\maketitle} \newcommand{\titleAndEmptyVersionAndEmptyAuthors}[3]{\title{#1}\maketitle}
\newcommand{\SAuthor}[1]{#1} \newcommand{\SAuthor}[1]{#1}
\newcommand{\SAuthorSep}[1]{\qquad} \newcommand{\SAuthorSep}[1]{\qquad}
\newcommand{\SVersionBefore}[1]{Version }
% Useful for some styles, such as sigalternate: % Useful for some styles, such as sigalternate:
\newcommand{\SNumberOfAuthors}[1]{} \newcommand{\SNumberOfAuthors}[1]{}

View File

@ -400,7 +400,12 @@ The recognized @tech{style properties} are as follows:
not @racket[""] may be used when rendering a document; at a not @racket[""] may be used when rendering a document; at a
minimum, a non-@racket[""] version is rendered when it is minimum, a non-@racket[""] version is rendered when it is
attached to a part representing the whole document. The default attached to a part representing the whole document. The default
version for a document is @racket[(version)].} version for a document is @racket[(version)]. In rendered form,
the version is normally prefixed with the word ``Version,'' but
this formatting can be controlled by overriding
@tt{.version:before} and/or @tt{.versionNoNav:before} in CSS
for HTML rendering or by redefining the @tt{\SVersionBefore}
macro for Latex rendering (see @secref["config"]).}
@item{@racket[document-date] structure --- A date for the part, @item{@racket[document-date] structure --- A date for the part,
normally used on a document's main part for for Latex normally used on a document's main part for for Latex

View File

@ -168,18 +168,20 @@ otherwise.}
@defstruct[title-decl ([tag-prefix (or/c #f string?)] @defstruct[title-decl ([tag-prefix (or/c #f string?)]
[tags (listof string?)] [tags (listof string?)]
[version (or/c string? #f)] [version (or/c string? #f)]
[style any/c] [style style?]
[content content?])]{ [content content?])]{
See @racket[decode] and @racket[decode-part]. The @racket[_tag-prefix] See @racket[decode] and @racket[decode-part]. The @racket[tag-prefix]
and @racket[_style] fields are propagated to the resulting and @racketidfont{style} fields are propagated to the resulting
@racket[part]. If the @racketidfont{version} field is not @racket[#f],
it is propagated as a @racket[document-version] style property on the
@racket[part].} @racket[part].}
@defstruct[part-start ([depth integer?] @defstruct[part-start ([depth integer?]
[tag-prefix (or/c #f string?)] [tag-prefix (or/c #f string?)]
[tags (listof string?)] [tags (listof string?)]
[style any/c] [style style?]
[title content?])]{ [title content?])]{
Like @racket[title-decl], but for a sub-part. See @racket[decode] and Like @racket[title-decl], but for a sub-part. See @racket[decode] and

View File

@ -757,7 +757,28 @@ If @racket[#:id [src-id dest-id-expr]] is supplied, then
@racket[dest-id-expr] produces the identifier to be documented in @racket[dest-id-expr] produces the identifier to be documented in
place of @racket[src-id]. This split between @racket[src-id] and place of @racket[src-id]. This split between @racket[src-id] and
@racket[dest-id-expr] roles is useful for functional abstraction of @racket[dest-id-expr] roles is useful for functional abstraction of
@racket[defproc].} @racket[defproc].
Examples:
@codeblock[#:keep-lang-line? #f]|{
#lang scribble/manual
@defproc[(make-sandwich [ingredients (listof ingredient?)])
sandwich?]{
Returns a sandwich given the right ingredients.
}
@defproc[#:kind "sandwich-maker"
(make-reuben [ingredient sauerkraut?] ...
[#:veggie? veggie? any/c #f])
sandwich?]{
Produces a reuben given some number of @racket[ingredient]s.
If @racket[veggie?] is @racket[#f], produces a standard
reuben with corned beef. Otherwise, produces a vegetable
reuben.
}
}|
}
@defform[(defproc* maybe-kind maybe-id @defform[(defproc* maybe-kind maybe-id
([prototype ([prototype
@ -771,7 +792,20 @@ When an @racket[id] has multiple calling cases, they must be defined
with a single @racket[defproc*], so that a single definition point with a single @racket[defproc*], so that a single definition point
exists for the @racket[id]. However, multiple distinct @racket[id]s exists for the @racket[id]. However, multiple distinct @racket[id]s
can also be defined by a single @racket[defproc*], for the case that can also be defined by a single @racket[defproc*], for the case that
it's best to document a related group of procedures at once.} it's best to document a related group of procedures at once.
Examples:
@codeblock[#:keep-lang-line? #f]|{
#lang scribble/manual
@defproc[((make-pb&j)
(make-pb&j [jelly jelly?]))
sandwich?]{
Returns a peanut butter and jelly sandwich. If @racket[jelly]
is provided, then it is used instead of the standard (grape)
jelly.
}
}|
}
@defform/subs[(defform maybe-kind maybe-id maybe-literals form-datum @defform/subs[(defform maybe-kind maybe-id maybe-literals form-datum
@ -831,14 +865,48 @@ auxiliary grammar specified using @racket[defform/subs].
The typesetting of @racket[form-datum], @racket[subform-datum], and The typesetting of @racket[form-datum], @racket[subform-datum], and
@racket[contract-expr-datum] preserves the source layout, like @racket[contract-expr-datum] preserves the source layout, like
@racket[racketblock].} @racket[racketblock].
Examples:
@codeblock[#:keep-lang-line? #f]|{
#lang scribble/manual
@defform[(sandwich-promise sandwich-expr)
#:contracts ([sandwich-expr sandwich?])]{
Returns a promise to construct a sandwich. When forced, the promise
will produce the result of @racket[sandwich-expr].
}
@defform[#:literals (sandwich mixins)
(sandwich-promise* [sandwich sandwich-expr]
[mixins ingredient-expr ...])
#:contracts ([sandwich-expr sandwich?]
[ingreient-expr ingredient?])]{
Returns a promise to construct a sandwich. When forced, the promise
will produce the result of @racket[sandwich-expr]. Each result of
the @racket[ingredient-expr]s will be mixed into the resulting
sandwich.
}
}|
}
@defform[(defform* maybe-kind maybe-id maybe-literals [form-datum ...+] @defform[(defform* maybe-kind maybe-id maybe-literals [form-datum ...+]
maybe-contracts maybe-contracts
pre-flow ...)]{ pre-flow ...)]{
Like @racket[defform], but for multiple forms using the same Like @racket[defform], but for multiple forms using the same
@racket[_id].} @racket[_id].
Examples:
@codeblock[#:keep-lang-line? #f]|{
#lang scribble/manual
@defform*[((call-with-current-sandwich expr)
(call-with-current-sandwich expr sandwich-handler-expr))]{
Runs @racket[expr] and passes it the value of the current
sandwich. If @racket[sandwich-handler-expr] is provided, its result
is invoked when the current sandwich is eaten.
}
}|
}
@defform[(defform/subs maybe-kind maybe-id maybe-literals form-datum @defform[(defform/subs maybe-kind maybe-id maybe-literals form-datum
([nonterm-id clause-datum ...+] ...) ([nonterm-id clause-datum ...+] ...)
@ -849,7 +917,22 @@ Like @racket[defform], but including an auxiliary grammar of
non-terminals shown with the @racket[_id] form. Each non-terminals shown with the @racket[_id] form. Each
@racket[nonterm-id] is specified as being any of the corresponding @racket[nonterm-id] is specified as being any of the corresponding
@racket[clause-datum]s, where the formatting of each @racket[clause-datum]s, where the formatting of each
@racket[clause-datum] is preserved.} @racket[clause-datum] is preserved.
Examples:
@codeblock[#:keep-lang-line? #f]|{
#lang scribble/manual
@defform/subs[(sandwich-factory maybe-name factory-component ...)
[(maybe-name (code:line)
name)
(factory-component (code:line #:protein protein-expr)
[vegetable vegetable-expr])]]{
Constructs a sandwich factory. If @racket[maybe-name] is provided,
the factory will be named. Each of the @racket[factory-component]
clauses adds an additional ingredient to the sandwich pipeline.
}
}|
}
@defform[(defform*/subs maybe-kind maybe-id maybe-literals [form-datum ...+] @defform[(defform*/subs maybe-kind maybe-id maybe-literals [form-datum ...+]
@ -935,7 +1018,17 @@ Like @racket[specspecsubform], but with a grammar like
Like @racket[defproc], but for a parameter. The Like @racket[defproc], but for a parameter. The
@racket[contract-expr-datum] serves as both the result contract on the @racket[contract-expr-datum] serves as both the result contract on the
parameter and the contract on values supplied for the parameter. The parameter and the contract on values supplied for the parameter. The
@racket[arg-id] refers to the parameter argument in the latter case.} @racket[arg-id] refers to the parameter argument in the latter case.
Examples:
@codeblock[#:keep-lang-line? #f]|{
#lang scribble/manual
@defparam[current-sandwich sandwich sandwich?]{
A parameter that defines the current sandwich for operations that
involve eating a sandwich.
}
}|
}
@defform[(defboolparam id arg-id pre-flow ...)]{ @defform[(defboolparam id arg-id pre-flow ...)]{
@ -950,7 +1043,16 @@ Like @racket[defproc], but for a non-procedure binding.
If @racket[#:kind kind-string-expr] is supplied as If @racket[#:kind kind-string-expr] is supplied as
@racket[maybe-kind], it is used in the same way as for @racket[maybe-kind], it is used in the same way as for
@racket[defproc], but the default kind is @racket["value"].} @racket[defproc], but the default kind is @racket["value"].
Examples:
@codeblock[#:keep-lang-line? #f]|{
#lang scribble/manual
@defthing[moldy-sandwich sandwich?]
Don't eat this. Provided for backwards compatibility.
}
}|
}
@deftogether[( @deftogether[(
@ -974,7 +1076,18 @@ If @racket[#:kind kind-string-expr] is supplied as
Similar to @racket[defform] or @racket[defproc], but for a structure Similar to @racket[defform] or @racket[defproc], but for a structure
definition. The @racket[defstruct*] form corresponds to @racket[struct], definition. The @racket[defstruct*] form corresponds to @racket[struct],
while @racket[defstruct] corresponds to @racket[define-struct].} while @racket[defstruct] corresponds to @racket[define-struct].
Examples:
@codeblock[#:keep-lang-line? #f]|{
#lang scribble/manual
@defstruct[sandwich ([protein ingredient?] [sauce ingredient?])]{
A strucure type for sandwiches. Sandwiches are a pan-human foodstuff
composed of a partially-enclosing bread material and various
ingredients.
}
}|
}
@defform[(deftogether [def-expr ...] pre-flow ...)]{ @defform[(deftogether [def-expr ...] pre-flow ...)]{
@ -984,7 +1097,18 @@ single definition box. Each @racket[def-expr] should produce a
definition point via @racket[defproc], @racket[defform], etc. Each definition point via @racket[defproc], @racket[defform], etc. Each
@racket[def-expr] should have an empty @racket[pre-flow]; the @racket[def-expr] should have an empty @racket[pre-flow]; the
@tech{decode}d @racket[pre-flow] sequence for the @racket[deftogether] @tech{decode}d @racket[pre-flow] sequence for the @racket[deftogether]
form documents the collected bindings.} form documents the collected bindings.
Examples:
@codeblock[#:keep-lang-line? #f]|{
#lang scribble/manual
@deftogether[(@defthing[test-sandwich-1 sandwich?]
@defthing[test-sandwich-2 sandwich?])]{
Two high-quality sandwiches. These are provided for convenience
in writing test cases
}
}|
}
@defform/subs[(racketgrammar maybe-literals id clause-datum ...+) @defform/subs[(racketgrammar maybe-literals id clause-datum ...+)

View File

@ -242,7 +242,8 @@
[(date<? b a) #f] [(date<? b a) #f]
[else (string-ci<? (auto-bib-key a) (auto-bib-key b))])))) [else (string-ci<? (auto-bib-key a) (auto-bib-key b))]))))
(define (ambiguous? a b) (define (ambiguous? a b)
(and (string-ci=? (extract-bib-key a) (extract-bib-key b)) (and (string-ci=? (author-element-cite (extract-bib-author a))
(author-element-cite (extract-bib-author b)))
(auto-bib-date a) (auto-bib-date a)
(auto-bib-date b) (auto-bib-date b)
(date=? a b))) (date=? a b)))

View File

@ -29,6 +29,7 @@
(define herefigure-style (make-style "Herefigure" figure-style-extras)) (define herefigure-style (make-style "Herefigure" figure-style-extras))
(define figureinside-style (make-style "FigureInside" figure-style-extras)) (define figureinside-style (make-style "FigureInside" figure-style-extras))
(define legend-style (make-style "Legend" figure-style-extras)) (define legend-style (make-style "Legend" figure-style-extras))
(define figure-target-style (make-style "FigureTarget" figure-style-extras))
(define centertext-style (make-style "Centertext" figure-style-extras)) (define centertext-style (make-style "Centertext" figure-style-extras))
(define figure-style (make-style "Figure" figure-style-extras)) (define figure-style (make-style "Figure" figure-style-extras))
@ -52,7 +53,7 @@
figure-style figure-style
(list (list
(make-nested-flow content-style (list (make-nested-flow figureinside-style (decode-flow content)))) (make-nested-flow content-style (list (make-nested-flow figureinside-style (decode-flow content))))
(make-paragraph centertext-style (list (make-element legend-style (list (Figure-target tag) ": " caption))))))) (make-paragraph centertext-style (list (make-element legend-style (list (make-element figure-target-style (list (Figure-target tag) ": ")) caption)))))))
(define (*figure style tag caption content) (define (*figure style tag caption content)
(make-nested-flow (make-nested-flow
@ -65,7 +66,7 @@
(list (list
(make-paragraph (make-paragraph
plain plain
(list (make-element legend-style (list (Figure-target tag) ": " caption)))))))))) (list (make-element legend-style (list (make-element figure-target-style (list (Figure-target tag) ": ")) caption))))))))))
(define (figure* tag caption . content) (define (figure* tag caption . content)
(*figure centerfiguremulti-style tag caption content)) (*figure centerfiguremulti-style tag caption content))

View File

@ -12,6 +12,8 @@
\vspace{4pt} \vspace{4pt}
\legend{#1}} \legend{#1}}
\newcommand{\FigureTarget}[1]{#1}
\newlength{\FigOrigskip} \newlength{\FigOrigskip}
\FigOrigskip=\parskip \FigOrigskip=\parskip

View File

@ -12,11 +12,18 @@
#:location (dissertation-location #:institution "NEU") #:location (dissertation-location #:institution "NEU")
#:author (authors "Little" "Bo" "Peep") #:author (authors "Little" "Bo" "Peep")
#:date "2012")) #:date "2012"))
@(define c (make-bib #:title "Diss 3"
#:is-book? #t
#:location (dissertation-location #:institution "NEU")
#:author (authors "Little" "Bo" "Peep" "Peep2")
#:date "2012"))
According to the following people, According to the following people,
@cite[a] @cite[a]
@cite[b] @cite[b]
@cite[c]
@citet[a] @citet[a]
@citet[b] @citet[b]
@citet[c]
@cite[a b] @cite[a b]
@cite[b a] @cite[b a]
@citet[a b] @citet[a b]

View File

@ -1,9 +1,10 @@
According to the following people,  (Little et al. 2012a)  (Little et According to the following people,  (Little et al. 2012a)  (Little et
al. 2012b) Little et al. (2012a) Little et al. (2012b)  (Little et al. al. 2012b)  (Little et al. 2012c) Little et al. (2012a) Little et
2012a,b)  (Little et al. 2012b,a) Little et al. (2012a,b) Little et al. (2012b) Little et al. (2012c)  (Little et al. 2012a,b)  (Little et
al. (2012b,a) al. 2012b,a) Little et al. (2012a,b) Little et al. (2012b,a)
Bibliography Bibliography
Little, Bo, and Peep. Diss 1. PhD dissertation, NEU, 2012a. Little, Bo, and Peep. Diss 1. PhD dissertation, NEU, 2012a.
Little, Bo, and Peep. Diss 2. PhD dissertation, NEU, 2012b. Little, Bo, and Peep. Diss 2. PhD dissertation, NEU, 2012b.
Little, Bo, Peep, and Peep2. Diss 3. PhD dissertation, NEU, 2012c.