Kaynağa Gözat

* Added additional optional parameters to \sidenote (and \footnote). Usage:

\sidenote[num][dimension]{Sidenote text.} where ``num'' is the sidenote
  number and ``dimension'' is the amount of space to move the sidenote down the
  page.   (Negative values will move the sidenote up the page.)


git-svn-id: https://tufte-latex.googlecode.com/svn/trunk@73 516e2f36-ce3a-0410-bea4-1d4a03f5df72
master
Kevin M. Godby 17 yıl önce
ebeveyn
işleme
241feaafff
5 değiştirilmiş dosya ile 83 ekleme ve 27 silme
  1. BIN
      sample-book.pdf
  2. +2
    -2
      sample-book.tex
  3. BIN
      sample-handout.pdf
  4. +15
    -16
      sample-handout.tex
  5. +66
    -9
      tufte-common.sty

BIN
sample-book.pdf Dosyayı Görüntüle


+ 2
- 2
sample-book.tex Dosyayı Görüntüle

@@ -9,8 +9,8 @@
%%
% If they're installed, use Bergamo and Chantilly from www.fontsite.com.
% They're clones of Bembo and Gill Sans, respectively.
\IfFileExists{bergamo.sty}{\usepackage[osf]{bergamo}}{}% Bembo
\IfFileExists{chantill.sty}{\usepackage{chantill}}{}% Gill Sans
%\IfFileExists{bergamo.sty}{\usepackage[osf]{bergamo}}{}% Bembo
%\IfFileExists{chantill.sty}{\usepackage{chantill}}{}% Gill Sans

%\usepackage{microtype}



BIN
sample-handout.pdf Dosyayı Görüntüle


+ 15
- 16
sample-handout.tex Dosyayı Görüntüle

@@ -1,4 +1,4 @@
\documentclass[nofonts]{tufte-handout}
\documentclass{tufte-handout}

\usepackage{amsmath}

@@ -16,19 +16,19 @@
%%
% If we have Bergamo and Chantilly fonts (from www.fontsite.com) installed,
% use them. Bergamo is a clone of Bembo and Chantilly is similar to Gill Sans.
\makeatletter
\ifthenelse{\NOT\boolean{@tufte@xetex}}
{%
\IfFileExists{bergamo.sty}{\usepackage[osf]{bergamo}}{}% Bembo clone
\IfFileExists{chantill.sty}{\usepackage{chantill}}{}% Gill Sans clone
}{% We're using XeTeX -- load fontspec, etc.
\usepackage{fontspec}
\usepackage{xltxtra}
\setromanfont{Bergamo}% Bembo clone
\setsansfont{Chantilly}% Gill Sans clone
\setmonofont{Bitstream Vera Sans Mono}%
}
\makeatother
%\makeatletter
%\ifthenelse{\NOT\boolean{@tufte@xetex}}
% {%
% \IfFileExists{bergamo.sty}{\usepackage[osf]{bergamo}}{}% Bembo clone
% \IfFileExists{chantill.sty}{\usepackage{chantill}}{}% Gill Sans clone
% }{% We're using XeTeX -- load fontspec, etc.
% \usepackage{fontspec}
% \usepackage{xltxtra}
% \setromanfont{Bergamo}% Bembo clone
% \setsansfont{Chantilly}% Gill Sans clone
% \setmonofont{Bitstream Vera Sans Mono}%
% }
%\makeatother

% The following package makes prettier tables. We're all about the bling!
\usepackage{booktabs}
@@ -74,7 +74,7 @@ This style provides \textsc{a}- and \textsc{b}-heads (that is,
\Verb|\section| and \Verb|\subsection|) demonstrated above.

If you need more than two levels of section headings, you'll have to define
them yourself at the moment;\sidenote{See see ``Defining new sections'' on
them yourself at the moment;\sidenote{See see ``\nameref{sec:defining-sections}'' on
page~\pageref{sec:defining-sections} for help with defining more heading
levels.} there are no pre-defined styles for anything below a
\Verb|\subsection|. As Bringhurst points out in \textit{The Elements of
@@ -314,7 +314,6 @@ class relies upon. Packages marked with an asterisk are optional.
\item chngpage
\item paralist
\item textcase
\item footmisc
\item natbib and bibentry
\item placeins
\item caption


+ 66
- 9
tufte-common.sty Dosyayı Görüntüle

@@ -146,12 +146,11 @@
% Load the `hyperref' package. We will set more options later.
% TODO Set nice defaults for hyperref options
\ifthenelse{\boolean{@tufte@xetex}}
{\RequirePackage[xetex]{hyperref}}
{\RequirePackage{hyperref}}
{\RequirePackage[hyperfootnotes=false,xetex]{hyperref}}
{\RequirePackage[hyperfootnotes=false]{hyperref}}

\hypersetup{%
pdfborder = {0 0 0},
hyperfootnotes = false
}

%%
@@ -414,8 +413,6 @@
\nobibliography* % pre-loads the bibliography keys
\providecommand{\doi}[1]{\textsc{doi:} #1} % pre-defining this so it may be used before the \bibliography command it issued

\let\sidenote\footnote% This will be redefined shortly

%%
% Normal \cite behavior
\newcommand{\@tufte@normal@cite}[1]{%
@@ -458,7 +455,8 @@
% Transform existing \footnotes into \sidenotes
% Sidenote: ``Where God meant footnotes to go.'' ---Tufte

\RequirePackage[side,multiple,stable]{footmisc}
\RequirePackage{optparams}% for our new sidenote commands -- provides multiple optional arguments for commands

\providecommand*{\footnotelayout}{\@tufte@marginfont\@tufte@justification}
\renewcommand{\footnotelayout}{\@tufte@marginfont\@tufte@justification}

@@ -469,20 +467,79 @@
% Set the in-text footnote mark in the same typeface as the body text itself.
\def\@makefnmark{\hbox{\@textsuperscript{\normalfont\scriptsize\@thefnmark}}}

\providecommand*{\multiplefootnotemarker}{3sp}
\providecommand*{\multfootsep}{,}

\renewcommand*\@footnotemark{%
\leavevmode%
\ifhmode%
\edef\@x@sf{\the\spacefactor}%
\@tufte@check@multiple@sidenotes%
\nobreak%
\fi%
\@makefnmark%
\ifhmode\spacefactor\@x@sf\fi%
\relax%
}

\newcommand{\@tufte@check@multiple@sidenotes}{%
\ifdim\lastkern=\multiplefootnotemarker\relax
\edef\@x@sf{\the\spacefactor}%
\unkern
\textsuperscript{\multfootsep}%
\spacefactor\@x@sf\relax
\fi
}

\renewcommand\@footnotetext[2][0pt]{%
\marginpar{%
\vspace*{#1}%
\def\baselinestretch {\setspace@singlespace}%
\reset@font\footnotesize%
\protected@edef\@currentlabel{%
\csname p@footnote\endcsname\@thefnmark%
}%
\color@begingroup%
\@makefntext{%
\ignorespaces#2%
}%
\color@endgroup%
}%
}%

%
% Define \sidenote command. Can handle \cite.

\renewcommand{\sidenote}[1]{%
\newcommand{\@tufte@sidenote@vertical@offset}{0pt}

% #1 = footnote num, #2 = vertical offset, #3 = footnote text
\def\@tufte@sidenote[#1][#2]#3{%
\let\cite\@tufte@infootnote@cite% use the in-sidenote \cite command
\gdef\@tufte@citations{}% clear out any old citations
\footnote{#1}% print the actual sidenote
\ifthenelse{\NOT\isempty{#2}}{\renewcommand{\@tufte@sidenote@vertical@offset}{#2}}{}%
\ifthenelse{\isempty{#1}}{%
% % no footnote number
\stepcounter\@mpfn%
\protected@xdef\@thefnmark{\thempfn}%
\@footnotemark\@footnotetext[\@tufte@sidenote@vertical@offset]{#3}%
}{%
% % footnote number
\begingroup%
\csname c@\@mpfn\endcsname #1\relax%
\unrestored@protected@xdef\@thefnmark{\thempfn}%
\endgroup%
\@footnotemark\@footnotetext[\@tufte@sidenote@vertical@offset]{#3}%
}%
\@tufte@print@citations% print any citations
\let\cite\@tufte@normal@cite% go back to using normal in-text \cite command
\unskip\ignorespaces% remove extra white space
\kern-\multiplefootnotemarker% remove \kern left behind by sidenote
\kern\multiplefootnotemarker\relax% add new \kern here to replace the one we yanked (used by footmisc's `multiple' option)
\kern\multiplefootnotemarker\relax% add new \kern here to replace the one we yanked
}

\newcommand*{\sidenote}{\optparams{\@tufte@sidenote}{[][0pt]}}
\renewcommand*{\footnote}{\optparams{\@tufte@sidenote}{[][0pt]}}

%%
% Sidenote without the footnote mark



Yükleniyor…
İptal
Kaydet