1

I'm writing a document in A4 paper size with specified margins. I want to insert a pdf page from an external document. This external document page size is 13.97 x 21.59 cm. I'd like to insert this page disconsidering the margins and occuping the whole paper width or paper height (depending of the scalation). However all my attempts are inside the margins or outside them. How can I fit the 7th page of this document correctly in my text?

\documentclass[12pt,a4paper]{article}
\usepackage{blindtext}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx,graphics}
\usepackage[%
left=3.00cm,
right=2.00cm,
top=3.00cm,
bottom=2.00cm
]{geometry}
\begin{document}
\includegraphics[width=\linewidth,page=7]{pdf-FastDNA-Spin}\par
%
\includegraphics[height=\textheight,page=7]{pdf-FastDNA-Spin}\par
%
\includegraphics[width=\paperwidth,page=7]{pdf-FastDNA-Spin}\par
%
\includegraphics[height=\paperheight,page=7]{pdf-FastDNA-Spin}
\end{document}

Extra questions Why the first page is empty? How can I remove the page numbering in the page where the pdf is inserted but continue numbering the whole document?

Example of \includegraphics[width=\paperwidth,page=7]{pdf-FastDNA-Spin}

enter image description here

  • You may use something like a TikZ overlay. – TeXnician Oct 20 '17 at 17:01
  • @TeXnician could you post an example? – Daniel Valencia C. Oct 20 '17 at 17:02
  • \usepackage{tikz} and then in the document \tikz[overlay,remember picture] \node at (current page.center) {\includegraphics[height=\textheight,page=7]{yourfilehere}}; (remember to do necessary page breaks). – TeXnician Oct 20 '17 at 17:05
  • Isn't this precisely what the pdfpages package does? – John Kormylo Oct 21 '17 at 15:23
3

You get the empty first page because your graphic is a bit too large to fit on the page and so TeX moves it to the next page to try if it fits there. Then it gives up, inserts the graphic and complains:

  Overfull \vbox (0.80116pt too high) has occurred while \output is active []

Beside this: Use the pdfpages package to insert your PDF. The package has lots of options to configure the input. It will also suppress the page number (by setting \thispagestyle{empty}).

\documentclass[12pt,a4paper]{article}
\usepackage{blindtext}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx,graphics}
\usepackage[%
left=3.00cm,
right=2.00cm,
top=3.00cm,
bottom=2.00cm
]{geometry}
\usepackage{pdfpages}

\begin{document}
\includepdf[pages=7]{FastDNA}
\includepdf[pages=7,noautoscale]{FastDNA}
\includepdf[pages=7,fitpaper=true]{FastDNA} %changes paper size

\end{document}

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.