Browse Source

* Added more formatting for table of contents, list of figures, and list of tables.

* Should no longer have to adjust the tocdepth for entries to appear in LOF and LOT.
* Added LOF and LOT to the sample book (primarily for testing purposes).


git-svn-id: https://tufte-latex.googlecode.com/svn/trunk@108 516e2f36-ce3a-0410-bea4-1d4a03f5df72
master
Kevin M. Godby 16 years ago
parent
commit
385ef1a8dc
4 changed files with 80 additions and 17 deletions
  1. BIN
      sample-book.pdf
  2. +5
    -1
      sample-book.tex
  3. BIN
      sample-handout.pdf
  4. +75
    -16
      tufte-common.sty

BIN
sample-book.pdf View File


+ 5
- 1
sample-book.tex View File

@@ -1,6 +1,6 @@
\documentclass{tufte-book}

%\hypersetup{colorlinks}% uncomment this line if you prefer colored hyperlinks (e.g., for onscreen viewing)
\hypersetup{colorlinks}% uncomment this line if you prefer colored hyperlinks (e.g., for onscreen viewing)

%%
% Book metadata
@@ -187,6 +187,10 @@ under the License.\index{license}
% r.5 contents
\tableofcontents

\listoffigures

\listoftables

% r.7 dedication
\cleardoublepage
~\vfill


BIN
sample-handout.pdf View File


+ 75
- 16
tufte-common.sty View File

@@ -1330,25 +1330,84 @@

% Formatting for main TOC (printed in front matter)
% {section} [left] {above} {before w/label} {before w/o label} {filler + page} [after]
\ifthenelse{\boolean{@tufte@toc}}
{\titlecontents{chapter}%
\ifthenelse{\boolean{@tufte@toc}}{%
\titlecontents{part}% FIXME
[0em] % distance from left margin
{\begin{fullwidth}\fontsize{13pt}{18pt}\selectfont} % above (global formatting of entry)
{\contentslabel{2em}\rmfamily\itshape} % before w/label (label = ``Chapter 1'')
{\rmfamily\itshape} % before w/o label
{\rmfamily\qquad\thecontentspage} % filler + page (leaders and page num)
[\vspace{1.5\baselineskip}\end{fullwidth}] % after
}
{}
{\vspace{1.5\baselineskip}\begin{fullwidth}\LARGE\rmfamily\itshape} % above (global formatting of entry)
{\contentslabel{2em}} % before w/label (label = ``II'')
{} % before w/o label
{\rmfamily\upshape\qquad\thecontentspage} % filler + page (leaders and page num)
[\end{fullwidth}] % after
\titlecontents{chapter}%
[0em] % distance from left margin
{\vspace{1.5\baselineskip}\begin{fullwidth}\LARGE\rmfamily\itshape} % above (global formatting of entry)
{\hspace*{0em}\contentslabel{2em}} % before w/label (label = ``2'')
{\hspace*{0em}} % before w/o label
{\rmfamily\upshape\qquad\thecontentspage} % filler + page (leaders and page num)
[\end{fullwidth}] % after
\titlecontents{section}% FIXME
[0em] % distance from left margin
{\vspace{0\baselineskip}\begin{fullwidth}\Large\rmfamily\itshape} % above (global formatting of entry)
{\hspace*{2em}\contentslabel{2em}} % before w/label (label = ``2.6'')
{\hspace*{2em}} % before w/o label
{\rmfamily\upshape\qquad\thecontentspage} % filler + page (leaders and page num)
[\end{fullwidth}] % after
\titlecontents{subsection}% FIXME
[0em] % distance from left margin
{\vspace{0\baselineskip}\begin{fullwidth}\large\rmfamily\itshape} % above (global formatting of entry)
{\hspace*{4em}\contentslabel{4em}} % before w/label (label = ``2.6.1'')
{\hspace*{4em}} % before w/o label
{\rmfamily\upshape\qquad\thecontentspage} % filler + page (leaders and page num)
[\end{fullwidth}] % after
\titlecontents{paragraph}% FIXME
[0em] % distance from left margin
{\vspace{0\baselineskip}\begin{fullwidth}\normalsize\rmfamily\itshape} % above (global formatting of entry)
{\hspace*{6em}\contentslabel{2em}} % before w/label (label = ``2.6.0.0.1'')
{\hspace*{6em}} % before w/o label
{\rmfamily\upshape\qquad\thecontentspage} % filler + page (leaders and page num)
[\end{fullwidth}] % after
}{}

%\titlecontents{chapter}%
% [0em]% distance from left margin
% {\fontsize{12pt}{18pt}\selectfont}% above (global formatting of entry)
% {\textit}% before w/ label (label = ``Chapter 1'')
% {\textit}% before w/o label
% {\qquad\thecontentspage}% filler and page (leaders and page num)
% [\vspace{1.5\baselineskip}]% after
%%
% Format lists of figures/tables

\renewcommand\listoffigures{%
\ifthenelse{\equal{\@tufte@class}{book}}%
{\chapter*{\listfigurename}}%
{\section*{\listfigurename}}%
% \begin{fullwidth}%
\@starttoc{lof}%
% \end{fullwidth}%
}

\renewcommand\listoftables{%
\ifthenelse{\equal{\@tufte@class}{book}}%
{\chapter*{\listtablename}}%
{\section*{\listtablename}}%
% \begin{fullwidth}%
\@starttoc{lot}%
% \end{fullwidth}%
}

\newcommand{\@tufte@lof@line}[2]{%
% #1 is the figure/table number and its caption text
% #2 is the page number on which the figure/table appears
\leftskip 0.0em
\rightskip 0em
\parfillskip 0em
\parindent 0.0em
\@afterindenttrue
\interlinepenalty\@M
\leavevmode
\@tempdima 2.0em
\advance\leftskip\@tempdima
\null\nobreak\hskip -\leftskip
{#1}\nobreak\qquad\nobreak#2%
\par%
}

\renewcommand*\l@figure{\@tufte@lof@line}
\let\l@table\l@figure


%%


Loading…
Cancel
Save