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.

I am a beginner to LaTeX and I have a few problems with the pdfpages package. I have to include certain pages from another file (compile them into a final report). I use the \includepdf{pages = 3-5}{name.pdf} command but this creates two problems for me. Firstly: The numbers are 3,4,5 which do not match the pages of my report (they should start from 5 onwards). Is there a command to do so? Second: I have a section after I which I include the pdf pages. This creates a page with just the section name and blank space till the end and the pdf inclusion starts from the next page. I tried using \includegraphics but that cuts off some of the content of the pdf. Is there another way also?

Edit: solution for the page numbers

Ok, I found a solution which is so simple I am stupid for not reading about it first. I just had to add pagecommand = {} in the options for the includepdf command. This created a problem of having two page numbers on each page which I solved by removing the page numbers from the original document (which I had to add). The problem of the blank page is still there so if anyone has a solution, I would be grateful.

Edit2: MWE:

\documentclass{article} 
\usepackage{enumerate,a4wide,graphicx,pdfpages} 
\title{Final Report} 

\begin{document} 
\section{Workplan} 
\includepdf[pages=3-5,pagecommand={}]{Workplan.pdf} 
\end{document}
share|improve this question
    
Welcome to TeX.sx! Please add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. –  lockstep Mar 5 '13 at 9:45
    
\documentclass{article} \usepackage{enumerate,a4wide,graphicx,pdfpages} \title{Final Report} \begin{document} \section{Workplan} \includepdf[pages=3-5,pagecommand={}]{Workplan.pdf} \end{document} –  Anava Jain Mar 5 '13 at 9:55
add comment

1 Answer

The page numbering problem you have already solved. It remains the first page with the section title. You could use \includegraphics[page=3]{Workplan.pdf}, appropriately scaled, after \section. But because of the section, there is less space on the first page, thus the page probably needs to be scaled down.

An alternative is again using pagecommand:

\begin{document}
\includepdf[
  pages=3,
  pagecommand={\section{Workplan}},
]{Workplan}
\includepdf[
  page=4-5,
  pagecommand={},
]{Workplan}
\end{document}

Depending on the margin settings and the first page of Workplan.pdf the section title may collide with stuff of the embedded page.

If Workplan.pdf is also generated by LaTeX, perhaps including/inputting the TeX source might also be an option.

share|improve this answer
    
Since no particular solution was perfect, I went with making the section heading bold and in the middle of the page and then starting the content from the next page. Thanks for all your help! –  Anava Jain Mar 6 '13 at 9:54
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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