From a07c67c54f352666c40d9af55958e6da1a1b659b Mon Sep 17 00:00:00 2001
From: Karl Berry <karl@freefriends.org>
Date: Fri, 12 Aug 2011 22:55:56 +0000
Subject: thumbs (12aug11)

git-svn-id: svn://tug.org/texlive/trunk@23516 c570f23f-e606-0410-a88d-b1316a301751
---
 Master/texmf-dist/tex/latex/thumbs/thumbs.sty | 288 ++++++++++++++++++++------
 1 file changed, 223 insertions(+), 65 deletions(-)

(limited to 'Master/texmf-dist/tex/latex/thumbs/thumbs.sty')

diff --git a/Master/texmf-dist/tex/latex/thumbs/thumbs.sty b/Master/texmf-dist/tex/latex/thumbs/thumbs.sty
index 04ab1365344..23b0feb56dd 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/06/24 v1.0g
+%% Version: 2011/08/08 v1.0h
 %% 
 %% Copyright (C) 2010, 2011 by
 %%     H.-Martin M"unch <Martin dot Muench at Uni-Bonn dot de>
@@ -39,7 +39,7 @@
 %%    thumbs-example.tex.
 %% 
 \NeedsTeXFormat{LaTeX2e}[2009/09/24]
-\ProvidesPackage{thumbs}[2011/06/24 v1.0g
+\ProvidesPackage{thumbs}[2011/08/08 v1.0h
             Thumb marks and overwiew page(s) (HMM)]
 
 %% This package allows to create a customizable thumb index,
@@ -50,13 +50,14 @@
  Please see the sw(p)*.log or \jobname.log-file! *** ^^J}
 \PackageWarningNoLine{thumbs}{%
   When compiling with SWP 5.50 Build 2960\MessageBreak%
-  (\copyright\ MacKichan Software, Inc.),\MessageBreak%
+  (\copyright\space MacKichan Software, Inc.),\MessageBreak%
   these additional packages are needed:\MessageBreak%
   \string\usepackage[T1]{fontenc}\MessageBreak%
   \string\usepackage{amsfonts}\MessageBreak%
   \string\usepackage[math]{cellspace}\MessageBreak%
   \string\usepackage{xcolor}\MessageBreak%
   \string\pagecolor{white}\MessageBreak%
+ \string\newcommand{\string\QTO}[2]{\string#2}\MessageBreak%
   especially before hyperref and thumbs,\MessageBreak%
   but best right after the \string\documentclass!\MessageBreak%
  }
@@ -66,7 +67,8 @@
 \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{pageslts}[2011/08/08]%  v1.2a
+\RequirePackage{pagecolor}[2011/08/08]% v1.0c
 \RequirePackage{rerunfilecheck}[2011/04/15]% v1.7
 \RequirePackage{infwarerr}[2010/04/08]% v1.3
 \RequirePackage{atveryend}[2011/04/23]% v1.7
@@ -76,8 +78,7 @@
 %% recent version).
 
 \SetupKeyvalOptions{family=thumbs,prefix=thumbs@}
-\DeclareStringOption[white]{pagecolor}[white]% \thumbs@pagecolor
-\DeclareStringOption{linefill}[dots]
+\DeclareStringOption{linefill}[dots]% \thumbs@linefill
 \DeclareStringOption[rule]{thumblink}[rule]
 \DeclareStringOption[47pt]{minheight}[47pt]
 \DeclareStringOption{height}[auto]
@@ -91,9 +92,22 @@
 \DeclareComplementaryOption{silent}{verbose}
 \DeclareBoolOption{draft}
 \DeclareComplementaryOption{final}{draft}
+\DeclareBoolOption[false]{hidethumbs}
+\DeclareStringOption{pagecolor}
 
 \ProcessKeyvalOptions*
 
+\ifx\thumbs@pagecolor\empty%
+  \pagecolor{\thepagecolor}
+\else
+  \PackageWarningNoLine{thumbs}{Option pagecolor is obsolete.\MessageBreak%
+    Instead the pagecolor package is used.\MessageBreak%
+    Use \string\pagecolor{...}\space after \string\usepackage[...]{thumbs}\space and\MessageBreak%
+    before \string\begin{document}\space to define a background colour\MessageBreak%
+    of the pages}
+  \pagecolor{\thumbs@pagecolor}
+\fi
+
 \ifthumbs@ignorehoffset
   \PackageWarningNoLine{thumbs}{%
     Option ignorehoffset NOT =false:\MessageBreak%
@@ -124,8 +138,6 @@
   \gdef\th@bmsvoffset{\voffset}
 \fi
 
-\pagecolor{\thumbs@pagecolor}
-
 \ifx\thumbs@linefill\empty%
   \gdef\th@mbs@linefill{\hspace*{\fill}}
 \else
@@ -187,13 +199,13 @@
 
 \gdef\th@mbtitle{}
 \gdef\th@mbtext{}
-\gdef\th@mbtextcolour{\thumbs@pagecolor}
-\gdef\th@mbbackgroundcolour{\thumbs@pagecolor}
+\gdef\th@mbtextcolour{\thepagecolor}
+\gdef\th@mbbackgroundcolour{\thepagecolor}
 \gdef\th@mbcolumn{0}
 
 \gdef\th@mbtextA{}
-\gdef\th@mbtextcolourA{\thumbs@pagecolor}
-\gdef\th@mbbackgroundcolourA{\thumbs@pagecolor}
+\gdef\th@mbtextcolourA{\thepagecolor}
+\gdef\th@mbbackgroundcolourA{\thepagecolor}
 
 \gdef\th@mbprinting{1}
 \gdef\th@mbtoprint{0}
@@ -202,8 +214,6 @@
 
 \gdef\th@mbcolumnnew{0}
 
-\gdef\thumb@two{2}% There is no \pagesLTS@two (yet).
-
 \gdef\th@mbs@toc@level{}
 \gdef\th@mbs@toc@text{}
 
@@ -250,7 +260,7 @@
   \else
     \gdef\th@bmsvoffset{\voffset}
   \fi
-  \global\edef\th@mbpaperwidth{\the\paperwidth}
+  \xdef\th@mbpaperwidth{\the\paperwidth}
   \setlength{\th@mbposyA}{1pt}
   \ifdim \thumbs@minheight < \th@mbposyA% too small
     \setlength{\thumbs@minheight}{1pt}
@@ -435,7 +445,7 @@
         Option bottomthumbmargin has value '\thumbs@bottomthumbmargin'.\MessageBreak%
         bottomthumbmargin will be set to '\the\th@mbposyA'.\MessageBreak%
        }
-      \global\edef\thumbs@bottomthumbmargin{\the\th@mbposyA}
+      \xdef\thumbs@bottomthumbmargin{\the\th@mbposyA}
     \fi
     \setlength{\th@mbposyA}{\thumbs@bottomthumbmargin}
     \setlength{\@tempdimc}{-1pt}
@@ -471,7 +481,7 @@
   \else%
     \advance\th@mbposy-\th@mbheighty%
     \advance\th@mbposy-\th@mbsdistance%
-    \thumborigaddthumb{}{}{\thumbs@pagecolor}{\thumbs@pagecolor}%
+    \thumborigaddthumb{}{}{\string\thepagecolor}{\string\thepagecolor}%
     \th@mb@dvance%
   \fi%
   }
@@ -500,9 +510,9 @@
   }
 
 \newcommand{\addtitlethumb}[5]{%
-  \global\edef\th@mb@titlelabel{#5}%
+  \xdef\th@mb@titlelabel{#5}%
   \addthumb{#1}{#2}{#3}{#4}%
-  \global\edef\th@mb@titlelabel{}%
+  \xdef\th@mb@titlelabel{}%
   }
 
 \newcommand{\addthumb}[4]{%
@@ -516,13 +526,13 @@
     \setlength{\th@mbposy}{\th@mbposytop}%
     \advance\th@mbposy\th@mbsdistance%
     \ifx\th@mbcolumn\pagesLTS@zero%
-      \global\edef\th@umbsperpagecount{\th@mbs}%
+      \xdef\th@umbsperpagecount{\th@mbs}%
       \gdef\th@mbcolumn{1}%
     \fi%
   \fi%
   \setcounter{th@mbs@tmpA}{\th@mbs}%
   \addtocounter{th@mbs@tmpA}{+1}%
-  \global\edef\th@mbs{\arabic{th@mbs@tmpA}}%
+  \xdef\th@mbs{\arabic{th@mbs@tmpA}}%
   \gdef\th@mbtitle{#1}%
   \gdef\th@mbtext{#2}%
   \gdef\th@mbtextcolour{#3}%
@@ -530,7 +540,7 @@
   \edef\th@mbstmpwidth{\the\th@mbposyA}%
   \settowidth{\th@mbposyA}{\th@mbtext\space}%
   \ifdim\th@mbposyA>\th@mbmaxwidth%
-    \global\edef\th@mbmaxwidth{\the\th@mbposyA}%
+    \xdef\th@mbmaxwidth{\the\th@mbposyA}%
   \fi%
   \ifdim\th@mbposyA>\th@mbwidthx%
     \ifthumbs@draft% \relax
@@ -538,8 +548,8 @@
       \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%
+        Thumb mark too small (width: \thumbsinfoa )\MessageBreak%
+        or its text too wide (width: \thumbsinfob )\MessageBreak%
        }%
     \fi%
   \fi%
@@ -564,7 +574,7 @@
   \else%
     \setcounter{th@mbs@tmpA}{\th@mbonpage}%
     \addtocounter{th@mbs@tmpA}{+1}%
-    \global\edef\th@mbonpage{\arabic{th@mbs@tmpA}}%
+    \xdef\th@mbonpage{\arabic{th@mbs@tmpA}}%
   \fi%
   \ifx\th@mbtoprint\pagesLTS@zero%
   \else%
@@ -590,10 +600,10 @@
     \edef\th@mbonpagetest{\arabic{th@mbs@tmpA}}%
     \@whilenum\th@mbonpagetest<\th@mbonpage\do{%
       \addtocounter{th@mbs@tmpA}{1}%
-      \global\edef\th@mbonpagetest{\arabic{th@mbs@tmpA}}%
+      \xdef\th@mbonpagetest{\arabic{th@mbs@tmpA}}%
       \ifnum\th@mbonpage=\th@mbonpagetest%
         \ifnum\th@mbonpagemax<\th@mbonpage%
-          \global\edef\th@mbonpagemax{\th@mbonpage}%
+          \xdef\th@mbonpagemax{\th@mbonpage}%
         \fi%
         \edef\th@mbtmpdef{\csname th@mbtext\AlphAlph{\arabic{th@mbs@tmpA}}\endcsname}%
         \expandafter\gdef\th@mbtmpdef{#2}%
@@ -605,11 +615,11 @@
     }%
     \else%
       \ifnum\th@mbonpagemax<\th@mbonpage%
-        \global\edef\th@mbonpagemax{\th@mbonpage}%
+        \xdef\th@mbonpagemax{\th@mbonpage}%
       \fi%
     \fi%
   \fi%
-  \ifx\th@mbcolumnnew\thumb@two% There is no \pagesLTS@two (yet).
+  \ifx\th@mbcolumnnew\pagesLTS@two%
     \gdef\th@mbcolumnnew{0}%
   \fi%
   \gdef\th@mbtoprint{1}%
@@ -633,14 +643,26 @@
   \def\th@mb@tmp@page{#5}%
   \def\th@mb@tmp@label{#6}%
   \def\th@mb@tmp@column{#7}%
-  \ifx\th@mb@tmp@column\thumb@two%
+  \ifx\th@mb@tmp@column\pagesLTS@two%
     \def\th@mb@tmp@column{0}%
   \fi%
   \setlength{\th@mbwidthxtoc}{\paperwidth}%
   \advance\th@mbwidthxtoc-1in%
-  \advance\th@mbwidthxtoc-\hoffset%
-  \advance\th@mbwidthxtoc-\oddsidemargin%
-  \put(1in+\oddsidemargin,-\th@mbposy){%
+  \def\th@mbstest{r}%
+  \ifx\th@mbstest\th@mbsprintpage% r
+    \advance\th@mbwidthxtoc-\oddsidemargin%
+    \setlength{\@tempdimc}{1in}%
+    \advance\@tempdimc+\oddsidemargin%
+  \else% l
+    \advance\th@mbwidthxtoc-\evensidemargin%
+    \setlength{\@tempdimc}{\th@bmshoffset}%
+    \advance\@tempdimc-\hoffset
+  \fi%
+  \put(\@tempdimc,-\th@mbposy){%
+    \def\th@mbstest{l}%
+    \ifx\th@mbstest\th@mbsprintpage% l
+      \advance\th@mbwidthxtoc+\evensidemargin%
+    \fi%
     \begin{picture}(0,0)%
       \def\th@mbstest{rule}%
       \ifx\thumbs@thumblink\th@mbstest%
@@ -653,22 +675,41 @@
         {\color{\th@mb@tmp@backgroundcolour}\rule{\th@mbwidthxtoc}{\th@mbheighty}}%
       \fi%
     \end{picture}%
+    \ifx\th@mbstest\th@mbsprintpage% l
+      \advance\th@mbwidthxtoc-\evensidemargin%
+    \fi%
     \ifx\th@mb@tmp@column\pagesLTS@zero%
       \setlength{\th@mbwidthxtoc}{\paperwidth}%
       \advance\th@mbwidthxtoc-1in%
       \advance\th@mbwidthxtoc-\hoffset%
-      \advance\th@mbwidthxtoc-\oddsidemargin%
+      \ifx\th@mbstest\th@mbsprintpage% l
+        \advance\th@mbwidthxtoc-\evensidemargin%
+      \else%
+        \advance\th@mbwidthxtoc-\oddsidemargin%
+      \fi%
       \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)%
+        \setlength{\th@mbwidthxtoc}{\textwidth}%
+      \fi%
+      \ifx\th@mbstest\th@mbsprintpage% l
+        \begin{picture}(0,0)(-6pt,-0.5\th@mbheighty+384930sp)%
+          \bgroup%
+            \setlength{\parindent}{0pt}%
+            \makebox[\th@mbwidthx][l]{{\color{\th@mb@tmp@textcolour}\th@mb@tmp@text}}%
+          \egroup%
+        \end{picture}%
+        \setlength{\@tempdimc}{-1in}%
+        \advance\@tempdimc-\evensidemargin%
+      \else% r
+        \setlength{\@tempdimc}{0pt}%
+      \fi%
+      \begin{picture}(0,0)(\@tempdimc,-0.5\th@mbheighty+384930sp)%
         \bgroup%
           \setlength{\parindent}{0pt}%
           \vbox%
            {\hsize=\th@mbwidthxtoc {%
-              \def\th@mbstest{none}
+              \def\th@mbstest{none}%
               \ifx\thumbs@thumblink\th@mbstest%
                 {\color{\th@mb@tmp@textcolour}\noindent \th@mb@tmp@title%
                  \leaders\box \ThumbsBox {\th@mbs@linefill \th@mb@tmp@page}%
@@ -732,12 +773,15 @@
            }%
         \egroup%
       \end{picture}%
-      \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}}%
-        \egroup%
-      \end{picture}%
+      \ifx\th@mbstest\th@mbsprintpage% l; relax
+      \else%
+        \begin{picture}(0,0)(1in+\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}}%
+          \egroup%
+        \end{picture}%
+      \fi%
     \fi%
     }%
   }
@@ -805,7 +849,7 @@
       \advance\th@mbposx-\hoffset%
     \fi%
     \advance\th@mbposx+1pt%
-    \global\edef\th@mbpaperwidth{\the\paperwidth}%
+    \xdef\th@mbpaperwidth{\the\paperwidth}%
   \fi%
   \def\th@mbxpos{\th@mbposx}%
   \ifodd\c@th@mbs@tmpA% \relax
@@ -861,7 +905,7 @@
      }
   \fi
   \ifx\th@mbcolumn\pagesLTS@zero% if there is only one column of thumbs
-    \global\edef\th@umbsperpagecount{\th@mbs}
+    \xdef\th@umbsperpagecount{\th@mbs}
     \gdef\th@mbcolumn{1}
   \fi
   \ifx\th@umbsperpagecount\pagesLTS@zero
@@ -912,7 +956,64 @@
   \gdef\th@mbs@toc@text{#2}
   }
 
-\newcommand{\thumbsoverview}[1]{%
+\newcommand{\clearotherdoublepage}{%
+\clearpage\if@twoside \ifodd\c@page% removed "\else" from \cleardoublepage
+\hbox{}\newpage\if@twocolumn\hbox{}\newpage\fi\fi\fi%
+}
+
+\newcommand{\th@mbstablabeling}{%
+  \@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%
+  }
+
+\newcommand{\thumbsoverview}[1]{\thumbsoverviewprint{#1}{r}}
+
+\newcommand{\thumbsoverviewback}[1]{\thumbsoverviewprint{#1}{l}}
+
+\newcommand{\thumbsoverviewverso}[1]{\thumbsoverviewprint{#1}{v}}
+
+\newcommand{\thumbsoverviewdouble}[1]{\thumbsoverviewprint{#1}{d}}
+
+\newcommand{\thumbsoverviewprint}[2]{%
+  \edef\th@mbstest{#2}%
+  \def\th@mbstestb{r}%
+  \ifx\th@mbstest\th@mbstestb% r
+    \gdef\th@mbsprintpage{r}%
+  \else%
+    \def\th@mbstestb{l}%
+    \ifx\th@mbstest\th@mbstestb% l
+      \gdef\th@mbsprintpage{l}%
+    \else%
+      \def\th@mbstestb{v}%
+      \ifx\th@mbstest\th@mbstestb% v
+        \gdef\th@mbsprintpage{v}%
+      \else%
+        \def\th@mbstestb{d}%
+        \ifx\th@mbstest\th@mbstestb% d
+          \gdef\th@mbsprintpage{d}%
+        \else%
+          \PackageError{thumbs}{%
+             Invalid second parameter of \string\thumbsoverviewprint %
+           }{The second argument of command \string\thumbsoverviewprint\space must be\MessageBreak%
+             either 'r' or 'l' or 'v' or 'd', but is 'X2'.\MessageBreak%
+             Now 'r' is chosen instead.\MessageBreak%
+           }%
+          \gdef\th@mbsprintpage{r}%
+        \fi%
+      \fi%
+    \fi%
+  \fi%
   \def\th@mbstest{none}%
   \ifx\thumbs@thumblink\th@mbstest% OK
   \else%
@@ -956,7 +1057,18 @@
   \fi%
   \edef\th@mbprintingovertoc{\th@mbprinting}%
   \ifnum \th@mbsmax > \pagesLTS@zero%
-    \if@twoside \cleardoublepage%
+    \if@twoside%
+      \def\th@mbstest{r}%
+      \ifx\th@mbstest\th@mbsprintpage%
+        \cleardoublepage%
+      \else%
+        \def\th@mbstest{v}%
+        \ifx\th@mbstest\th@mbsprintpage%
+          \cleardoublepage%
+        \else% l or d
+          \clearotherdoublepage%
+        \fi%
+      \fi%
     \else \clearpage%
     \fi%
     \stopthumb%
@@ -972,7 +1084,7 @@
   \fi%
   \setcounter{th@mblinea}{\th@mbstable}%
   \addtocounter{th@mblinea}{+1}%
-  \global\edef\th@mbstable{\arabic{th@mblinea}}%
+  \xdef\th@mbstable{\arabic{th@mblinea}}%
   \setcounter{th@mblinea}{1}%
   \setcounter{th@mblineb}{\th@umbsperpage}%
   \setcounter{FileLine}{1}%
@@ -984,23 +1096,56 @@
   \let\label\@gobble%
   \let\index\@gobble%
   \let\glossary\@gobble%
-  \@whilenum\value{FileLine}<\value{thumbsstop}\do%
-   {\if@twoside \cleardoublepage%
-    \else \clearpage%
+  \def\th@mbstest{v}% r l r ...
+  \ifx\th@mbstest\th@mbsprintpage%
+    \def\th@mbsprintpage{l}% because it will be changed to r
+    \def\th@mbdoublepage{1}%
+  \else%
+    \def\th@mbstest{d}% l r l ...
+    \ifx\th@mbstest\th@mbsprintpage%
+      \def\th@mbsprintpage{r}% because it will be changed to l
+      \def\th@mbdoublepage{1}%
+    \else%
+      \def\th@mbdoublepage{0}%
     \fi%
-    \ifnum\value{FileLine}=1%
-      \@ifundefined{Hy@Warning}{}{\phantomsection}%
-      \let\label\thumbsoriglabel%
-      \ifx\th@mbstable\pagesLTS@one%
-        \label{TableOfThumbs}%
-        \label{TableOfThumbs1}%
+  \fi%
+  \def\th@mb@resetdoublepage{0}%
+  \@whilenum\value{FileLine}<\value{thumbsstop}\do%
+   {\ifx\th@mbdoublepage\pagesLTS@one%
+      \def\th@mbstest{r}%
+      \ifx\th@mbsprintpage\th@mbstest%
+        \def\th@mbsprintpage{l}%
+      \else% \th@mbsprintpage is l
+        \def\th@mbsprintpage{r}%
+      \fi%
+      \clearpage%
+      \ifx\th@mb@resetdoublepage\pagesLTS@one%
+        \setcounter{th@mblinea}{\theth@mblinea}%
+        \setcounter{th@mblineb}{\theth@mblineb}%
+        \def\th@mb@resetdoublepage{0}%
       \else%
-        \overridelabel{TableOfThumbs}%
-        \label{TableOfThumbs\th@mbstable}%
+        \edef\theth@mblinea{\arabic{th@mblinea}}%
+        \edef\theth@mblineb{\arabic{th@mblineb}}%
+        \def\th@mb@resetdoublepage{1}%
       \fi%
-      \let\label\@gobble%
-      \ifx\th@mbs@toc@level\empty%\relax
-      \else \addcontentsline{toc}{\th@mbs@toc@level}{\th@mbs@toc@text}%
+    \else%
+      \if@twoside%
+        \def\th@mbstest{r}%
+        \ifx\th@mbstest\th@mbsprintpage%
+          \cleardoublepage%
+        \else% l
+          \clearotherdoublepage%
+        \fi%
+      \else \clearpage%
+      \fi%
+    \fi%
+    \ifnum\value{FileLine}=1%
+      \ifx\th@mbdoublepage\pagesLTS@one%
+        \ifx\th@mb@resetdoublepage\pagesLTS@one%
+          \th@mbstablabeling%
+        \fi%
+      \else
+        \th@mbstablabeling%
       \fi%
     \fi%
     \null%
@@ -1010,6 +1155,9 @@
       \message{THUMBS: Fileline: \arabic{FileLine}, a: \arabic{th@mblinea}, %
         b: \arabic{th@mblineb}, per page: \th@umbsperpage, max: \th@mbsmax.^^J}%
     \fi%
+    \ifx\th@mb@resetdoublepage\pagesLTS@one%
+      \setcounter{FileLine}{\theth@mblinea}%
+    \fi%
    }%
   \setlength{\th@mbposy}{\th@mbsposytocy}%
   \ifx\th@mbprintingovertoc\pagesLTS@one%
@@ -1018,6 +1166,7 @@
   \let\label\thumbsoriglabel%
   \let\index\thumbsorigindex%
   \let\glossary\thumbsorigglossary%
+  \addthumbsoverviewtocontents{}{}%
   }
 
 \newcommand{\th@mbs@verview}{%
@@ -1058,12 +1207,12 @@
                 \else% THIS SHOULD NEVER HAPPEN!
                   \PackageError{thumbs}{Unexpected error! (Really!)}{%
                     ! You are in trouble here.\MessageBreak%
-                    ! Type  X \string<return\string>  to quit.\MessageBreak%
+                    ! Type\space \space X \string<return\string>\space to quit.\MessageBreak%
                     ! Delete temporary auxiliary files\MessageBreak%
                     ! (like \jobname.aux, \jobname.tmb, \jobname.out)\MessageBreak%
                     ! and retry the compilation.\MessageBreak%
                     ! If the error persists, cross your fingers\MessageBreak%
-                    ! and try typing  \string<return\string>  to proceed.\MessageBreak%
+                    ! and try typing\space \space \string<return\string>\space to proceed.\MessageBreak%
                     ! If that does not work,\MessageBreak%
                     ! you might contact the maintainer of the thumbs package.\MessageBreak%
                     }%
@@ -1116,6 +1265,15 @@
    }
 \fi
 
+\ifthumbs@hidethumbs
+  \renewcommand{\addthumb}[4]{\relax}
+  \PackageWarningNoLine{thumbs}{thumbs package in hide mode:\MessageBreak%
+    Thumb marks are hidden.\MessageBreak%
+    Remove package option hide to get thumb marks.\MessageBreak%
+   }
+  \renewcommand{\thumbnewcolumn}{\relax}
+\fi
+
 
 \endinput
 %%
-- 
cgit v1.2.3

