Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Possible Duplicate:
Adding Table of Contents to existing PDF

I've scanned various articles from different books and put together so there is a one pdf file now. I would like to make a table of content so that when I click on any article title, document viewer brings me appropriate page. Is it possible?

Note: By the way, I didn't use any ocr program so, you can't select words...

share|improve this question
    
Is your one PDF file with the various articles produced with LaTeX? –  doncherry Sep 28 '12 at 19:43
1  
Welcome to TeX.sx! This question is very similar to tex.stackexchange.com/questions/11082/… . Please take a look at it as the information there might help you. If so, that's great, and we'll probably close this question as a duplicate just to keep the place tidy and to help people find answers quickly. If not, please edit your question here to explain why so that people can better focus their attention to help you. –  doncherry Sep 28 '12 at 19:45
    
@doncherry Here the OP got multible PDFs, there one, which has to be enriched with a toc. Similar, but not the same. –  Keks Dose Sep 28 '12 at 20:35
    
@KeksDose Similar enough to be a dupe imho. The two cases differ slightly in the argument structure of \includepdf, but the overall technique is the same. –  doncherry Sep 28 '12 at 21:49
add comment

marked as duplicate by Martin Schröder, Werner, doncherry, Paul Gaborit, Tom Bombadil Sep 29 '12 at 1:05

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

2 Answers

up vote 3 down vote accepted

A slight modification of Keks' answer. You could use phantomsection to avoid introducing blank pages. You will have to specify the section title for table of contents separately using \addcontentsline{toc}{section}{<title here>}.

\documentclass{article}
\usepackage{pdfpages}
\usepackage{hyperref}

\begin{document}
\tableofcontents

\phantomsection
    \addcontentsline{toc}{section}{doc1}
    \includepdf[pages=-]{document1}

\phantomsection
    \addcontentsline{toc}{section}{doc2}
    \includepdf[pages=-]{document2}

\end{document}

However in the above example you can only link to first page of the pdf file. One way to link to pages within the pdf would be to add the pdf file in pieces,

\phantomsection
    \addcontentsline{toc}{section}{doc3}
    \includepdf[pages=1-5]{document3}

\phantomsection
    \addcontentsline{toc}{section}{doc4}
    \includepdf[pages=5-7]{document4}

\phantomsection
    \addcontentsline{toc}{section}{doc5}
    \includepdf[pages=8-]{document5}
share|improve this answer
add comment

In the folder with your scans make a *.tex-file, something like this:

    \documentclass{article}
    \usepackage{pdfpages, hyperref}

    \begin{document}
    \tableofcontents
    \section{document1}
    \includepdf[pages=-]{document1}
    \section{document2}
\includepdf{document2}
    ...
    \end{document}

Read the manual of pdfpages for all its possibilities. It's a great package. Disclaimer: I did not test the file above.

share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.