# list of pdf pages

I need to add quite a few extra pdf files at the end of my report. Is there a way to create a list of these pages (named list of evidence) following the table of contents?

Edit to question: I have realised how obscure it may all look now if you look at comments below. Let me clarify what it is that I'm after. I'm writing a report that needs numbered paragraphs. I also need to mark what paragraphs contain mention of evidence to statements in the report. This needs to be marked on the RHS in the margin (I'm doing that with the \ev command) The evidence needs to be added in a sequence of mention in the report at the end of the report. All of my evidence are pdf files (usually 1-5 pages long). So what I originally was after is a way to include a list of that evidence in the TOC (as sections), so that I can have a name of each evidence in section name to appear in the TOC and in the footer to identify it for the reader. I also don't want the evidence section heading to appear in the text (hence \invisiblesection). Hope this makes it a bit clearer now. Apologise for any confusion caused.

The intended ToC should look something like that

Contents

1. Section...................................2

1.1 Subsection..............................2

1.2 Subsection..............................3

1.2.1 Subsubsection...............4

....

....

List of Evidence

Evidence 1....................40

Evidence 2.....................41

Evidence 3.....................46

....

Code EDIT#2

\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{latexsym}
%\usepackage{fullpage}
\usepackage[a4paper,margin=1in,headheight=.4in,headsep=12pt,heightrounded]{geometry}
\usepackage{float}
\usepackage{indentfirst}
\usepackage[font=footnotesize,format=plain,labelfont=bf,up,textfont=it,up]{caption}
\usepackage{subfig}
\usepackage{booktabs}
\usepackage{appendix}
\usepackage{verbatim}
\usepackage{setspace}
\usepackage{rotating}
\usepackage{array}
\usepackage{multirow}
\usepackage{wrapfig}
\usepackage[parfill]{parskip}
\usepackage{pdfpages}
\usepackage{fancyhdr}

%to get para numbers in the margins

\usepackage{lipsum} % for dummy text
\usepackage{hyperref}

\newcounter{numpar}
\newcommand{\np}[1][]{%
\par
\refstepcounter{numpar}%
\noindent
\makebox[0pt][r]{%
\makebox[0pt][l]{\textbf{\thenumpar}}%
\qquad
}%
#1%
\ignorespaces
}

%evidence counter
\newcounter{evidence}
\newcommand{\ev}{%
\stepcounter{evidence}%
\marginpar{\textbf{EV\theevidence}}%
}

\pagestyle{fancy}
\lhead{\begin{footnotesize}
Headerline 1\\Headerline2
\end{footnotesize}}

\rhead{\begin{footnotesize}
headerline1
\end{footnotesize}}

\lfoot{\begin{scriptsize}
\leftmark
\end{scriptsize}}

\cfoot{}

\rfoot{Page \thepage}

\renewcommand{\headrulewidth}{0.4pt}
\renewcommand{\footrulewidth}{0.4pt}

\makeatletter
\newcommand\invisiblesection[1]{%
\refstepcounter{section}%
\addcontentsline{toc}{section}{\protect\numberline{\thesection}#1}%
\sectionmark{#1}}
\makeatother

\def\evidence#1{%#2{ %#3{%
\label{#1}}

\begin{document}

\thispagestyle{empty}
\tableofcontents
\pagebreak
\pagenumbering{arabic}

\section{A sectoion}
\np text
\np text \ev
\np text \ev
\subsection{A subsection}
....
....
Main text of the report
....
....
End of text
\pagebreak

\evidence{evi:abstract}\invisiblesection{EV1}\includepdf[scale=0.92,pages=1,pagecommand=    {\pagestyle{fancy}}]{evidence1.pdf}

\evidence{evi:abstract}\invisiblesection{EV2}\includepdf[scale=0.92,pages=1,pagecommand={\pagestyle{fancy}}]{evidence2.pdf}

\end{document}


## 1 Answer

This solution was posted before the detailed clarification from the OP and may not reflect the actual output intended

Solution Idea

Simply include the exhibits each as a separate chapter. This takes care of the primary issue of adding to TOC as well as other formatting issues. A small macro can be written to simplify the usage.

Solution

\documentclass{book}

\usepackage{pdfpages}

\makeatletter
\def\startevidence{
\clearpage
\addcontentsline{toc}{part}{Exhibits}%
\part*{Exhibits}
\setcounter{chapter}{0}%
\setcounter{section}{0}%
\gdef\@chapapp{Evidence}
\gdef\thechapter{\@Alph\c@chapter}}
\makeatother

% \evidence{chapter heading}{label}{file}
\def\evidence#1#2#3{%
\chapter{#1}
\label{#2}
\includepdf[pages=-]{#3}}

\usepackage{lipsum}

\begin{document}

\tableofcontents

\chapter{First Chapter}

\lipsum[1-100]

\chapter{Second Chapter}

\lipsum[51-100]

\startevidence

\evidence{Exposition}{evi:exposition}{evidence1.pdf}

\evidence{Specimen}{evi:specimen}{evidence2.pdf}

\evidence{Clarification}{evi:clarification}{evidence3.pdf}

\end{document}


Output

Usage

1. \startevidence starts the evidence part. This is just like the \appendix command, but it puts an extra page indicating the start of evidence. This is added to the TOC as well.

2. Use macro \evidence to actually include each pdf file. This macro needs three arguments, name of the evidence which is more like a chapter heading, label for that chapter for later references, name of the pdf file.

Modifications

If you want the pdf files not to be added as chapters rather want to add them as sections, simply modify the \evidence macro.

• hi MMA that's a good idea I have altered the code to better fit my document, but I've got a slight problem. In the toc evidence number starts from 0, and I'm struggling to find how to fix it. Ideally I wouldn't want to have a numbered subsection in the toc for evidence. Jan 8, 2014 at 16:27
• @user43528 Does tweaking \setcounter{chapter}{0} or \setcounter{section}{0} help? Simply comment out these two and see what happens. Then you can simply uncomment one at a time then again see what happens. Jan 8, 2014 at 16:35
• I was thinking of reducing depth of the toc from \startevidence to 1 (to number just sections) but that doesnt work either Jan 8, 2014 at 16:40
• @user43528 This is difficult to comment without seeing your code, but perhaps you will want not to use \startevidence at all and then change \chapter in the definition of \evidence to \section. But again, it is very difficult to correct a code from remote. Jan 8, 2014 at 16:49
• i've put the most updated code into the question at the top of the page Jan 8, 2014 at 16:54