18

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}

%=======================================================
24

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>}.

  • 5
    pagecommand={} should be sufficient. – Lev Bishop Apr 2 '12 at 0:53
9

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}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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