1

I am using the pdfpages package for including a few pages of pdf to my main LaTeX document, therefore I would like to add some lines to the table of content for that pages by myself. I am using the titletoc package as well.

I hope something like the following works:

\addtocontents{toc}{Preface to 2ed \titlerule i}
\addtocontents{toc}{Preface to 1ed \titlerule ii}

for the display

Preface to 2ed ............................................ i

Preface to 1ed ............................................ ii

where both "Preface" and the page numbers "i/ii" are typed by myself, while the "titlerule" should be consistent with what is being used.

Can someone help?

lockstep
  • 250,273
ccire
  • 13

1 Answers1

1

I think you intended something like that:

\documentclass{book}
\usepackage{pdfpages}
\begin{document}
\tableofcontents
\clearpage
\addcontentsline{toc}{chapter}{Preface to 2ed}
\includepdf{preface1}
\addcontentsline{toc}{chapter}{Preface to 1ed}
\includepdf{preface2}
\chapter{Introduction}
...
\end{document}

For the dots see: Changing the TOC style of an Article document-class

Ruben
  • 13,448
  • Ok. I forgot the roman numerals. I would add a \frontmatter and change the displaymode of the pages counter to roman for the whole part preceeding the actual thesis, work or whatever for consistency. (Even withot using the frontmatter function) – Ruben Jul 04 '13 at 18:42
  • Can you give the details about roman page numbers? thanks. – ccire Jul 05 '13 at 01:27
  • By adding \pagenumbering{roman} I did it. Thanks for your method. – ccire Jul 05 '13 at 03:16
  • I am quite new to the community too. But i learned right on my first question that, here, it is unusual to say "thanks". Alternatively it is suggested to upvote. (This is no request. If you do not like it, not upvote it. It is a brief instruction on the coumminity code or so) – Ruben Jul 05 '13 at 11:22
  • Stackexchange allows people without account (like me) to ask question, and such people haven't the privilege of upvoting. – ccire Jul 05 '13 at 15:36