0

I would like to put a full-page figure with height=\stockheight but the image is not vertically centered (it starts some cm under the top of the page and ends some cm under the bottom) and I can't remove the page header (I would like to keep the page number. Only remove other text like title of paragraph from the page header). I'm using Memoir. I would also like to remove the caption maintaining figure number and a label in it. Can be used \includepdf with some advantages? I've tried but the figure appear OVER text instead of on an independent page.

2 Answers 2

2

I have managed to answer some of your desires taking advantage of @NBur's answer. Basically use the \afterpage macro to put the full height graphic on the next page.

% fullpageprob.tex SE 578678
 
\documentclass{memoir}
\usepackage{graphicx}
\usepackage{hyperref}
\hypersetup{colorlinks}
\usepackage{cleveref}
\usepackage{pdfpages}
\usepackage{afterpage} %% added
\usepackage{lipsum}  %% added

\newcommand{\myimage}{example-image-golden-upright} %% added

\begin{document}
\chapter{A chapter}
\section{A section}

\textbf{LIPSUM 1-6}
\lipsum[1-6]

\textbf{Called here for the full page image.}

\afterpage{\thispagestyle{plain}\clearpage} %% this is the key
\begin{figure}[!p] %% figure on a page by itself
\centering
\begin{picture}(0,0)  %% may need placement adjustment of contents
% \put(-\evensidemargin,-0.5\stockheight){\includegraphics[height=\stockheight]{\myimage}}
% \put(-0.8\textwidth,-0.5\stockheight){\includegraphics[height=\stockheight]{\myimage}}
  \put(-0.65\textwidth,-0.5\stockheight){\includegraphics[height=\stockheight]{\myimage}}
\end{picture}
\end{figure}

\textbf{LIPSUM 7-14}
\lipsum[7-14]
\end{document}
1

Different options are possible…

To keep only the page number, use \thispagestyle{plain}.

For the references, use \steprefcounter{figure} with \label.

\includepdf works well, with the option pagecommand.

I give a try with TikZ.

\documentclass{memoir}
\usepackage{graphicx}
\usepackage{hyperref}
\hypersetup{colorlinks}
\usepackage{cleveref}
\usepackage{pdfpages}
\usepackage{tikz}
\usetikzlibrary{calc,positioning}
\usepackage{lipsum}
\begin{document}
    \section{title1}
    \lipsum[1]
    \begin{figure}
        \centering
        \includegraphics[width=.3\linewidth]{example-image-a}
        \caption{Image A}
        \label{fig:A}
    \end{figure}

    \section{title2}
    \lipsum[2]\par
    With \verb|\includegraphics[height=\stockheight]{example-image-10x16}|
    doesn't work well…
    \thispagestyle{plain}
        \includegraphics[height=\stockheight]{example-image-10x16}
        \refstepcounter{figure}
        \label{fig:test}

    \lipsum[4]\par
    With \verb|\includepdf[pagecommand={\thispagestyle{plain}}]{example-image-10x16}|
    Fine. Page number overlays on the picture.
    \includepdf[pagecommand={\thispagestyle{plain}\refstepcounter{figure}\label{fig:test2}}]{example-image-10x16}

    \lipsum[5]\par
    With \verb|\includepdf[pagecommand={\thispagestyle{empty}}]{example-image-10x16}|
    No page number
    \includepdf[pagecommand={\thispagestyle{empty}\refstepcounter{figure}\label{fig:test3}}]{example-image-10x16}
    
    \clearpage
    \thispagestyle{plain}
    \begin{tikzpicture}[overlay, remember picture]
    \node at (current page.north) [anchor=north] {\includegraphics[height=\stockheight]{example-image-10x16}};
    \node [color=white] at ($(current page.north)!.5!(current page.center)$) {\Huge\bfseries With TikZ!};
    \end{tikzpicture}
    
    \clearpage
    \section{title3}
    \lipsum[3]
    
    Check if ref work: \cref{fig:A}, \cref{fig:test}, \cref{fig:test2}, \cref{fig:test3}.
\end{document}

enter image description here

3
  • Thank you very much. But please help me a little more... I like your solution \includepdf[pagecommand={\thispagestyle{plain}}]{example-image-10x16} but I have put this command and the figure appear OVER the normal text instead of in a dedicated page. What's wrong? Must I put other code from yours? Commented Jan 13, 2021 at 16:32
  • Maybe try a \clearpage before the \includepdf?
    – NBur
    Commented Jan 13, 2021 at 16:39
  • I would like to maintain the advantages of having a floating environment, not breaking the chapter in two but having the text flowing from page x-1 to page x+1 without interruptions. I simply want a figure that fill the page instead of being inside the page. Now it require all the page, but not filling it. I want the image to be bigger, filling the page. Commented Jan 13, 2021 at 17:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .