Kaynağa Gözat

* Fixed captions to go in the margins. Tested symmetric option and all figure

placements (top, bottom, here, and page).
* Updated dependencies list in README and sample-handout.


git-svn-id: https://tufte-latex.googlecode.com/svn/trunk@94 516e2f36-ce3a-0410-bea4-1d4a03f5df72
master
Kevin M. Godby 16 yıl önce
ebeveyn
işleme
14875e4d0f
6 değiştirilmiş dosya ile 80 ekleme ve 37 silme
  1. +2
    -2
      README.txt
  2. BIN
      sample-book.pdf
  3. +8
    -11
      sample-book.tex
  4. BIN
      sample-handout.pdf
  5. +9
    -8
      sample-handout.tex
  6. +61
    -16
      tufte-common.sty

+ 2
- 2
README.txt Dosyayı Görüntüle

@@ -1,7 +1,7 @@
Hi, Hi,


Welcome to the beginnings of Tufte LaTeX package to help you Welcome to the beginnings of Tufte LaTeX package to help you
produce Tufte style handouts, reports, and notes.
produce Tufte-style handouts, reports, and notes.


== Quick Start == Quick Start


@@ -33,7 +33,6 @@ or search the news:comp.text.tex group via,


The following packages are required: The following packages are required:


* caption
* chngpage or changepage * chngpage or changepage
* fancyhdr * fancyhdr
* fontenc * fontenc
@@ -46,6 +45,7 @@ The following packages are required:
* ragged2e * ragged2e
* setspace * setspace
* textcase * textcase
* textcomp
* titlesec * titlesec
* titletoc * titletoc
* xcolor * xcolor


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


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

@@ -1,8 +1,5 @@
\documentclass{tufte-book} \documentclass{tufte-book}


%\usepackage{trace}
%\traceon

%% %%
% Book metadata % Book metadata
\title{A Tufte-Style Book\thanks{Thanks to Edward R.~Tufte for his inspiration.}} \title{A Tufte-Style Book\thanks{Thanks to Edward R.~Tufte for his inspiration.}}
@@ -404,19 +401,19 @@ The following characteristics define the various environments:


\chapter{On the Use of the \texttt{tufte-book} Document Class} \chapter{On the Use of the \texttt{tufte-book} Document Class}
\label{ch:tufte-book} \label{ch:tufte-book}

The \texttt{tufte-book} document class is modeled primarily on \BE, since The \texttt{tufte-book} document class is modeled primarily on \BE, since
it's the most recent of Tufte's books and the design is (presumably) more it's the most recent of Tufte's books and the design is (presumably) more
refined. refined.


This choice of book design has a few important implications:
\begin{inparaenum}
\item there are no parts---the highest heading level is the chapter;
\item the use of a sans serif font for many design elements (especially the
title page and epigraphs); and
\item \emph{something else---yyy}.
\end{inparaenum}
%This choice of book design has a few important implications:
%\begin{inparaenum}
%\item there are no parts---the highest heading level is the chapter;
%\item the use of a sans serif font for many design elements (especially the
%title page and epigraphs); and
%\item \emph{something else---yyy}.
%\end{inparaenum}


%\lipsum[1-25]




%% %%


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


+ 9
- 8
sample-handout.tex Dosyayı Görüntüle

@@ -73,7 +73,7 @@ Typographic Style},\cite{Bringhurst2005} you should ``use as many levels of
headings as you need: no more, and no fewer.'' headings as you need: no more, and no fewer.''


The Tufte-\LaTeX\ classes will emit an error if you try to use The Tufte-\LaTeX\ classes will emit an error if you try to use
\Verb|\subsubsection| and smaller headings.
\linebreak\Verb|\subsubsection| and smaller headings.


%\medskip %\medskip
%\begin{fullwidth} %\begin{fullwidth}
@@ -173,6 +173,7 @@ Full page--width figures and tables may be placed in \docenv{figure*} or
\docenv{table*} environments. To place figures or tables in the margin, \docenv{table*} environments. To place figures or tables in the margin,
use the \docenv{marginfigure} or \docenv{margintable} environments as follows use the \docenv{marginfigure} or \docenv{margintable} environments as follows
(see figure~\ref{fig:marginfig}): (see figure~\ref{fig:marginfig}):

\begin{marginfigure}% \begin{marginfigure}%
\includegraphics[width=\linewidth]{helix} \includegraphics[width=\linewidth]{helix}
\caption{This is a margin figure. The helix is defined by \caption{This is a margin figure. The helix is defined by
@@ -198,20 +199,20 @@ The \docenv{marginfigure} and \docenv{margintable} environments accept an option
\doccmd{end\{margintable\}}\\ \doccmd{end\{margintable\}}\\
\end{docspec} \end{docspec}



Figure~\ref{fig:fullfig} is an example of the \Verb|figure*| Figure~\ref{fig:fullfig} is an example of the \Verb|figure*|
environment and figure~\ref{fig:textfig} is an example of the normal environment and figure~\ref{fig:textfig} is an example of the normal
\Verb|figure| environment. \Verb|figure| environment.
\begin{figure*}
\includegraphics[width=\linewidth]{sine.pdf}

\begin{figure*}[h]
\includegraphics[width=\linewidth]{sine.pdf}%
\caption{This graph shows $y = \sin x$ from about $x = [-10, 10]$. \caption{This graph shows $y = \sin x$ from about $x = [-10, 10]$.
\emph{Notice that this figure takes up the full page width.}}
\label{fig:fullfig}
%\zsavepos{pos:fullfig}
\emph{Notice that this figure takes up the full page width.}}%
\label{fig:fullfig}%
\end{figure*} \end{figure*}


\begin{figure} \begin{figure}
\includegraphics{hilbertcurves.pdf} \includegraphics{hilbertcurves.pdf}
% \checkparity This is an \pageparity\ page.%
\caption{Hilbert curves of various degrees $n$. \caption{Hilbert curves of various degrees $n$.
\emph{Notice that this figure only takes up the main textblock width.}} \emph{Notice that this figure only takes up the main textblock width.}}
\label{fig:textfig} \label{fig:textfig}
@@ -356,13 +357,13 @@ classes rely upon. Packages marked with an asterisk are optional.
\item natbib \emph{and} bibentry \item natbib \emph{and} bibentry
\item optparams \item optparams
\item placeins \item placeins
\item caption
\item mathpazo* \item mathpazo*
\item helvet* \item helvet*
\item fontenc \item fontenc
\item beramono* \item beramono*
\item fancyhdr \item fancyhdr
\item xcolor \item xcolor
\item textcomp
\item titlesec \item titlesec
\item titletoc \item titletoc
\end{itemize} \end{itemize}


+ 61
- 16
tufte-common.sty Dosyayı Görüntüle

@@ -284,13 +284,34 @@


\newboolean{@tufte@changepage} \newboolean{@tufte@changepage}
\IfFileExists{changepage.sty}{% \IfFileExists{changepage.sty}{%
\PackageInfo{\@tufte@pkgname}{Found changepage.sty}
\RequirePackage[strict]{changepage} \RequirePackage[strict]{changepage}
\setboolean{@tufte@changepage}{true} \setboolean{@tufte@changepage}{true}
}{% }{%
\PackageInfo{\@tufte@pkgname}{Found chngpage.sty}
\RequirePackage[strict]{chngpage} \RequirePackage[strict]{chngpage}
\setboolean{@tufte@changepage}{false} \setboolean{@tufte@changepage}{false}
} }


% Write our own aliases for the \checkoddpage and \ifoddpage or \ifcpoddpage commands
\newboolean{@tufte@odd@page}
\setboolean{@tufte@odd@page}{true}
\newcommand*{\@tufte@checkoddpage}{%
\checkoddpage%
\ifthenelse{\boolean{@tufte@changepage}}{%
\ifoddpage%
\setboolean{@tufte@odd@page}{true}%
\else%
\setboolean{@tufte@odd@page}{false}%
\fi%
}{%
\ifcpoddpage%
\setboolean{@tufte@odd@page}{true}%
\else%
\setboolean{@tufte@odd@page}{false}%
\fi
}%
}




% Compute lengths used for full-width displays % Compute lengths used for full-width displays
@@ -868,20 +889,29 @@
\end{lrbox}% \end{lrbox}%
% now typeset the stored boxes % now typeset the stored boxes
\begin{fullwidth}% \begin{fullwidth}%
\begin{minipage}[\floatalignment]{\paperwidth}%
\usebox{\@tufte@figure@box}%
\hspace{\marginparsep}%
\smash{\usebox{\@tufte@caption@box}}%
\begin{minipage}[\floatalignment]{\linewidth}%
\@tufte@checkoddpage%
\ifthenelse{\NOT\boolean{@tufte@symmetric}\OR\boolean{@tufte@odd@page}}{%
% asymmetric or page is odd, so caption is on the right
\usebox{\@tufte@figure@box}%
\hspace{\marginparsep}%
\smash{\usebox{\@tufte@caption@box}}%
}{%
% symmetric pages and page is even, so caption is on the left
\strut\smash{\usebox{\@tufte@caption@box}}%
\hspace{\marginparsep}%
\usebox{\@tufte@figure@box}%
}%
\end{minipage}% \end{minipage}%
\end{fullwidth}% \end{fullwidth}%
\@tufte@orig@endfloat% \@tufte@orig@endfloat%
% reset commands and temp boxes and captions % reset commands and temp boxes and captions
\let\caption\@tufte@orig@caption% \let\caption\@tufte@orig@caption%
\let\label\@tufte@orig@label% \let\label\@tufte@orig@label%
\begin{lrbox}{\@tufte@figure@box}\hbox{}\end{lrbox}
\begin{lrbox}{\@tufte@caption@box}\hbox{}\end{lrbox}
\gdef\@tufte@stored@shortcaption{}
\gdef\@tufte@stored@caption{}
\begin{lrbox}{\@tufte@figure@box}\hbox{}\end{lrbox}%
\begin{lrbox}{\@tufte@caption@box}\hbox{}\end{lrbox}%
\gdef\@tufte@stored@shortcaption{}%
\gdef\@tufte@stored@caption{}%
} }


%% %%
@@ -914,7 +944,7 @@
\renewcommand{\label}[1]{\@tufte@label{##1}}% \renewcommand{\label}[1]{\@tufte@label{##1}}%
\@tufte@orig@float{#2}[#1]% \@tufte@orig@float{#2}[#1]%
\begin{lrbox}{\@tufte@figure@box}% \begin{lrbox}{\@tufte@figure@box}%
\begin{minipage}[\floatalignment]{\linewidth}\hbox{}%
\begin{minipage}[\floatalignment]{\textwidth}\hbox{}%
\begin{fullwidth} \begin{fullwidth}
}% }%
{% end figure* {% end figure*
@@ -932,17 +962,29 @@
\end{minipage}% \end{minipage}%
\end{lrbox}% \end{lrbox}%
% now typeset the stored boxes % now typeset the stored boxes
\@tufte@checkoddpage%
\begin{fullwidth}% \begin{fullwidth}%
\begin{minipage}[\floatalignment]{\paperwidth}%
\hbox{}%
\begin{minipage}[\floatalignment]{\linewidth}%
\ifthenelse{\equal{\floatalignment}{b}} \ifthenelse{\equal{\floatalignment}{b}}
{% place caption above figure {% place caption above figure
\hspace{\@tufte@caption@fill}\smash{\usebox{\@tufte@caption@box}}\\
\usebox{\@tufte@figure@box}%
\ifthenelse{\NOT\boolean{@tufte@symmetric}\OR\boolean{@tufte@odd@page}}
{% caption on the right
\hfill\smash{\usebox{\@tufte@caption@box}}%
\par\usebox{\@tufte@figure@box}%
}{% caption on the left
\smash{\usebox{\@tufte@caption@box}}\hfill\null%
\par\hspace{\@tufte@overhang}\usebox{\@tufte@figure@box}%
}%
} }
{% place caption below figure {% place caption below figure
\usebox{\@tufte@figure@box}\\
\hspace{\@tufte@caption@fill}\smash{\usebox{\@tufte@caption@box}}%
\ifthenelse{\NOT\boolean{@tufte@symmetric}\OR\boolean{@tufte@odd@page}}
{% caption on the right
\usebox{\@tufte@figure@box}\par%
\hspace{\@tufte@caption@fill}\smash{\usebox{\@tufte@caption@box}}%
}{% caption on the left
\null\hspace{\@tufte@overhang}\usebox{\@tufte@figure@box}\par%
\smash{\usebox{\@tufte@caption@box}}\hfill%
}%
} }
\end{minipage}% \end{minipage}%
\end{fullwidth}% \end{fullwidth}%
@@ -981,7 +1023,10 @@
{\ifthenelse{\boolean{@tufte@changepage}}{\begin{adjustwidth*}{}{-\@tufte@overhang}}{\begin{adjustwidth}[]{}{-\@tufte@overhang}}} {\ifthenelse{\boolean{@tufte@changepage}}{\begin{adjustwidth*}{}{-\@tufte@overhang}}{\begin{adjustwidth}[]{}{-\@tufte@overhang}}}
{\begin{adjustwidth}{}{-\@tufte@overhang}}% {\begin{adjustwidth}{}{-\@tufte@overhang}}%
} }
{\end{adjustwidth}}
{\ifthenelse{\boolean{@tufte@symmetric}}
{\ifthenelse{\boolean{@tufte@changepage}}{\end{adjustwidth*}}{\end{adjustwidth}}}
{\end{adjustwidth}}
}


%% %%
% Format the captions in a style similar to the sidenotes % Format the captions in a style similar to the sidenotes


Yükleniyor…
İptal
Kaydet