summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/thumbs
diff options
context:
space:
mode:
authorManuel Pégourié-Gonnard <mpg@elzevir.fr>2011-08-02 19:24:13 +0000
committerManuel Pégourié-Gonnard <mpg@elzevir.fr>2011-08-02 19:24:13 +0000
commitd20740d22f94c2e08022bc2661f556f780d69b6e (patch)
tree434eef98ac2599c46d82ca9eaa2ca3470ee4b1fc /Master/texmf-dist/tex/latex/thumbs
parentd95bf37641f0782c7c929b8977be9f84d45b0b3f (diff)
thumbs 2011/06/24, v1.0g
git-svn-id: svn://tug.org/texlive/trunk@23344 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/thumbs')
-rw-r--r--Master/texmf-dist/tex/latex/thumbs/thumbs.sty402
1 files changed, 296 insertions, 106 deletions
diff --git a/Master/texmf-dist/tex/latex/thumbs/thumbs.sty b/Master/texmf-dist/tex/latex/thumbs/thumbs.sty
index 52f8825b70d..04ab1365344 100644
--- a/Master/texmf-dist/tex/latex/thumbs/thumbs.sty
+++ b/Master/texmf-dist/tex/latex/thumbs/thumbs.sty
@@ -9,7 +9,7 @@
%% This is a generated file.
%%
%% Project: thumbs
-%% Version: 2011/05/20 v1.0c
+%% Version: 2011/06/24 v1.0g
%%
%% Copyright (C) 2010, 2011 by
%% H.-Martin M"unch <Martin dot Muench at Uni-Bonn dot de>
@@ -38,8 +38,8 @@
%% thumbs.sty, thumbs.pdf, thumbs.ins, thumbs.drv,
%% thumbs-example.tex.
%%
-\NeedsTeXFormat{LaTeX2e}[1994/06/01]% or later
-\ProvidesPackage{thumbs}[2011/05/20 v1.0c
+\NeedsTeXFormat{LaTeX2e}[2009/09/24]
+\ProvidesPackage{thumbs}[2011/06/24 v1.0g
Thumb marks and overwiew page(s) (HMM)]
%% This package allows to create a customizable thumb index,
@@ -62,17 +62,17 @@
}
\RequirePackage{kvoptions}[2010/12/23]% v3.10
-\RequirePackage{atbegshi}[2011/01/30]% v1.15
-\RequirePackage{xcolor}[2007/01/21]% v2.11
-\RequirePackage{picture}[2009/10/11]% v1.3
-\RequirePackage{alphalph}[2010/04/18]% v2.3
-\RequirePackage{pagesLTS}[2011/03/17]% v1.1o
+\RequirePackage{atbegshi}[2011/01/30]% v1.15
+\RequirePackage{xcolor}[2007/01/21]% v2.11
+\RequirePackage{picture}[2009/10/11]% v1.3
+\RequirePackage{alphalph}[2010/04/18]% v2.3
+\RequirePackage{pagesLTS}[2011/03/17]% v1.1o
\RequirePackage{rerunfilecheck}[2011/04/15]% v1.7
\RequirePackage{infwarerr}[2010/04/08]% v1.3
\RequirePackage{atveryend}[2011/04/23]% v1.7
-%% thumbs may work with earlier versions of those packages,
-%% but this was not tested. Please consider updating your packages
-%% to the most recent version (if they are not already the most
+%% thumbs may work with earlier versions of LaTeX2e and those packages,
+%% but this was not tested. Please consider updating your LaTeX contribution
+%% and packages to the most recent version (if they are not already the most
%% recent version).
\SetupKeyvalOptions{family=thumbs,prefix=thumbs@}
@@ -85,10 +85,45 @@
\DeclareStringOption{distance}[2mm]
\DeclareStringOption{topthumbmargin}[auto]
\DeclareStringOption{bottomthumbmargin}[auto]
+\DeclareBoolOption[true]{ignorehoffset}
+\DeclareBoolOption[true]{ignorevoffset}
\DeclareBoolOption[true]{verbose}
+\DeclareComplementaryOption{silent}{verbose}
+\DeclareBoolOption{draft}
+\DeclareComplementaryOption{final}{draft}
\ProcessKeyvalOptions*
+\ifthumbs@ignorehoffset
+ \PackageWarningNoLine{thumbs}{%
+ Option ignorehoffset NOT =false:\MessageBreak%
+ hoffset will be ignored.\MessageBreak%
+ To make thumbs regard hoffset use option\MessageBreak%
+ ignorehoffset=false}
+ \gdef\th@bmshoffset{0pt}
+\else
+ \PackageWarningNoLine{thumbs}{%
+ Option ignorehoffset=false:\MessageBreak%
+ hoffset will be regarded.\MessageBreak%
+ This might move the thumb marks away from the paper edge}
+ \gdef\th@bmshoffset{\hoffset}
+\fi
+
+\ifthumbs@ignorevoffset
+ \PackageWarningNoLine{thumbs}{%
+ Option ignorevoffset NOT =false:\MessageBreak%
+ voffset will be ignored.\MessageBreak%
+ To make thumbs regard voffset use option\MessageBreak%
+ ignorevoffset=false}
+ \gdef\th@bmsvoffset{-\voffset}
+\else
+ \PackageWarningNoLine{thumbs}{%
+ Option ignorevoffset=false:\MessageBreak%
+ voffset will be regarded.\MessageBreak%
+ This might move the thumb mark outside of the printable area}
+ \gdef\th@bmsvoffset{\voffset}
+\fi
+
\pagecolor{\thumbs@pagecolor}
\ifx\thumbs@linefill\empty%
@@ -133,14 +168,11 @@
\setlength{\th@mbsdistance}{\thumbs@distance}
\fi
-\ifthumbs@verbose
- \newdimen\thumbsinfodimen
- \newcommand{\thumbs@info}[1]{%
- \setlength{\thumbsinfodimen}{#1}%
- }%
+\ifthumbs@verbose% \relax
\else
- \PackageWarningNoLine{thumbs}{Option verbose=false found:\MessageBreak%
- You will lose some information.}
+ \PackageWarningNoLine{thumbs}{%
+ Option verbose=false (or silent=true) found:\MessageBreak%
+ You will lose some information}
\fi
\newbox\ThumbsBox
@@ -175,6 +207,12 @@
\gdef\th@mbs@toc@level{}
\gdef\th@mbs@toc@text{}
+\gdef\th@mbmaxwidth{0pt}
+
+\gdef\th@mb@titlelabel{}
+
+\gdef\th@mbstable{0}% number of thumb marks overview tables
+
\if@filesw% \relax
\else
\PackageWarningNoLine{thumbs}{No auxiliary files allowed!\MessageBreak%
@@ -202,6 +240,17 @@
}
\AtBeginDocument{%
+ \ifthumbs@ignorehoffset
+ \gdef\th@bmshoffset{0pt}
+ \else
+ \gdef\th@bmshoffset{\hoffset}
+ \fi
+ \ifthumbs@ignorevoffset
+ \gdef\th@bmsvoffset{-\voffset}
+ \else
+ \gdef\th@bmsvoffset{\voffset}
+ \fi
+ \global\edef\th@mbpaperwidth{\the\paperwidth}
\setlength{\th@mbposyA}{1pt}
\ifdim \thumbs@minheight < \th@mbposyA% too small
\setlength{\thumbs@minheight}{1pt}
@@ -242,8 +291,8 @@
\fi
\else
\ifthumbs@verbose
- \thumbs@info{\th@mbheighty}
- \PackageInfo{thumbs}{Now setting thumbs' height to \the\thumbsinfodimen .}
+ \edef\thumbsinfo{\the\th@mbheighty}
+ \PackageInfo{thumbs}{Now setting thumbs' height to \thumbsinfo .}
\fi
\setlength{\th@mbheighty}{\thumbs@height}
\fi
@@ -252,36 +301,68 @@
\ifthumbs@verbose
\message{^^J}
\@PackageInfoNoLine{thumbs}{************** THUMB dimensions **************}
- \thumbs@info{\th@mbheighty}
- \@PackageInfoNoLine{thumbs}{The height of the thumb marks is \the\thumbsinfodimen}
+ \edef\thumbsinfo{\the\th@mbheighty}
+ \@PackageInfoNoLine{thumbs}{The height of the thumb marks is \thumbsinfo}
\fi
- \setlength{\th@mbwidthx}{\paperwidth}
- \advance\th@mbwidthx-\textwidth
- \divide\th@mbwidthx4
- \setlength{\th@mbposyA}{0sp}
- \ifx\thumbs@width\empty%
+ \ifthumbs@draft
+ \setlength{\th@mbwidthx}{2pt}
\else
- \def\th@mbstest{auto}
- \ifx\thumbs@width\th@mbstest%
+ \setlength{\th@mbwidthx}{\paperwidth}
+ \advance\th@mbwidthx-\textwidth
+ \divide\th@mbwidthx4
+ \setlength{\th@mbposyA}{0sp}
+ \ifx\thumbs@width\empty%
\else
- \ifdim \thumbs@width > \th@mbposyA% OK
- \setlength{\th@mbwidthx}{\thumbs@width}
+ \def\th@mbstest{auto}
+ \ifx\thumbs@width\th@mbstest%
\else
- \PackageError{thumbs}{Thumbs not wide enought}{%
- Option width has value '\thumbs@width'.\MessageBreak%
- This is not a valid dimension larger than zero.\MessageBreak%
- Width will be set automatically.\MessageBreak%
- }
+ \def\th@mbstest{autoauto}
+ \ifx\thumbs@width\th@mbstest%
+ \@ifundefined{th@mbmaxwidtha}{%
+ \if@filesw%
+ \gdef\th@mbmaxwidtha{0pt}
+ \setlength{\th@mbwidthx}{\th@mbmaxwidtha}
+ \AtVeryVeryEnd{
+ \PackageWarningNoLine{thumbs}{%
+ \string\th@mbmaxwidtha\space undefined.\MessageBreak%
+ Rerun to get the thumb marks width right%
+ }
+ }
+ \else
+ \PackageError{thumbs}{%
+ You cannot use option autoauto without \jobname.aux file.%
+ }
+ \fi
+ }{%\else
+ \setlength{\th@mbwidthx}{\th@mbmaxwidtha}
+ }%\fi
+ \else
+ \ifdim \thumbs@width > \th@mbposyA% OK
+ \setlength{\th@mbwidthx}{\thumbs@width}
+ \else
+ \PackageError{thumbs}{Thumbs not wide enought}{%
+ Option width has value '\thumbs@width'.\MessageBreak%
+ This is not a valid dimension larger than zero.\MessageBreak%
+ Width will be set automatically.\MessageBreak%
+ }
+ \fi
+ \fi
\fi
\fi
\fi
\ifthumbs@verbose
- \thumbs@info{\th@mbwidthx}
- \@PackageInfoNoLine{thumbs}{The width of the thumb marks is \the\thumbsinfodimen}
+ \edef\thumbsinfo{\the\th@mbwidthx}
+ \@PackageInfoNoLine{thumbs}{The width of the thumb marks is \thumbsinfo}
+ \ifthumbs@draft
+ \@PackageInfoNoLine{thumbs}{because thumbs package is in draft mode}
+ \fi
\fi
% Thumb position x \th@mbposx
\setlength{\th@mbposx}{\paperwidth}
\advance\th@mbposx-\th@mbwidthx
+ \ifthumbs@ignorehoffset
+ \advance\th@mbposx-\hoffset
+ \fi
\advance\th@mbposx+1pt
% Thumb position y \th@mbposy
\ifx\thumbs@topthumbmargin\empty%
@@ -290,9 +371,9 @@
\def\th@mbstest{auto}
\ifx\thumbs@topthumbmargin\th@mbstest%
\setlength{\th@mbposy}{1in}
- \advance\th@mbposy+\voffset
+ \advance\th@mbposy+\th@bmsvoffset
\advance\th@mbposy+\topmargin
- \advance\th@mbposy-\thumbs@distance
+ \advance\th@mbposy-\th@mbsdistance
\advance\th@mbposy+\th@mbheighty
\else
\setlength{\th@mbposyA}{-1pt}
@@ -305,16 +386,16 @@
\gdef\thumbs@topthumbmargin{-1pt}
\fi
\setlength{\th@mbposy}{\thumbs@topthumbmargin}
- \advance\th@mbposy-\thumbs@distance
+ \advance\th@mbposy-\th@mbsdistance
\advance\th@mbposy+\th@mbheighty
\fi
\setlength{\th@mbposytop}{\th@mbposy}
\ifthumbs@verbose%
\setlength{\@tempdimc}{\th@mbposytop}
\advance\@tempdimc-\th@mbheighty
- \advance\@tempdimc+\thumbs@distance
- \thumbs@info{\@tempdimc}
- \@PackageInfoNoLine{thumbs}{The top thumb margin is \the\thumbsinfodimen}
+ \advance\@tempdimc+\th@mbsdistance
+ \edef\thumbsinfo{\the\@tempdimc}
+ \@PackageInfoNoLine{thumbs}{The top thumb margin is \thumbsinfo}
\fi
% Max. thumb position y \th@mbposybottom
\ifx\thumbs@bottomthumbmargin\empty%
@@ -323,30 +404,32 @@
\def\th@mbstest{auto}
\ifx\thumbs@bottomthumbmargin\th@mbstest%
\setlength{\th@mbposybottom}{1in}
- \advance\th@mbposybottom+\voffset
+ \ifthumbs@ignorevoffset% \relax
+ \else \advance\th@mbposybottom+\th@bmsvoffset
+ \fi
\advance\th@mbposybottom+\topmargin
- \advance\th@mbposybottom-\thumbs@distance
+ \advance\th@mbposybottom-\th@mbsdistance
\advance\th@mbposybottom+\th@mbheighty
\advance\th@mbposybottom+\headheight
\advance\th@mbposybottom+\headsep
\advance\th@mbposybottom+\textheight
\advance\th@mbposybottom+\footskip
- \advance\th@mbposybottom-\thumbs@distance
+ \advance\th@mbposybottom-\th@mbsdistance
\advance\th@mbposybottom-\th@mbheighty
\else
\setlength{\th@mbposyA}{\paperheight}
\advance\th@mbposyA-\thumbs@bottomthumbmargin
\advance\th@mbposyA-\th@mbposytop
- \advance\th@mbposyA-\thumbs@distance
+ \advance\th@mbposyA-\th@mbsdistance
\advance\th@mbposyA-\th@mbheighty
- \advance\th@mbposyA-\thumbs@distance
+ \advance\th@mbposyA-\th@mbsdistance
\ifdim \th@mbposyA > 0sp%ok
\else
\setlength{\th@mbposyA}{\paperheight}
\advance\th@mbposyA-\th@mbposytop
- \advance\th@mbposyA-\thumbs@distance
+ \advance\th@mbposyA-\th@mbsdistance
\advance\th@mbposyA-\th@mbheighty
- \advance\th@mbposyA-\thumbs@distance
+ \advance\th@mbposyA-\th@mbsdistance
\advance\th@mbposyA-1pt
\PackageWarning{thumbs}{Thumbs column ending too high.\MessageBreak%
Option bottomthumbmargin has value '\thumbs@bottomthumbmargin'.\MessageBreak%
@@ -369,8 +452,8 @@
\ifthumbs@verbose%
\setlength{\@tempdimc}{\paperheight}
\advance\@tempdimc-\th@mbposybottom
- \thumbs@info{\@tempdimc}
- \@PackageInfoNoLine{thumbs}{The bottom thumb margin is \the\thumbsinfodimen}
+ \edef\thumbsinfo{\the\@tempdimc}
+ \@PackageInfoNoLine{thumbs}{The bottom thumb margin is \thumbsinfo}
\@PackageInfoNoLine{thumbs}{**********************************************}
\message{^^J}
\fi
@@ -388,7 +471,7 @@
\else%
\advance\th@mbposy-\th@mbheighty%
\advance\th@mbposy-\th@mbsdistance%
- \addthumb{}{}{\thumbs@pagecolor}{\thumbs@pagecolor}%
+ \thumborigaddthumb{}{}{\thumbs@pagecolor}{\thumbs@pagecolor}%
\th@mb@dvance%
\fi%
}
@@ -431,7 +514,7 @@
Thumbs column full, starting another column.\MessageBreak%
}%
\setlength{\th@mbposy}{\th@mbposytop}%
- \advance\th@mbposy\thumbs@distance%
+ \advance\th@mbposy\th@mbsdistance%
\ifx\th@mbcolumn\pagesLTS@zero%
\global\edef\th@umbsperpagecount{\th@mbs}%
\gdef\th@mbcolumn{1}%
@@ -440,19 +523,32 @@
\setcounter{th@mbs@tmpA}{\th@mbs}%
\addtocounter{th@mbs@tmpA}{+1}%
\global\edef\th@mbs{\arabic{th@mbs@tmpA}}%
- {\let\label\@gobble%
- \let\index\@gobble%
- \let\glossary\@gobble%
- \gdef\th@mbtitle{#1}%
- \gdef\th@mbtext{#2}%
- \gdef\th@mbtextcolour{#3}%
- \gdef\th@mbbackgroundcolour{#4}%
- }
+ \gdef\th@mbtitle{#1}%
+ \gdef\th@mbtext{#2}%
+ \gdef\th@mbtextcolour{#3}%
+ \gdef\th@mbbackgroundcolour{#4}%
+ \edef\th@mbstmpwidth{\the\th@mbposyA}%
+ \settowidth{\th@mbposyA}{\th@mbtext\space}%
+ \ifdim\th@mbposyA>\th@mbmaxwidth%
+ \global\edef\th@mbmaxwidth{\the\th@mbposyA}%
+ \fi%
+ \ifdim\th@mbposyA>\th@mbwidthx%
+ \ifthumbs@draft% \relax
+ \else%
+ \edef\thumbsinfoa{\the\th@mbwidthx}
+ \edef\thumbsinfob{\the\th@mbposyA}
+ \PackageWarning{thumbs}{%
+ Thumb mark too small (width: \thumbsinfoa)\MessageBreak%
+ or its text too wide (width: \thumbsinfob)\MessageBreak%
+ }%
+ \fi%
+ \fi%
+ \setlength{\th@mbposyA}{\th@mbstmpwidth}%
\@ifundefined{Hy@Warning}{% hyperref not loaded
}{% hyperref loaded
\phantomsection%
- \label{thumbs.\th@mbs}%
}%
+ \label{thumbs.\th@mbs}%
\if@filesw%
\ifx\th@mb@titlelabel\empty%
\addtocontents{tmb}{\string\thumbcontents{#1}{#2}{#3}{#4}{\thepage}{thumbs.\th@mbs}{\th@mbcolumnnew}}%
@@ -544,7 +640,7 @@
\advance\th@mbwidthxtoc-1in%
\advance\th@mbwidthxtoc-\hoffset%
\advance\th@mbwidthxtoc-\oddsidemargin%
- \put(1in+\hoffset+\oddsidemargin,-\th@mbposy){%
+ \put(1in+\oddsidemargin,-\th@mbposy){%
\begin{picture}(0,0)%
\def\th@mbstest{rule}%
\ifx\thumbs@thumblink\th@mbstest%
@@ -558,11 +654,20 @@
\fi%
\end{picture}%
\ifx\th@mb@tmp@column\pagesLTS@zero%
+ \setlength{\th@mbwidthxtoc}{\paperwidth}%
+ \advance\th@mbwidthxtoc-1in%
+ \advance\th@mbwidthxtoc-\hoffset%
+ \advance\th@mbwidthxtoc-\oddsidemargin%
+ \advance\th@mbwidthxtoc-\th@mbwidthx%
+ \advance\th@mbwidthxtoc-20pt%
+ \ifdim\th@mbwidthxtoc>\textwidth%
+ \setlength{\th@mbwidthxtoc}{\textwidth}
+ \fi
\begin{picture}(0,0)(0,-0.5\th@mbheighty+384930sp)%
\bgroup%
\setlength{\parindent}{0pt}%
- \vbox% to \textwidth
- {\hsize=\textwidth {%
+ \vbox%
+ {\hsize=\th@mbwidthxtoc {%
\def\th@mbstest{none}
\ifx\thumbs@thumblink\th@mbstest%
{\color{\th@mb@tmp@textcolour}\noindent \th@mb@tmp@title%
@@ -627,10 +732,10 @@
}%
\egroup%
\end{picture}%
- \begin{picture}(0,0)(1in+\hoffset+\oddsidemargin-\th@mbxpos,-0.5\th@mbheighty+384930sp)%
+ \begin{picture}(0,0)(1in+\th@bmshoffset+\oddsidemargin-\th@mbxpos+20pt,-0.5\th@mbheighty+384930sp)%
\bgroup%
\setlength{\parindent}{0pt}%
- \makebox[\th@mbwidthx][r]{{\color{\th@mb@tmp@textcolour}\th@mb@tmp@text \space}}%
+ \makebox[\th@mbwidthx][r]{{\color{\th@mb@tmp@textcolour}\th@mb@tmp@text}}%
\egroup%
\end{picture}%
\fi%
@@ -654,23 +759,23 @@
\put(\th@mbxpos,-\th@mbposyA){%
\begin{picture}(0,0)%
{\color{#3}\rule{\th@mbwidthx}{\th@mbheighty}}%
- \end{picture}%
- \begin{picture}(0,0)(0,-0.5\th@mbheighty+384930sp)%
- \bgroup%
- \setlength{\parindent}{0pt}%
- \ifodd\c@CurrentPage%
- \if@twoside%
- \makebox[\th@mbwidthx][l]{{\color{#2}\hspace*{1pt}\space #1}}%
- \else%
- \makebox[\th@mbwidthx][r]{{\color{#2}#1\space}}%
- \fi%
- \else%
- \makebox[\th@mbwidthx][r]{{\color{#2}#1\space}}%
- \fi%
- \egroup%
- \end{picture}%
- }%
- }
+ \end{picture}%
+ \begin{picture}(0,0)(0,-0.5\th@mbheighty+384930sp)%
+ \bgroup%
+ \setlength{\parindent}{0pt}%
+ \ifodd\c@CurrentPage%
+ \if@twoside%
+ \makebox[\th@mbwidthx][l]{{\color{#2}\hspace*{1pt}\space #1}}%
+ \else%
+ \makebox[\th@mbwidthx][r]{{\color{#2}#1\space}}%
+ \fi%
+ \else%
+ \makebox[\th@mbwidthx][r]{{\color{#2}#1\space}}%
+ \fi%
+ \egroup%
+ \end{picture}%
+ }%
+ }
\AtBeginShipout{%
\ifx\th@mbcolumnnew\pagesLTS@zero% ok
@@ -688,10 +793,29 @@
\fi%
\setcounter{th@mbs@tmpA}{\value{CurrentPage}}%
\addtocounter{th@mbs@tmpA}{-1}% because CurrentPage is already the one of the next page
+ \edef\th@mbstmpwidth{\the\paperwidth}%
+ \ifdim\th@mbpaperwidth=\th@mbstmpwidth% OK
+ \else%
+ \PackageWarningNoLine{thumbs}{%
+ Paperwidth has changed. Thumb mark positions become now adapted%
+ }%
+ \setlength{\th@mbposx}{\paperwidth}%
+ \advance\th@mbposx-\th@mbwidthx%
+ \ifthumbs@ignorehoffset%
+ \advance\th@mbposx-\hoffset%
+ \fi%
+ \advance\th@mbposx+1pt%
+ \global\edef\th@mbpaperwidth{\the\paperwidth}%
+ \fi%
\def\th@mbxpos{\th@mbposx}%
\ifodd\c@th@mbs@tmpA% \relax
\else%
- \if@twoside \def\th@mbxpos{-1pt}% \else \relax
+ \if@twoside%
+ \ifthumbs@ignorehoffset%
+ \def\th@mbxpos{-1pt-\hoffset}%
+ \else%
+ \def\th@mbxpos{-1pt}%
+ \fi%
\fi%
\fi%
\AtBeginShipoutUpperLeft{%
@@ -743,11 +867,36 @@
\ifx\th@umbsperpagecount\pagesLTS@zero
\gdef\th@umbsperpagecount{\th@mbs}% \th@mbs was increased with each \addthumb
\fi
+ \ifdim\th@mbmaxwidth>\th@mbwidthx
+ \ifthumbs@draft% \relax
+ \else
+ \def\th@mbstest{autoauto}
+ \ifx\thumbs@width\th@mbstest%
+ \AtVeryVeryEnd{%
+ \PackageWarningNoLine{thumbs}{%
+ Rerun to get the thumb marks width right%
+ }
+ }
+ \else
+ \AtVeryVeryEnd{%
+ \edef\thumbsinfoa{\th@mbmaxwidth}
+ \edef\thumbsinfob{\the\th@mbwidthx}
+ \PackageWarningNoLine{thumbs}{%
+ Thumb mark too small or its text too wide:\MessageBreak%
+ The widest thumb mark text is \thumbsinfoa\space wide,\MessageBreak%
+ but the thumb marks are only \space\thumbsinfob\space wide.\MessageBreak%
+ Either shorten or scale down the text,\MessageBreak%
+ or increase the thumb mark width,\MessageBreak%
+ or use option width=autoauto%
+ }
+ }
+ \fi
+ \fi
+ \fi
\if@filesw
- \immediate\write\@auxout{\string
- \gdef\string\th@umbsperpage{\th@umbsperpagecount}}
- \immediate\write\@auxout{\string
- \gdef\string\th@mbsmax{\th@mbs}}
+ \immediate\write\@auxout{\string\gdef\string\th@mbmaxwidtha{\th@mbmaxwidth}}
+ \immediate\write\@auxout{\string\gdef\string\th@umbsperpage{\th@umbsperpagecount}}
+ \immediate\write\@auxout{\string\gdef\string\th@mbsmax{\th@mbs}}
\expandafter\newwrite\csname tf@tmb\endcsname
\RerunFileCheck{\jobname.tmb}{%
\immediate\closeout \csname tf@tmb\endcsname
@@ -806,26 +955,51 @@
}%
\fi%
\edef\th@mbprintingovertoc{\th@mbprinting}%
- \stopthumb%
- \markboth{\MakeUppercase #1 }{\MakeUppercase #1 }
- \setlength{\th@mbsposytocy}{\th@mbposy}
- \setlength{\th@mbposy}{\th@mbsposytocyy}
- \newcounter{th@mblinea}
- \setcounter{th@mblinea}{1}
- \newcounter{th@mblineb}
- \setcounter{th@mblineb}{\th@umbsperpage}
- \newcounter{FileLine}
- \setcounter{FileLine}{1}
- \newcounter{thumbsstop}
- \setcounter{thumbsstop}{1}
- \addtocounter{thumbsstop}{\th@mbsmax}
+ \ifnum \th@mbsmax > \pagesLTS@zero%
+ \if@twoside \cleardoublepage%
+ \else \clearpage%
+ \fi%
+ \stopthumb%
+ \markboth{\MakeUppercase #1 }{\MakeUppercase #1 }%
+ \fi%
+ \setlength{\th@mbsposytocy}{\th@mbposy}%
+ \setlength{\th@mbposy}{\th@mbsposytocyy}%
+ \ifx\th@mbstable\pagesLTS@zero%
+ \newcounter{th@mblinea}%
+ \newcounter{th@mblineb}%
+ \newcounter{FileLine}%
+ \newcounter{thumbsstop}%
+ \fi%
+ \setcounter{th@mblinea}{\th@mbstable}%
+ \addtocounter{th@mblinea}{+1}%
+ \global\edef\th@mbstable{\arabic{th@mblinea}}%
+ \setcounter{th@mblinea}{1}%
+ \setcounter{th@mblineb}{\th@umbsperpage}%
+ \setcounter{FileLine}{1}%
+ \setcounter{thumbsstop}{1}%
+ \addtocounter{thumbsstop}{\th@mbsmax}%
+ \let\thumbsoriglabel\label%
+ \let\thumbsorigindex\index%
+ \let\thumbsorigglossary\glossary%
+ \let\label\@gobble%
+ \let\index\@gobble%
+ \let\glossary\@gobble%
\@whilenum\value{FileLine}<\value{thumbsstop}\do%
{\if@twoside \cleardoublepage%
\else \clearpage%
\fi%
\ifnum\value{FileLine}=1%
- \@ifundefined{Hy@Warning}{}{\phantomsection \label{TableOfThumbs}}%
- \ifx\th@mbs@toc@level\empty%
+ \@ifundefined{Hy@Warning}{}{\phantomsection}%
+ \let\label\thumbsoriglabel%
+ \ifx\th@mbstable\pagesLTS@one%
+ \label{TableOfThumbs}%
+ \label{TableOfThumbs1}%
+ \else%
+ \overridelabel{TableOfThumbs}%
+ \label{TableOfThumbs\th@mbstable}%
+ \fi%
+ \let\label\@gobble%
+ \ifx\th@mbs@toc@level\empty%\relax
\else \addcontentsline{toc}{\th@mbs@toc@level}{\th@mbs@toc@text}%
\fi%
\fi%
@@ -841,6 +1015,9 @@
\ifx\th@mbprintingovertoc\pagesLTS@one%
\continuethumb%
\fi%
+ \let\label\thumbsoriglabel%
+ \let\index\thumbsorigindex%
+ \let\glossary\thumbsorigglossary%
}
\newcommand{\th@mbs@verview}{%
@@ -926,6 +1103,19 @@
}%
}
+\let\thumborigaddthumb\addthumb%
+
+\ifthumbs@draft
+ \setlength{\th@mbwidthx}{2pt}
+ \renewcommand{\addthumb}[4]{\thumborigaddthumb{#1}{#2}{black}{gray}}
+ \PackageWarningNoLine{thumbs}{thumbs package in draft mode:\MessageBreak%
+ Thumb mark width is set to 2pt,\MessageBreak%
+ thumb mark text colour to black, and\MessageBreak%
+ thumb mark background colour to gray.\MessageBreak%
+ Use package option final to get the original values.\MessageBreak%
+ }
+\fi
+
\endinput
%%