diff --git a/sample-book.pdf b/sample-book.pdf index cafdd5b..d381253 100644 Binary files a/sample-book.pdf and b/sample-book.pdf differ diff --git a/sample-book.tex b/sample-book.tex index 5560860..7871c72 100644 --- a/sample-book.tex +++ b/sample-book.tex @@ -3,7 +3,7 @@ %% % Book metadata \title{A Tufte-Style Book\thanks{Thanks to Edward R.~Tufte for his inspiration.}} -\author[The Tufte-LaTeX Developers]{The Tufte-\LaTeX\ Developers} +\author[The Tufte-LaTeX Developers]{The Tufte-LaTeX\ Developers} \publisher{Publisher of This Book} %% diff --git a/sample-handout.pdf b/sample-handout.pdf index 1978ae6..fb2844b 100644 Binary files a/sample-handout.pdf and b/sample-handout.pdf differ diff --git a/sample-handout.tex b/sample-handout.tex index ec0c940..189c940 100644 --- a/sample-handout.tex +++ b/sample-handout.tex @@ -156,10 +156,11 @@ the \Verb|\bibliography| command. (See the end of this document for an example.) If you do not want to print a bibliography at the end of your document, use the \Verb|\nobibliography| command in its place. -To enter multiple citations at one location,\cite{Tufte2006,Tufte1990} you can -provide a list of keys separated by commas: \Verb|\cite{Tufte2006,Tufte1990}|. +To enter multiple citations at one location,\cite[-3\baselineskip]{Tufte2006,Tufte1990} you can +provide a list of keys separated by commas and the same optional vertical +offset argument: \Verb|\cite{Tufte2006,Tufte1990}|. \begin{docspec} - \doccmd{cite\{\docarg{bibkey1,bibkey2,\ldots}\}} + \doccmd{cite[\docopt{offset}]\{\docarg{bibkey1,bibkey2,\ldots}\}} \end{docspec} \section{Figures and Tables}\label{sec:figures-and-tables} diff --git a/tufte-common.sty b/tufte-common.sty index 554e7ad..460065a 100644 --- a/tufte-common.sty +++ b/tufte-common.sty @@ -421,12 +421,25 @@ %% % Normal \cite behavior -\newcommand{\@tufte@normal@cite}[1]{% - \@for\@temp@bibkey:=#1\do{% - \sidenote{\bibentry{\@temp@bibkey}.}% +\newcounter{@tufte@num@bibkeys}% +\newcommand{\@tufte@normal@cite}[2][0pt]{% + % Snag the last bibentry in the list for later comparison + \let\@temp@last@bibkey\@empty% + \@for\@temp@bibkey:=#2\do{\let\@temp@last@bibkey\@temp@bibkey}% + \sidenote[][#1]{% + % Loop through all the bibentries, separating them with semicolons and spaces + \setcounter{@tufte@num@bibkeys}{0}% + \@for\@temp@bibkeyx:=#2\do{% + \ifthenelse{\equal{\@temp@last@bibkey}{\@temp@bibkeyx}}% + {\ifthenelse{\equal{\value{@tufte@num@bibkeys}}{0}}{}{and\ }% + \bibentry{\@temp@bibkeyx}}% + {\bibentry{\@temp@bibkeyx};\ }% + \stepcounter{@tufte@num@bibkeys}% + }% }% } + %% % Macros for holding the list of cite keys until after the \sidenote @@ -438,10 +451,24 @@ \g@addto@macro\@tufte@citations{#1} } -\newcommand{\@tufte@print@citations}{% puts each citation in its own margin note - \@for\@temp@bibkey:=\@tufte@citations\do{% - \marginpar{\@tufte@marginfont\@tufte@justification\bibentry{\@temp@bibkey}.}% - } +\newcommand{\@tufte@print@citations}[1][0pt]{% puts the citations in a margin note + % Snag the last bibentry in the list for later comparison + \let\@temp@last@bibkey\@empty% + \@for\@temp@bibkey:=\@tufte@citations\do{\let\@temp@last@bibkey\@temp@bibkey}% + \marginpar{% + \vspace*{#1}% + \@tufte@marginfont% + \@tufte@justification% + % Loop through all the bibentries, separating them with semicolons and spaces + \setcounter{@tufte@num@bibkeys}{0}% + \@for\@temp@bibkeyx:=\@tufte@citations\do{% + \ifthenelse{\equal{\@temp@last@bibkey}{\@temp@bibkeyx}}% + {\ifthenelse{\equal{\value{@tufte@num@bibkeys}}{0}}{}{and\ }% + \bibentry{\@temp@bibkeyx}}% + {\bibentry{\@temp@bibkeyx};\ }% + \stepcounter{@tufte@num@bibkeys}% + }% + }% } %% @@ -549,7 +576,7 @@ %% % Sidenote without the footnote mark -\providecommand\marginnote[2][0pt]{% +\newcommand\marginnote[2][0pt]{% \let\cite\@tufte@infootnote@cite% use the in-sidenote \cite command \gdef\@tufte@citations{}% clear out any old citations \marginpar{\vspace*{#1}\@tufte@marginfont\@tufte@justification #2}%