0

For my thesis I have generated a big set of pdf images that I would like to include in the text. One of the images in particular is a full page pdf file that is larger than the margins used for the general document. The geometry is currently set as a4paper and it cannot be adapted since it is the obligatory style.

I am currently including the includepdf feature and this returns me the result displayed in the image. The problem that I am having is that I cannot fit the caption in the right place. Currently I am using vspace to set the location of the caption but when I go under a certain value it moves the caption to another page. I believe this has to do with the geometry on which the pages are made, hence I think that changing it for one page could do the trick. I, however, do not know how to achieve this.

Thanks a lot!

  • the command for this is \newgeometry and when the changes should be reverted \restoregeometry. – Skillmon Apr 19 '17 at 11:29
  • 3
    It's not entirely clear to me what you are asking. It would already help if you actually post the image you refer to in your question. It would also help if you give a minimal working example (MWE) of what you are doing. In this MWE you can include your failed attempt, and indicate what this minimum value for vspace is. – Yuri Robbers Apr 19 '17 at 11:31
1

It is easier to overlay the margins than change them. (Don't forget to run this twice.)

\documentclass[a4paper]{article}
\usepackage{tikz}
\usepackage{lipsum}
\begin{document}
\begin{figure}[p]
  \begin{minipage}[c][\textheight][s]{\textwidth}
    \begin{tikzpicture}[remember picture, overlay]
    \node[inner sep=0pt] at (current page.center)
      {\includegraphics[height=\paperheight,width=\paperwidth]{example-image}};
% or (\includegraphics[page=1]{filename.pdf}}:
    \end{tikzpicture}
    \vfill\caption{Caption goes here}
  \end{minipage}
\end{figure}

\lipsum[1-8]
\end{document}

Here is a solution using \newgeometry. There were some interesting conflicts between \afterpage and \restoregeometry, and the only way I could get the page number onto the third page was to add it directly.

\documentclass[a4paper]{article}
\usepackage[showframe]{geometry}
\usepackage{afterpage}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{lipsum}% MWE only

\begin{document}
\afterpage{\clearpage
\newgeometry{left=0pt,right=0pt,top=0pt,bottom=0pt,nofoot}%
\noindent\rlap{\includegraphics[height=.999\textheight,width=.999\textwidth]{example-image}}%
% or \includegraphics[page=1]{filename.pdf}
\begin{minipage}[b]{\textwidth}
  \captionof{figure}{Caption goes here}
\end{minipage}%
\restoregeometry
\rlap{\raisebox{\dimexpr \topskip-\textheight-\footskip}[0pt][0pt]{\makebox[\textwidth][c]{\thepage}}}%
\vspace{-\baselineskip}}
\lipsum[1-16]
\end{document}
  • I don't think this is easier than \newgeometry{left=0pt,right=0pt,top=0pt,bottom=0pt}...\restoregeometry but it works nice. – Skillmon Apr 20 '17 at 7:22
  • Ah, but you can't do it inside a figure. – John Kormylo Apr 20 '17 at 12:42
  • But you don't need a figure, since you want to give it a fixed place anyway. – Skillmon Apr 20 '17 at 12:59

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.