1

How can I do a table of contents, list of figures and list of tables of included pdf

\documentclass{memoir}
\usepackage{pdfpages}
\usepackage{hyperref}
\usepackage{cleveref}


\begin{document}
    \tableofcontents
    \listoffigures
    \listoftables

\include{Chapter1/chapter01}
\includepdf[pages=1-19]{./Chapter2/Article1.pdf}


\end{document}
  • 1
    Does this question help? tex.stackexchange.com/questions/38409/… – David Purton Nov 17 '18 at 12:17
  • The addtotoc and addtolist options of pdfpages (as shown in the above linked question) will definitely do what you want. I didn't know they existed until then, but it's a neat idea. – David Purton Nov 17 '18 at 12:29
  • @DavidPurton, Thank you for the link. I tried to use this idea, but if I have several sections in a page, for example in the first page, I only have a section but in the third page, I have a section, two subsections and one figure,... Please, how can I do it using this link! – Achaire Nov 17 '18 at 13:08
  • If Article1.pdf was created using LaTeX and you still have the aux file, you can use \externaldocument from the xr package/ Otherwise, the information has been lost and will have to be added by hand. Of course, it would use the original page numbers. – John Kormylo Nov 17 '18 at 13:51
2

You can use the addtotoc and addtolist options of the pdfpages package to specify a full document structure and list of tables and figures.

You will get hyperlinks to the page rather than exact location on the page, but that's not the end of the world. (You could do this, but not in as automatic a way.)

MWE

\documentclass{memoir}
\usepackage{pdfpages}
\begin{document}
\tableofcontents
\listoffigures
\listoftables

\include{Chapter1/chapter01}

\includepdf[%
  pages=1-19,
  addtotoc={
    1,chapter,0,Article 1,A1-1,
    2,section,1,First Section of Article 1,A1-2,
    2,section,1,Second Section of Article 1,A1-3
  },
  addtolist={
    3,figure,First Figure of Article 1,A1-4,
    3,figure,Second Figure of Article 1,A1-5,
    4,table,First Table of Article 1,A1-6
  }
]{./Chapter2/Article1.pdf}
\end{document}
  • Thanks!!!, do you know please how to add to TOC an unnumbered section or an appendix. – Achaire Nov 19 '18 at 13:10
  • @Achaire, not off the top of my head. I suggest you ask a new question referencing this one with an appropriate MWE that people can test with. – David Purton Nov 19 '18 at 13:13
  • @Achaire, calling \appendix before inserting your pages allows for appendixes. – David Purton Nov 19 '18 at 13:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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