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 writing my thesis. I have a "main" LaTeX file from where I am calling (attaching) pdf file. But the attached pdf file is not showing any page number. Also, it is not showing other page style I have (like, color vertical box at right end of the page, for chapter name). How this problem can be solved ?

%=======================================

\documentclass[11pt, b5paper,twoside, svgnames]{thesis}

% "thesis" uses book class

\usepackage{pdfpages}
\usepackage{hyperref}


%---------------------------------------------------------

\begin{document}

\chapter{RESULTS}
\includepdf[scale=0.9, pages={-}]{results.pdf}


\end{document}



%======================================
% HEADER and FOOTER
%---------------------------------------

\usepackage{fancyhdr}


\pagestyle{fancy}
\fancyfoot{}
\fancyhead{}

\fancyhf{}
\renewcommand{\headrulewidth}{0pt}
\fancyfoot[RO]{\thepage}{\slshape \rightmark}
\fancyfoot[LE]{\thepage}{\slshape \leftmark}

%=======================================================
share|improve this question

2 Answers 2

up vote 16 down vote accepted

Using your current settings, the pdfpages inserts the pages of an external PDF file as full page additions to your existing document. That is, the external file page setup is copied to the "main" output PDF on a page-by-page basis. The "main" file's page setup (including header/footer) is ignored.

If you wish to include the same header/footer style of your main document for each of the \includepdf pages, then you need to specify this using the pagecommand key-value:

\documentclass{book}
\usepackage{pdfpages}% http://ctan.org/pkg/pdfpages
\usepackage{fancyhdr}% http://ctan.org/pkg/fancyhdr
\fancyhf{}
\renewcommand{\headrulewidth}{0pt}
\fancyfoot[RO]{\thepage}
\fancyfoot[LE]{\thepage}
\pagestyle{fancy}
\begin{document}
\chapter{Something}
\includepdf[scale=0.9,pages={-},pagecommand={\thispagestyle{fancy}}]{results}
\end{document}

Also note that fancyhdr's \fancyhead and \fancyfoot only takes one mandatory argument: \fancyfoot[<page spec>]{<stuff>}.

share|improve this answer
2  
pagecommand={} should be sufficient. –  Lev Bishop Apr 2 '12 at 0:53

By default pdfpages uses the options pagecommand={\thispagestyle{empty}}.

if you want the pagestyle on the included pages you need to call includepdf like :

 \includepdf[scale=0.9,pages={-},pagecommand={\thispagestyle{fancy}}]{results.pdf}
share|improve this answer

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.