[Tex/LaTex] pdfpages doesn’t center pdf on page, using Thesis.cls

horizontal alignmentpdfpagesthesis

I am using the Thesis-template from http://www.latextemplates.com/template/masters-doctoral-thesis.

I have several LaTeX-documents to include in the Appendix. The best solution seems to be compiling each document and using pdfpages to include them. I tried combine, but there were too many conflicts.

The problem is that, although default pdfpages-behaviour should be to center the pdf on the page, it places it in the top-left corner.

Trying to offset it displaces the pages unevenly, as I am using twosided page layout.

I assume this is due to a conflict with the Thesis.cls, that it somehow removes any margins and applies it manually for only its own elements.

Any idea how I could either:

  • Use the offset to place the document appropriately
  • Introduce margins for just the pages with the PDF.

Usage:

\includepdfset{pages=-,pagecommand=\thispagestyle{fancy}}

\includepdf[fitpaper=true]{./../Forstudierapport/forstudierapport.pdf}

Result:

As you can see, the header is properly placed, but the PDF is displaced.

Image of the page

Notes:

\usepackage{geometry} removes margins from the entire document.

Env: Using BasicTeX 2011 from MacTeX. I'm on Mac OS X.7.

Best Answer

The main problem is that Thesis.cls uses vmargin to set the page parameters. This package is incompatible with pdfpages, unfortunately; actually it's incompatible with atbegshi which is called by eso-pic.

I know because I found the same issue when some user had similar problems with my frontespizio package that uses atbegshi.

You should try and persuade the authors to use geometry: it's not a big deal to change the few relevant lines in Thesis.cls.

The same setting can be obtained with geometry with

\usepackage{geometry}
\geometry{includehead,includefoot,
  left=1.5in,right=1.0in,
  top=0.6in,bottom=0.8in,
  headheight=20pt,headsep=0.25in,
  footskip=0.3in}