1

I've been writing a user manual for the past couple days and have come up against a bit of a wall. The table of contents for my manual is going to end up longer than a page and I want it to look a certain way.

I've made a page-sized image that I'm using as a background for each of the chapter pages as well as the TOC and LOF. Additionally, the first page of the manual is currently a pdf that I'm just inserting at the very front. I'll include all the code below with my comments on what the issues are, but basically, after one page of the TOC, the background image that I create is disappearing and is being replaced with the plain pagestyle I have also defined within the code.

I've tried a number of different things like suppressing \thispagestyle, defining a custom empty pagestyle, and using \tocloftpagestyle but none of them are actually functional (especially \tocloftpagestyle as LaTeX is saying that the command doesn't actually exist). Is there something I'm doing wrong or is this as difficult as I'm starting to think?

Here's a stripped down sample of the code:

\documentclass[11pt, twoside, openany]{memoir}

%\usepackage{showframe}
\usepackage[utf8]{inputenc}
\usepackage{xcolor}
\usepackage[top=1.25in,bottom=1.25in,left=1.25in,right=1.25in]{geometry}
\usepackage[]{fancyhdr}
\usepackage{pdfpages}
\usepackage{helvet}
\usepackage{overpic}
\usepackage{wallpaper}
\usepackage{graphicx}
\usepackage{etoolbox}
\usepackage{tikz}
\usepackage{tocloft}
%end of dependencies

\fancypagestyle{plain}{
%%Scrapped together code here to create a cool header
}

%%PROBLEM ONE: Redefining empty to put background images on the TOC prevents includepdf from working as it sets the page to empty.
%Also it only works for the first page of the TOC
\fancypagestyle{empty}{
    \fancyhf{}
    \renewcommand{\headrulewidth}{0.0pt}
    \renewcommand{\footrulewidth}{0.0pt}
    \ThisCenterWallPaper{1}{./FinalImages/ChapterPage}
}

%%PROBLEM TWO: If I remove this section and put something like this:
%\tableofcontents
%\ThisCenterWallPaper{1}{./FinalImages/ChapterPage}
%\thispagestyle{empty}
%   for both the TOC and the LOF, it only works for the last page of those respective items

\begin{document}
\includepdf{./FinalImages/FirstPage}

\setcounter{tocdepth}{5}
\pagestyle{empty}
\tableofcontents
\newpage
\listoffigures
\clearpage

\pagestyle{plain}

\chapter{Status and Values}
\thispagestyle{empty}
\clearpage

\section{FooBar}
Foo Bar.Foo Bar.Foo Bar.Foo Bar.Foo Bar.Foo Bar.Foo Bar.Foo Bar.Foo Bar.Foo Bar.Foo Bar.Foo Bar.Foo Bar.Foo Bar.Foo Bar.Foo Bar.Foo Bar.Foo Bar.Foo Bar.Foo Bar.Foo Bar.Foo Bar.

%I've initialized all the other chapters like I did above in the actual document
\chapter{Status and Values}\chapter{Status and Values}\chapter{Status and Values}\chapter{Status and Values}\chapter{Status and Values}\chapter{Status and Values}\chapter{Status and Values}\chapter{Status and Values}\chapter{Status and Values}\chapter{Status and Values}\chapter{Status and Values}\chapter{Status and Values}\chapter{Status and Values}\chapter{Status and Values}\chapter{Status and Values}\chapter{Status and Values}\chapter{Status and Values}\chapter{Status and Values}\chapter{Status and Values}\chapter{Status and Values}\chapter{Status and Values}\chapter{Status and Values}\chapter{Status and Values}\chapter{Status and Values}\chapter{Status and Values}\chapter{Status and Values}\chapter{Status and Values}\chapter{Status and Values}\chapter{Status and Values}

\includepdf{./FinalImages/LastPage}
\end{document}

Please help. This seems like it should be so simple but nothing's working.

P.S. I'm a LaTeX newbie and it's my first time posting here so if I broke some forum rule please let me know. Also, probably a much more simple problem I'm also having is that I'd like to extend the bottom margin on all of the empty pagestyle pages but there doesn't seem to be an \addtolength{bottommargin} anywhere.

**EDIT:**Just adding the images people will need to run this https://drive.google.com/open?id=0B1v5jtMWOxDTelZyVFExSWpURW8

4
  • 1
    Advice: Copy the code that you provide here into a new document and try to compile it. If you can't compile it (because something is missing for example) then the people here most likely also won't be able to compile it. May 19, 2017 at 13:28
  • Thanks for the advice. I tried it and it seemed to be compiling just fine without any errors. Did something specific happen when you tried to compile it?
    – Noah P.
    May 19, 2017 at 17:24
  • \ThisCenterWallPaper{1}{./FinalImages/ChapterPage} etc. How could people here have the files :). May 19, 2017 at 23:07
  • I added the images. The first and last pages are samples but the issues I'm having are the same. Please let me know if there's anything else you need.
    – Noah P.
    May 22, 2017 at 12:35

1 Answer 1

3

I address the problem of the background for the TOC.

  • Your code has a lot of unnecessary information/code.
  • I removed some of it.
  • I use the background package.
  • I added a related question in the code.
  • I only present a manual approach since I do not have more time. I am sure this can be done more elegantly.
  • I would suggest that you ask more atomic questions (one topic per question) in the future.

\documentclass{memoir}

% https://tex.stackexchange.com/questions/175198
% https://www.ctan.org/pkg/background
\usepackage{background}
\usepackage{graphicx}

\usepackage{blindtext}

\begin{document}

% https://tex.stackexchange.com/questions/231738
\backgroundsetup{
    placement = center,
    contents = {\includegraphics[width=\paperwidth]{example-image-a}},
    scale = 1, % 15 is default for placement "center"
    angle = 0, % 60 is default for placement "center"
    }

\tableofcontents
\newpage
\listoffigures
\newpage

\backgroundsetup{
    placement = center,
    contents = {},
    scale = 1, % 15 is default for placement "center"
    angle = 0, % 60 is default for placement "center"
    }

\blinddocument\blinddocument
\blinddocument\blinddocument
\blinddocument\blinddocument
\blinddocument\blinddocument
\blinddocument\blinddocument
\blinddocument\blinddocument
\blinddocument\blinddocument
\blinddocument\blinddocument

\end{document}

enter image description here

2
  • 2
    Thank you for your help and for your advice. This solution does solve the issue of getting a background image displayed across all the pages within the TOC, but unfortunately does not solve the deeper issue of the \tableofcontents command calling\pagestyle{plain} every time a new page is instantiated. I got around this by simply putting the TOC and the LOF inside a group where the plain pagestyle was defined without a header/footer. I'm sure that's not the cleanest way to do it but it works for what I'm doing. Thanks again for the help!
    – Noah P.
    May 22, 2017 at 19:50
  • 1
    Thank you for the link :-)
    – Sebastiano
    Feb 3, 2020 at 22:00

You must log in to answer this question.

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