3

I'm using flowfram to add thumb indexes to the edge of the book I'm writing. I want to specify exactly what is printed in the tab. Right now it is the same as what appears in the ToC. I'd prefer the tabs to just include the part number or text I designate.

\usepackage[thumbtabs]{flowfram}
\makethumbtabs{5cm}[part]

\begin{document}
\enablethumbtabs
...
\part{This will appear in first tab}
...
\part[This will appear in second tab]{This will not appear}

What I want to appear is "Part I: Foo" and "Part II: Bar". Is there a way to specify that?

If I use the \part[] to specify the text, that text also appears in the ToC. I'd like to set different text on the page, in the ToC, and in the thumbtab.

TomOnTime
  • 348
  • 1
  • 7
  • Please edit your example to make it compile. This will make it easier for people to help you and makes it more likely you will receive useful responses. – cfr Jan 23 '14 at 01:36

1 Answers1

3

You could use the xparse package to renew \part, letting it take 3 arguments. The way I've done this, \part(#1)[#2]{#3] will put #1 in the tab, #2 in the TOC and use #3 as the heading. If either #1 or #2 is missing, #3 will be used as a fallback:

\documentclass[a4paper,12pt]{article}
\usepackage{xparse}
\usepackage[thumbtabs]{flowfram}
\makethumbtabs{5cm}[part]

\makeatletter
\RenewDocumentCommand{\part}{d() o m}{%
  \IfNoValueTF{#2}{\@ttb@old@part[#3]{#3}}{\@ttb@old@part[#2]{#3}}
  \IfNoValueTF{#1}{%
    \addtocontents{ttb}{\protect\thumbtab
        {\thepage}{\thepart}{#3}{part.\thepage}}}{%
    \addtocontents{ttb}{\protect\thumbtab
        {\thepage}{\thepart}{#1}{part.\thepage}}}}
\makeatother

\begin{document}
\tableofcontents
\enablethumbtabs

\part(This is the first thumbtab)[This is the first thing in the TOC]{This is the first part heading}

\part(This is the second thumbtab)[This is the second thing in the TOC]{This is the second part heading}

\part{This has no optional args}

\end{document}

Distinct TOC/heading/tab

cfr
  • 198,882