0

I have a document, that needs to have a specific background exactly on one ToC page, but because my ToC spans multiple pages the background also spans multiple pages before I can toggle another background. How can I change this behavior so that only first page of my ToC has a specific background?

MWE:

\usepackage{background}
\usepackage{tocloft}
\usepackage{titling}
\usepackage{titlesec}
%...
\newcommand\useframebackground{%
\backgroundsetup{%
 pages=all,
 color=black,
 opacity=1,
 position={3.3in, -4.85in},
 angle=0,
 scale=1,
 contents={%
\setlength\tabcolsep{0pt}
\setlength\extrarowheight{2pt}
\setlength\arrayrulewidth{1pt}
\fontsize{10pt}{12pt}\selectfont
\begin{tabular}{ | C{0.36in} C{0.425in} C{1in} C{0.59in} C{0.4in} C{2.39in}  C{0.2in}  C{0.2in}  C{0.2in}  C{0.91in} C{0.6in} | }
\hline
\multicolumn{11}{| c |}{}\\[10.85in]
 & & & & & & & & & & \\
\hline
\end{tabular}
}}}
%...

\begin{document}
\usetitlebackground
\newgeometry{bottom=5cm}
\tableofcontents
\addtocontents{toc}{~\hfill\textbf{Page.}\par}
\restoregeometry

\newpage
\usemainbackground
%...
\end{document}

Since my document has a lot of sections and subsection, the ToC part spans multiple pages.

1 Answer 1

0

Alright, I found a way to do it with atbegshi package:

\usepackage{background}
\usepackage{tocloft}
\usepackage{titling}
\usepackage{titlesec}
\usepackage{atbegshi}
%...
\newcommand\useframebackground{%
\backgroundsetup{%
 pages=all,
 color=black,
 opacity=1,
 position={3.3in, -4.85in},
 angle=0,
 scale=1,
 contents={%
 %...
}}}
%...

\begin{document}
\usetitlebackground
\newgeometry{bottom=5cm}
\tableofcontents
\addtocontents{toc}{~\hfill\textbf{Page.}\par}

\AtBeginShipoutNext{
\usemainbackground
}

\restoregeometry

\newpage
%...
\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .