TOC entries and labels for included PDF pages The 2019 Stack Overflow Developer Survey Results Are In Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)Section anchors invisible in main body, but visible in table of contents?Content of including PDFsinput with undefined environmentsRefer to appendix with includepdfHyperlink in Contents not working properly with pdf insertedHow to include PDF pages without a newpage before the first page?New page at end of subsection (not start!)How to remove Section, SubSection titles?Using renewcommand to define sectionsusing LaTeX pdfpages and geometry packages togetherAutomatic inserting of portrait and landscape pdf documents with pdfpagesHow can I have subsection headers in a separate column while maintaining document structure and control of fonts?Place text tightly above section headerNew subsection definition redefines original subsection numberingIs there a way to have a constant space between the (sub)section number and the heading in the ToC

Take groceries in checked luggage

Are my PIs rude or am I just being too sensitive?

ELI5: Why do they say that Israel would have been the fourth country to land a spacecraft on the Moon and why do they call it low cost?

What do you call a plan that's an alternative plan in case your initial plan fails?

Can the prologue be the backstory of your main character?

Make it rain characters

Didn't get enough time to take a Coding Test - what to do now?

He got a vote 80% that of Emmanuel Macron’s

The variadic template constructor of my class cannot modify my class members, why is that so?

Is there a writing software that you can sort scenes like slides in PowerPoint?

Do warforged have souls?

Wolves and sheep

Was credit for the black hole image misattributed?

Program that generates brainfuck code that outputs given text

Did the UK government pay "millions and millions of dollars" to try to snag Julian Assange?

Semisimplicity of the category of coherent sheaves?

Typeface like Times New Roman but with "tied" percent sign

What can I do if neighbor is blocking my solar panels intentionally?

"... to apply for a visa" or "... and applied for a visa"?

Why use ultrasound for medical imaging?

How can I protect witches in combat who wear limited clothing?

Does Parliament need to approve the new Brexit delay to 31 October 2019?

Difference between "generating set" and free product?

What aspect of planet Earth must be changed to prevent the industrial revolution?



TOC entries and labels for included PDF pages



The 2019 Stack Overflow Developer Survey Results Are In
Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)Section anchors invisible in main body, but visible in table of contents?Content of including PDFsinput with undefined environmentsRefer to appendix with includepdfHyperlink in Contents not working properly with pdf insertedHow to include PDF pages without a newpage before the first page?New page at end of subsection (not start!)How to remove Section, SubSection titles?Using renewcommand to define sectionsusing LaTeX pdfpages and geometry packages togetherAutomatic inserting of portrait and landscape pdf documents with pdfpagesHow can I have subsection headers in a separate column while maintaining document structure and control of fonts?Place text tightly above section headerNew subsection definition redefines original subsection numberingIs there a way to have a constant space between the (sub)section number and the heading in the ToC










18















I am embedding full pages from another PDF document (using the pdfpages package), but I would like to be able to declare my own section headings before each embedded document (for e.g. hyperlinking / TOC purposes). pdfpages has an experimental feature which lets me do this, but the problem is that I want to put all of these embedded documents inside a section, so I need to insert a section heading and a subsection heading on the first document I embed. Unfortunately pdfpages doesn't seem to be able to do this. Is there a way for me to do this?



Edit: Thank you for the suggestions. I am also in need of something similar for general labels — at the moment I am abusing the addtolist option of includePDF but the objects I'm labelling aren't really figures or tables.










share|improve this question



















  • 3





    Did you try phantomsectionaddcontentslinetocsectionTitle?

    – egreg
    Apr 17 '11 at 9:37











  • Invisible? I understand the text of your question that you wish to insert your own headings, which I would expect to be visible.

    – Stefan Kottwitz
    Apr 17 '11 at 10:02











  • @Stefan: I can edit the documents being embedded to have the text of the correct heading, but what I really need is for pageref etc. to work correctly.

    – Zhen Lin
    Apr 17 '11 at 10:05











  • I'd like to suggest a different title: TOC entries for included PDF pages or similar. The adjective invisible is misleading.

    – Christian Lindig
    Apr 17 '11 at 11:02






  • 3





    Your problem in Edit is not clear. What needs to be labeled? I'd also suggest to create a new question for this.

    – Christian Lindig
    Apr 17 '11 at 11:42















18















I am embedding full pages from another PDF document (using the pdfpages package), but I would like to be able to declare my own section headings before each embedded document (for e.g. hyperlinking / TOC purposes). pdfpages has an experimental feature which lets me do this, but the problem is that I want to put all of these embedded documents inside a section, so I need to insert a section heading and a subsection heading on the first document I embed. Unfortunately pdfpages doesn't seem to be able to do this. Is there a way for me to do this?



Edit: Thank you for the suggestions. I am also in need of something similar for general labels — at the moment I am abusing the addtolist option of includePDF but the objects I'm labelling aren't really figures or tables.










share|improve this question



















  • 3





    Did you try phantomsectionaddcontentslinetocsectionTitle?

    – egreg
    Apr 17 '11 at 9:37











  • Invisible? I understand the text of your question that you wish to insert your own headings, which I would expect to be visible.

    – Stefan Kottwitz
    Apr 17 '11 at 10:02











  • @Stefan: I can edit the documents being embedded to have the text of the correct heading, but what I really need is for pageref etc. to work correctly.

    – Zhen Lin
    Apr 17 '11 at 10:05











  • I'd like to suggest a different title: TOC entries for included PDF pages or similar. The adjective invisible is misleading.

    – Christian Lindig
    Apr 17 '11 at 11:02






  • 3





    Your problem in Edit is not clear. What needs to be labeled? I'd also suggest to create a new question for this.

    – Christian Lindig
    Apr 17 '11 at 11:42













18












18








18


9






I am embedding full pages from another PDF document (using the pdfpages package), but I would like to be able to declare my own section headings before each embedded document (for e.g. hyperlinking / TOC purposes). pdfpages has an experimental feature which lets me do this, but the problem is that I want to put all of these embedded documents inside a section, so I need to insert a section heading and a subsection heading on the first document I embed. Unfortunately pdfpages doesn't seem to be able to do this. Is there a way for me to do this?



Edit: Thank you for the suggestions. I am also in need of something similar for general labels — at the moment I am abusing the addtolist option of includePDF but the objects I'm labelling aren't really figures or tables.










share|improve this question
















I am embedding full pages from another PDF document (using the pdfpages package), but I would like to be able to declare my own section headings before each embedded document (for e.g. hyperlinking / TOC purposes). pdfpages has an experimental feature which lets me do this, but the problem is that I want to put all of these embedded documents inside a section, so I need to insert a section heading and a subsection heading on the first document I embed. Unfortunately pdfpages doesn't seem to be able to do this. Is there a way for me to do this?



Edit: Thank you for the suggestions. I am also in need of something similar for general labels — at the moment I am abusing the addtolist option of includePDF but the objects I'm labelling aren't really figures or tables.







sectioning hyperref table-of-contents pdfpages






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Apr 17 '11 at 11:27







Zhen Lin

















asked Apr 17 '11 at 9:32









Zhen LinZhen Lin

7081719




7081719







  • 3





    Did you try phantomsectionaddcontentslinetocsectionTitle?

    – egreg
    Apr 17 '11 at 9:37











  • Invisible? I understand the text of your question that you wish to insert your own headings, which I would expect to be visible.

    – Stefan Kottwitz
    Apr 17 '11 at 10:02











  • @Stefan: I can edit the documents being embedded to have the text of the correct heading, but what I really need is for pageref etc. to work correctly.

    – Zhen Lin
    Apr 17 '11 at 10:05











  • I'd like to suggest a different title: TOC entries for included PDF pages or similar. The adjective invisible is misleading.

    – Christian Lindig
    Apr 17 '11 at 11:02






  • 3





    Your problem in Edit is not clear. What needs to be labeled? I'd also suggest to create a new question for this.

    – Christian Lindig
    Apr 17 '11 at 11:42












  • 3





    Did you try phantomsectionaddcontentslinetocsectionTitle?

    – egreg
    Apr 17 '11 at 9:37











  • Invisible? I understand the text of your question that you wish to insert your own headings, which I would expect to be visible.

    – Stefan Kottwitz
    Apr 17 '11 at 10:02











  • @Stefan: I can edit the documents being embedded to have the text of the correct heading, but what I really need is for pageref etc. to work correctly.

    – Zhen Lin
    Apr 17 '11 at 10:05











  • I'd like to suggest a different title: TOC entries for included PDF pages or similar. The adjective invisible is misleading.

    – Christian Lindig
    Apr 17 '11 at 11:02






  • 3





    Your problem in Edit is not clear. What needs to be labeled? I'd also suggest to create a new question for this.

    – Christian Lindig
    Apr 17 '11 at 11:42







3




3





Did you try phantomsectionaddcontentslinetocsectionTitle?

– egreg
Apr 17 '11 at 9:37





Did you try phantomsectionaddcontentslinetocsectionTitle?

– egreg
Apr 17 '11 at 9:37













Invisible? I understand the text of your question that you wish to insert your own headings, which I would expect to be visible.

– Stefan Kottwitz
Apr 17 '11 at 10:02





Invisible? I understand the text of your question that you wish to insert your own headings, which I would expect to be visible.

– Stefan Kottwitz
Apr 17 '11 at 10:02













@Stefan: I can edit the documents being embedded to have the text of the correct heading, but what I really need is for pageref etc. to work correctly.

– Zhen Lin
Apr 17 '11 at 10:05





@Stefan: I can edit the documents being embedded to have the text of the correct heading, but what I really need is for pageref etc. to work correctly.

– Zhen Lin
Apr 17 '11 at 10:05













I'd like to suggest a different title: TOC entries for included PDF pages or similar. The adjective invisible is misleading.

– Christian Lindig
Apr 17 '11 at 11:02





I'd like to suggest a different title: TOC entries for included PDF pages or similar. The adjective invisible is misleading.

– Christian Lindig
Apr 17 '11 at 11:02




3




3





Your problem in Edit is not clear. What needs to be labeled? I'd also suggest to create a new question for this.

– Christian Lindig
Apr 17 '11 at 11:42





Your problem in Edit is not clear. What needs to be labeled? I'd also suggest to create a new question for this.

– Christian Lindig
Apr 17 '11 at 11:42










3 Answers
3






active

oldest

votes


















19














You can create entries in the table of contents (TOC) when importing a PDF. Here is an example:



documentclassarticle
usepackagepdfpages

begindocument
tableofcontents
includepdf[pages=-,addtotoc=
1,section,1,First Section Entry,p1,
1,subsection,1,Subsection Entry,p2,
2,section,1,Second Section Entry,p3]
publishing-logo+layout.pdf
enddocument


Parameters for each TOC entry are:



  • Page number relative to the first page of the included document. Caveat: with pages=3-10, the smaller possible number would be 3.

  • Level for the TOC entry

  • Depth of section (1 for section, 2 for subsection, etc.)

  • TOC entry

  • Label for the entry

You can create two entries for a single page on different levels (like section and subsection). In the example, the first two entries go to the same page. A label (like p2) can be used to refer to a page that is part of the included PDF.



Unfortunately error messages from pdfpages are not helpful when the above list contains errors. I encountered the following error, which was hard to spot:



  • With pages=3-10 the first entry in an addtotoc record must be 3 or larger. It was 1 in my case but the error message wasn't pointing to it.





share|improve this answer

























  • That was exactly what I tried to do, but having two entries for the same page didn't seem to work.

    – Zhen Lin
    Apr 17 '11 at 10:35











  • The third field is for the depth of the section. 1 for section level, 2 for subsection level ...

    – Sohaib Afifi
    Sep 4 '14 at 14:22











  • I don't understand the difference between the "level" and the "depth" parameters of the key. Besides I'm getting the following error (Package pdfpages Warning : There's something wrong with the entries of addtotoc. Not all entries were processed.) when compiling this piece of code : includepdf[pages=1, addtotoc=18,subsection,2,CV,cv]cv.pdf. The .log file isn't more explicit than that either. Could someone help ?

    – oowekyala
    Jul 5 '15 at 16:47











  • Just a guess: when you add a document of one page, you can't have a TOC entry for page 18 of it. Try addtotoc=1,subsection,2,CV,cv.

    – Christian Lindig
    Jul 5 '15 at 17:58


















15














You could use the pagecommand option of includepdf:



includepdf[pages=1,pagecommand=sectiontitle]filename
includepdf[pages=2-]filename


Extend pagecommand as desired. The second includepdf line includes the remaining pages without the page command.



You could also use the pagecommand option for setting hyperlink targets or bookmarks using commands of hyperref or bookmark there and also for addcontentsline of addtocontents if desired.






share|improve this answer

























  • Ah. That's quite clever... but my first document has only one page. (I'm also having trouble with including multi-page PDF documents — not sure if that's a problem with my source material or the package itself...)

    – Zhen Lin
    Apr 17 '11 at 10:01











  • @Zhen Lin: then you can omit the 2nd line. Regarding other trouble with multi-page inclusion you could describe that in another question, perhaps somebody is able to help.

    – Stefan Kottwitz
    Apr 17 '11 at 10:06











  • Genius, this feels like the slightly more elegant way of doing this.

    – Nick Hawes
    May 15 '13 at 22:30






  • 2





    I used egreg's comment above to avoid adding the text title on top of the pdf: includepdf[pages=1,pagecommand=phantomsectionaddcontentslinetocsectiontitle]filename

    – juniper-
    Nov 12 '15 at 13:53



















0














I have multiple pages in the pdf file and pagecommand is putting section title on each and every page and it is changing the section numbering with each page. How do I get to insert the pagecommand only for the first page in a multipage pdf file?





share








New contributor




sridhar T is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















  • Welcome. If you have a new question, please ask it. This space is for answers only.

    – JouleV
    8 mins ago











Your Answer








StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "85"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f15989%2ftoc-entries-and-labels-for-included-pdf-pages%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























3 Answers
3






active

oldest

votes








3 Answers
3






active

oldest

votes









active

oldest

votes






active

oldest

votes









19














You can create entries in the table of contents (TOC) when importing a PDF. Here is an example:



documentclassarticle
usepackagepdfpages

begindocument
tableofcontents
includepdf[pages=-,addtotoc=
1,section,1,First Section Entry,p1,
1,subsection,1,Subsection Entry,p2,
2,section,1,Second Section Entry,p3]
publishing-logo+layout.pdf
enddocument


Parameters for each TOC entry are:



  • Page number relative to the first page of the included document. Caveat: with pages=3-10, the smaller possible number would be 3.

  • Level for the TOC entry

  • Depth of section (1 for section, 2 for subsection, etc.)

  • TOC entry

  • Label for the entry

You can create two entries for a single page on different levels (like section and subsection). In the example, the first two entries go to the same page. A label (like p2) can be used to refer to a page that is part of the included PDF.



Unfortunately error messages from pdfpages are not helpful when the above list contains errors. I encountered the following error, which was hard to spot:



  • With pages=3-10 the first entry in an addtotoc record must be 3 or larger. It was 1 in my case but the error message wasn't pointing to it.





share|improve this answer

























  • That was exactly what I tried to do, but having two entries for the same page didn't seem to work.

    – Zhen Lin
    Apr 17 '11 at 10:35











  • The third field is for the depth of the section. 1 for section level, 2 for subsection level ...

    – Sohaib Afifi
    Sep 4 '14 at 14:22











  • I don't understand the difference between the "level" and the "depth" parameters of the key. Besides I'm getting the following error (Package pdfpages Warning : There's something wrong with the entries of addtotoc. Not all entries were processed.) when compiling this piece of code : includepdf[pages=1, addtotoc=18,subsection,2,CV,cv]cv.pdf. The .log file isn't more explicit than that either. Could someone help ?

    – oowekyala
    Jul 5 '15 at 16:47











  • Just a guess: when you add a document of one page, you can't have a TOC entry for page 18 of it. Try addtotoc=1,subsection,2,CV,cv.

    – Christian Lindig
    Jul 5 '15 at 17:58















19














You can create entries in the table of contents (TOC) when importing a PDF. Here is an example:



documentclassarticle
usepackagepdfpages

begindocument
tableofcontents
includepdf[pages=-,addtotoc=
1,section,1,First Section Entry,p1,
1,subsection,1,Subsection Entry,p2,
2,section,1,Second Section Entry,p3]
publishing-logo+layout.pdf
enddocument


Parameters for each TOC entry are:



  • Page number relative to the first page of the included document. Caveat: with pages=3-10, the smaller possible number would be 3.

  • Level for the TOC entry

  • Depth of section (1 for section, 2 for subsection, etc.)

  • TOC entry

  • Label for the entry

You can create two entries for a single page on different levels (like section and subsection). In the example, the first two entries go to the same page. A label (like p2) can be used to refer to a page that is part of the included PDF.



Unfortunately error messages from pdfpages are not helpful when the above list contains errors. I encountered the following error, which was hard to spot:



  • With pages=3-10 the first entry in an addtotoc record must be 3 or larger. It was 1 in my case but the error message wasn't pointing to it.





share|improve this answer

























  • That was exactly what I tried to do, but having two entries for the same page didn't seem to work.

    – Zhen Lin
    Apr 17 '11 at 10:35











  • The third field is for the depth of the section. 1 for section level, 2 for subsection level ...

    – Sohaib Afifi
    Sep 4 '14 at 14:22











  • I don't understand the difference between the "level" and the "depth" parameters of the key. Besides I'm getting the following error (Package pdfpages Warning : There's something wrong with the entries of addtotoc. Not all entries were processed.) when compiling this piece of code : includepdf[pages=1, addtotoc=18,subsection,2,CV,cv]cv.pdf. The .log file isn't more explicit than that either. Could someone help ?

    – oowekyala
    Jul 5 '15 at 16:47











  • Just a guess: when you add a document of one page, you can't have a TOC entry for page 18 of it. Try addtotoc=1,subsection,2,CV,cv.

    – Christian Lindig
    Jul 5 '15 at 17:58













19












19








19







You can create entries in the table of contents (TOC) when importing a PDF. Here is an example:



documentclassarticle
usepackagepdfpages

begindocument
tableofcontents
includepdf[pages=-,addtotoc=
1,section,1,First Section Entry,p1,
1,subsection,1,Subsection Entry,p2,
2,section,1,Second Section Entry,p3]
publishing-logo+layout.pdf
enddocument


Parameters for each TOC entry are:



  • Page number relative to the first page of the included document. Caveat: with pages=3-10, the smaller possible number would be 3.

  • Level for the TOC entry

  • Depth of section (1 for section, 2 for subsection, etc.)

  • TOC entry

  • Label for the entry

You can create two entries for a single page on different levels (like section and subsection). In the example, the first two entries go to the same page. A label (like p2) can be used to refer to a page that is part of the included PDF.



Unfortunately error messages from pdfpages are not helpful when the above list contains errors. I encountered the following error, which was hard to spot:



  • With pages=3-10 the first entry in an addtotoc record must be 3 or larger. It was 1 in my case but the error message wasn't pointing to it.





share|improve this answer















You can create entries in the table of contents (TOC) when importing a PDF. Here is an example:



documentclassarticle
usepackagepdfpages

begindocument
tableofcontents
includepdf[pages=-,addtotoc=
1,section,1,First Section Entry,p1,
1,subsection,1,Subsection Entry,p2,
2,section,1,Second Section Entry,p3]
publishing-logo+layout.pdf
enddocument


Parameters for each TOC entry are:



  • Page number relative to the first page of the included document. Caveat: with pages=3-10, the smaller possible number would be 3.

  • Level for the TOC entry

  • Depth of section (1 for section, 2 for subsection, etc.)

  • TOC entry

  • Label for the entry

You can create two entries for a single page on different levels (like section and subsection). In the example, the first two entries go to the same page. A label (like p2) can be used to refer to a page that is part of the included PDF.



Unfortunately error messages from pdfpages are not helpful when the above list contains errors. I encountered the following error, which was hard to spot:



  • With pages=3-10 the first entry in an addtotoc record must be 3 or larger. It was 1 in my case but the error message wasn't pointing to it.






share|improve this answer














share|improve this answer



share|improve this answer








edited Feb 24 '16 at 19:40

























answered Apr 17 '11 at 10:10









Christian LindigChristian Lindig

11.5k54365




11.5k54365












  • That was exactly what I tried to do, but having two entries for the same page didn't seem to work.

    – Zhen Lin
    Apr 17 '11 at 10:35











  • The third field is for the depth of the section. 1 for section level, 2 for subsection level ...

    – Sohaib Afifi
    Sep 4 '14 at 14:22











  • I don't understand the difference between the "level" and the "depth" parameters of the key. Besides I'm getting the following error (Package pdfpages Warning : There's something wrong with the entries of addtotoc. Not all entries were processed.) when compiling this piece of code : includepdf[pages=1, addtotoc=18,subsection,2,CV,cv]cv.pdf. The .log file isn't more explicit than that either. Could someone help ?

    – oowekyala
    Jul 5 '15 at 16:47











  • Just a guess: when you add a document of one page, you can't have a TOC entry for page 18 of it. Try addtotoc=1,subsection,2,CV,cv.

    – Christian Lindig
    Jul 5 '15 at 17:58

















  • That was exactly what I tried to do, but having two entries for the same page didn't seem to work.

    – Zhen Lin
    Apr 17 '11 at 10:35











  • The third field is for the depth of the section. 1 for section level, 2 for subsection level ...

    – Sohaib Afifi
    Sep 4 '14 at 14:22











  • I don't understand the difference between the "level" and the "depth" parameters of the key. Besides I'm getting the following error (Package pdfpages Warning : There's something wrong with the entries of addtotoc. Not all entries were processed.) when compiling this piece of code : includepdf[pages=1, addtotoc=18,subsection,2,CV,cv]cv.pdf. The .log file isn't more explicit than that either. Could someone help ?

    – oowekyala
    Jul 5 '15 at 16:47











  • Just a guess: when you add a document of one page, you can't have a TOC entry for page 18 of it. Try addtotoc=1,subsection,2,CV,cv.

    – Christian Lindig
    Jul 5 '15 at 17:58
















That was exactly what I tried to do, but having two entries for the same page didn't seem to work.

– Zhen Lin
Apr 17 '11 at 10:35





That was exactly what I tried to do, but having two entries for the same page didn't seem to work.

– Zhen Lin
Apr 17 '11 at 10:35













The third field is for the depth of the section. 1 for section level, 2 for subsection level ...

– Sohaib Afifi
Sep 4 '14 at 14:22





The third field is for the depth of the section. 1 for section level, 2 for subsection level ...

– Sohaib Afifi
Sep 4 '14 at 14:22













I don't understand the difference between the "level" and the "depth" parameters of the key. Besides I'm getting the following error (Package pdfpages Warning : There's something wrong with the entries of addtotoc. Not all entries were processed.) when compiling this piece of code : includepdf[pages=1, addtotoc=18,subsection,2,CV,cv]cv.pdf. The .log file isn't more explicit than that either. Could someone help ?

– oowekyala
Jul 5 '15 at 16:47





I don't understand the difference between the "level" and the "depth" parameters of the key. Besides I'm getting the following error (Package pdfpages Warning : There's something wrong with the entries of addtotoc. Not all entries were processed.) when compiling this piece of code : includepdf[pages=1, addtotoc=18,subsection,2,CV,cv]cv.pdf. The .log file isn't more explicit than that either. Could someone help ?

– oowekyala
Jul 5 '15 at 16:47













Just a guess: when you add a document of one page, you can't have a TOC entry for page 18 of it. Try addtotoc=1,subsection,2,CV,cv.

– Christian Lindig
Jul 5 '15 at 17:58





Just a guess: when you add a document of one page, you can't have a TOC entry for page 18 of it. Try addtotoc=1,subsection,2,CV,cv.

– Christian Lindig
Jul 5 '15 at 17:58











15














You could use the pagecommand option of includepdf:



includepdf[pages=1,pagecommand=sectiontitle]filename
includepdf[pages=2-]filename


Extend pagecommand as desired. The second includepdf line includes the remaining pages without the page command.



You could also use the pagecommand option for setting hyperlink targets or bookmarks using commands of hyperref or bookmark there and also for addcontentsline of addtocontents if desired.






share|improve this answer

























  • Ah. That's quite clever... but my first document has only one page. (I'm also having trouble with including multi-page PDF documents — not sure if that's a problem with my source material or the package itself...)

    – Zhen Lin
    Apr 17 '11 at 10:01











  • @Zhen Lin: then you can omit the 2nd line. Regarding other trouble with multi-page inclusion you could describe that in another question, perhaps somebody is able to help.

    – Stefan Kottwitz
    Apr 17 '11 at 10:06











  • Genius, this feels like the slightly more elegant way of doing this.

    – Nick Hawes
    May 15 '13 at 22:30






  • 2





    I used egreg's comment above to avoid adding the text title on top of the pdf: includepdf[pages=1,pagecommand=phantomsectionaddcontentslinetocsectiontitle]filename

    – juniper-
    Nov 12 '15 at 13:53
















15














You could use the pagecommand option of includepdf:



includepdf[pages=1,pagecommand=sectiontitle]filename
includepdf[pages=2-]filename


Extend pagecommand as desired. The second includepdf line includes the remaining pages without the page command.



You could also use the pagecommand option for setting hyperlink targets or bookmarks using commands of hyperref or bookmark there and also for addcontentsline of addtocontents if desired.






share|improve this answer

























  • Ah. That's quite clever... but my first document has only one page. (I'm also having trouble with including multi-page PDF documents — not sure if that's a problem with my source material or the package itself...)

    – Zhen Lin
    Apr 17 '11 at 10:01











  • @Zhen Lin: then you can omit the 2nd line. Regarding other trouble with multi-page inclusion you could describe that in another question, perhaps somebody is able to help.

    – Stefan Kottwitz
    Apr 17 '11 at 10:06











  • Genius, this feels like the slightly more elegant way of doing this.

    – Nick Hawes
    May 15 '13 at 22:30






  • 2





    I used egreg's comment above to avoid adding the text title on top of the pdf: includepdf[pages=1,pagecommand=phantomsectionaddcontentslinetocsectiontitle]filename

    – juniper-
    Nov 12 '15 at 13:53














15












15








15







You could use the pagecommand option of includepdf:



includepdf[pages=1,pagecommand=sectiontitle]filename
includepdf[pages=2-]filename


Extend pagecommand as desired. The second includepdf line includes the remaining pages without the page command.



You could also use the pagecommand option for setting hyperlink targets or bookmarks using commands of hyperref or bookmark there and also for addcontentsline of addtocontents if desired.






share|improve this answer















You could use the pagecommand option of includepdf:



includepdf[pages=1,pagecommand=sectiontitle]filename
includepdf[pages=2-]filename


Extend pagecommand as desired. The second includepdf line includes the remaining pages without the page command.



You could also use the pagecommand option for setting hyperlink targets or bookmarks using commands of hyperref or bookmark there and also for addcontentsline of addtocontents if desired.







share|improve this answer














share|improve this answer



share|improve this answer








edited Apr 17 '11 at 10:04

























answered Apr 17 '11 at 9:55









Stefan KottwitzStefan Kottwitz

179k65575763




179k65575763












  • Ah. That's quite clever... but my first document has only one page. (I'm also having trouble with including multi-page PDF documents — not sure if that's a problem with my source material or the package itself...)

    – Zhen Lin
    Apr 17 '11 at 10:01











  • @Zhen Lin: then you can omit the 2nd line. Regarding other trouble with multi-page inclusion you could describe that in another question, perhaps somebody is able to help.

    – Stefan Kottwitz
    Apr 17 '11 at 10:06











  • Genius, this feels like the slightly more elegant way of doing this.

    – Nick Hawes
    May 15 '13 at 22:30






  • 2





    I used egreg's comment above to avoid adding the text title on top of the pdf: includepdf[pages=1,pagecommand=phantomsectionaddcontentslinetocsectiontitle]filename

    – juniper-
    Nov 12 '15 at 13:53


















  • Ah. That's quite clever... but my first document has only one page. (I'm also having trouble with including multi-page PDF documents — not sure if that's a problem with my source material or the package itself...)

    – Zhen Lin
    Apr 17 '11 at 10:01











  • @Zhen Lin: then you can omit the 2nd line. Regarding other trouble with multi-page inclusion you could describe that in another question, perhaps somebody is able to help.

    – Stefan Kottwitz
    Apr 17 '11 at 10:06











  • Genius, this feels like the slightly more elegant way of doing this.

    – Nick Hawes
    May 15 '13 at 22:30






  • 2





    I used egreg's comment above to avoid adding the text title on top of the pdf: includepdf[pages=1,pagecommand=phantomsectionaddcontentslinetocsectiontitle]filename

    – juniper-
    Nov 12 '15 at 13:53

















Ah. That's quite clever... but my first document has only one page. (I'm also having trouble with including multi-page PDF documents — not sure if that's a problem with my source material or the package itself...)

– Zhen Lin
Apr 17 '11 at 10:01





Ah. That's quite clever... but my first document has only one page. (I'm also having trouble with including multi-page PDF documents — not sure if that's a problem with my source material or the package itself...)

– Zhen Lin
Apr 17 '11 at 10:01













@Zhen Lin: then you can omit the 2nd line. Regarding other trouble with multi-page inclusion you could describe that in another question, perhaps somebody is able to help.

– Stefan Kottwitz
Apr 17 '11 at 10:06





@Zhen Lin: then you can omit the 2nd line. Regarding other trouble with multi-page inclusion you could describe that in another question, perhaps somebody is able to help.

– Stefan Kottwitz
Apr 17 '11 at 10:06













Genius, this feels like the slightly more elegant way of doing this.

– Nick Hawes
May 15 '13 at 22:30





Genius, this feels like the slightly more elegant way of doing this.

– Nick Hawes
May 15 '13 at 22:30




2




2





I used egreg's comment above to avoid adding the text title on top of the pdf: includepdf[pages=1,pagecommand=phantomsectionaddcontentslinetocsectiontitle]filename

– juniper-
Nov 12 '15 at 13:53






I used egreg's comment above to avoid adding the text title on top of the pdf: includepdf[pages=1,pagecommand=phantomsectionaddcontentslinetocsectiontitle]filename

– juniper-
Nov 12 '15 at 13:53












0














I have multiple pages in the pdf file and pagecommand is putting section title on each and every page and it is changing the section numbering with each page. How do I get to insert the pagecommand only for the first page in a multipage pdf file?





share








New contributor




sridhar T is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















  • Welcome. If you have a new question, please ask it. This space is for answers only.

    – JouleV
    8 mins ago















0














I have multiple pages in the pdf file and pagecommand is putting section title on each and every page and it is changing the section numbering with each page. How do I get to insert the pagecommand only for the first page in a multipage pdf file?





share








New contributor




sridhar T is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















  • Welcome. If you have a new question, please ask it. This space is for answers only.

    – JouleV
    8 mins ago













0












0








0







I have multiple pages in the pdf file and pagecommand is putting section title on each and every page and it is changing the section numbering with each page. How do I get to insert the pagecommand only for the first page in a multipage pdf file?





share








New contributor




sridhar T is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.










I have multiple pages in the pdf file and pagecommand is putting section title on each and every page and it is changing the section numbering with each page. How do I get to insert the pagecommand only for the first page in a multipage pdf file?






share








New contributor




sridhar T is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.








share


share






New contributor




sridhar T is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









answered 9 mins ago









sridhar Tsridhar T

1




1




New contributor




sridhar T is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





sridhar T is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






sridhar T is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












  • Welcome. If you have a new question, please ask it. This space is for answers only.

    – JouleV
    8 mins ago

















  • Welcome. If you have a new question, please ask it. This space is for answers only.

    – JouleV
    8 mins ago
















Welcome. If you have a new question, please ask it. This space is for answers only.

– JouleV
8 mins ago





Welcome. If you have a new question, please ask it. This space is for answers only.

– JouleV
8 mins ago

















draft saved

draft discarded
















































Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f15989%2ftoc-entries-and-labels-for-included-pdf-pages%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Isabella Eugénie Boyer Biographie | Références | Menu de navigationmodifiermodifier le codeComparator to Compute the Relative Value of a U.S. Dollar Amount – 1774 to Present.

Lioubotyn Sommaire Géographie | Histoire | Population | Notes et références | Liens externes | Menu de navigationlubotin.kharkov.uamodifier« Recensements et estimations de la population depuis 1897 »« Office des statistiques d'Ukraine : population au 1er janvier 2010, 2011 et 2012 »« Office des statistiques d'Ukraine : population au 1er janvier 2011, 2012 et 2013 »Informations officiellesCartes topographiquesCarte routièrem

Mpande kaSenzangakhona Biographie | Références | Menu de navigationmodifierMpande kaSenzangakhonavoir la liste des auteursm