0

I have a tall figure that I want to appear on a separate page, but NOT at the very end of the article, and want smaller top and bottom margins only for that float page. I can use \begin{figure}[p] to put it on a float page.

I did try tricks such as \newgeometry ... \restoregeometry but they either cut the text on the previous page (see MWE below), or affect the margins on the page before/after (I couldn't reproduce this one in the MWE). In the MWE below the text on the 2nd page is cut, showing only 4 lines of text, then I get the figure on the next page, then text again. I'd like the text to still flow normally, i.e. the 2nd page to have full text.

\documentclass[12pt,a4paper,oneside]{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{blindtext}
\usepackage[left=1.8in,right=1.8in,top=1.75in,bottom=1.65in]{geometry}
\begin{document}
  \blindtext[1]
  \blindtext[1]
  \blindtext[1]
  \blindtext[1]
  \newgeometry{top=10mm, bottom=15mm}
  \begin{figure}
  \includegraphics[height=10cm]{image.png}
  \caption{bleh}
  \end{figure}
  \restoregeometry
  \blindtext[1]
  \blindtext[1]
  \blindtext[1]
  \blindtext[1]
  \blindtext[1]
\end{document}

Without \newgeometry I can get/emulate a smaller top margin by using negative \vspace and still have the text flow without being cut on the previous page, but the bottom margin is the biggest culprit, because I want to push the page number lower.

I'd be grateful for some hints.

  • Does \enlargethispage{1cm} work? – user121799 Jul 31 '18 at 16:12
  • The use of \newgeometry ... \restoregeometry should be fine. Could you please create a MWE that reproduces the problem you described (that this method affects the page before and after too)? – Ruixi Zhang Jul 31 '18 at 16:12
  • @RuixiZhang I added an MWE which shows the text on the previous page is cut (I couldn't reproduce the prev/next page margin problem). I'd still be happy if I could fix that problem. – Normadize Jul 31 '18 at 16:34
  • @marmot no, it doesn't – Normadize Jul 31 '18 at 16:38
1

Part of the problem is that \blindtext creates a large single paragraph instead of multiple paragraphs.

I'm not sure why, but the extra \clearpage at the end appears to be needed. I did notice that afterpage redefines \clearpage internally.

\documentclass[12pt,a4paper,oneside]{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{lipsum}
\usepackage[left=1.8in,right=1.8in,top=1.75in,bottom=1.65in]{geometry}
\usepackage{afterpage}
\begin{document}
  \lipsum[1-3]
  \afterpage{\newgeometry{top=10mm, bottom=15mm}
    \begin{figure}[p]
      \includegraphics[height=10cm]{example-image}
      \caption{bleh}
    \end{figure}
    \restoregeometry\clearpage}
  \lipsum[4-10]
\end{document}

This solution overlays a minipage and footer on an otherwise empty page. The firat \raisebox together with the \vfills move to the center of the revised text area. The second \raisebox does the footer, assuming that geometry wouldn't have changed \footskip.

\documentclass[12pt,a4paper,oneside]{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{lipsum}
\usepackage[left=1.8in,right=1.8in,top=1.75in,bottom=1.65in,showframe]{geometry}
\usepackage{afterpage}

\makeatletter
\newcommand{\setcaptype}[1]% #1 = figure or table
  {\def\@captype{#1}}
\makeatother

\begin{document}
  \lipsum[1-3]
  \afterpage{\clearpage\thispagestyle{empty}
    \null\vfill
    \noindent\raisebox{\dimexpr 1.75in-1.65in}[10mm][15mm]% center of new text area
      {\begin{minipage}[c]{\textwidth}
        \setcaptype{figure}
        \includegraphics[height=10cm]{example-image}
        \caption{bleh}
     \end{minipage}}
    \vfill% add footer manually
    \noindent\raisebox{\dimexpr 15mm-1.65in-\footskip}[0pt][0pt]{\makebox[\textwidth][c]{\thepage}}
    \newpage}
  \lipsum[4-10]
\end{document}
| improve this answer | |
  • Sorry, that was my bad: the actual MWE i wrote had four \blindtext[1] which I changed to \blindtext[4] when I posted without checking. Apologies! Fixed the MWE. The problem I describe is in fact there. The \clearpage does not fix it for me. – Normadize Jul 31 '18 at 20:20
  • hmmm, using several \blindtext[1] instead of \lipsum[1-4] behaves differently. Text is cut in the former but not latter case. The latter puts the figure kind of where it should be, but the next page has no page number. In my article the text is cut though. – Normadize Aug 1 '18 at 12:39
  • I didn't notice the page number was missing. I was just happy that the column was ending at the right place. Alas, this deals with the intertices of \output and \afterpage which are beyond me. It really would be easier to just overlay the margins for one page. – John Kormylo Aug 1 '18 at 13: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.