I am attaching two .pdf documents to my main document, which is written in LyX. I would like that the titles of them appeared at the end of the table of contents.
So far, I've been successful in adding them by inserting with ERT
\addcontentsline{toc}{chapter}{Additional document 1}
and changing the page count using e.g.
\setcounter{page}{150}
However, if I want to add two attachments:
\setcounter{page}{104}
\addcontentsline{toc}{chapter}{Additional doc 1}
\setcounter{page}{154}
\addcontentsline{toc}{chapter}{Additional doc 2}
Then both of them are listed as page 154 in the TOC.
It should be noted that I am using this template, and adding the ERT under the Appendix box in the main lyx file.
Which compiles fine (but does not have the correct page numbers)
Any advice is welcome.
\addcontentsline
is "executed" at shipout time, at the end of the page. How are you attaching the pdf? With \includepdf`?\newpage \mbox{} <your code>
for each of them.