0

I have two pages consisting of two groups of related figures using the floating commands. I want to remove the page number on the second page of these two. I have tried this page using afterpage

and tried this as well using floatpag package but it makes all my other figures grouped and move towards each other which I do not want. So, I only want to remove the page number (page 87 or move this page 87 to the top) of these specific two pages of the two-page floating figures (keep page number 86). Please see the pictures below. enter image description here

enter image description here.

MK Huda
  • 103
  • 2
    see also https://tex.stackexchange.com/questions/427572/remove-header-footer-on-page-with-large-figure Note that everypage can now be replaced with \AddToHook{shipout/background}{...}. – John Kormylo May 16 '22 at 03:53
  • @JohnKormylo I have checked and tried to use it. It does remove the page number, but it removes page 86 instead of 87. I have tried putting \AddThispageHook{\thispagestyle{empty}} before \begin{figure} on the page 86, on the page 87 or both , but still does not remove page number 87. any suggestion? – MK Huda May 16 '22 at 10:32
  • An MWE would have been nice, but I'll se what I can do. – John Kormylo May 16 '22 at 14:24

2 Answers2

2

As before, \afterpage doesn't work on float pages, and \AddThispageHook only delays one page.

This checks for a specific page number, which is calculated assuming the first float occurs on the next page. (Or you could just insert the right page number for \specialpage.)

\documentclass{article}
\usepackage{afterpage}
\usepackage{lipsum}% MWE only

\begin{document} \begin{figure}[p] \rule{\textwidth}{0.8\textheight} \caption{This should be on page 2} \end{figure} \begin{figure}[p] \rule{\textwidth}{0.8\textheight} \caption{This should be on page 3} \end{figure} \edef\specialpage{\the\numexpr \value{page}+1}% \speacialpage=2 \AddToHook{shipout/after}{\ifnum\value{page}=\specialpage\relax \thispagestyle{empty}% \fi}

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

John Kormylo
  • 79,712
  • 3
  • 50
  • 120
0

I have managed to make it work using the suggestion of @John Kormylo. This is my code:

\begin{figure}[p]
 \centering
 \begin{subfigure}[b]{0.45\textwidth}
     \centering
     \includegraphics[width=\textwidth]{Scatter_plot_scRNA_spatial.jpeg}
     \caption{Total read counts}
     \label{scRNA_spatial}
 \end{subfigure}
 \hfill
 \begin{subfigure}[b]{0.45\textwidth}
     \centering
     \includegraphics[width=\textwidth]{scatter_spatial_gene_remaining.jpeg}
     \caption{Total read counts}
     \label{remaining_gene}
 \end{subfigure}

\hfill \ \begin{subfigure}[b]{0.45\textwidth} \centering \includegraphics[width=\textwidth]{scatter_cluster_0_spatial.jpeg} \caption{scRNA-seq cluster 0} \label{cluster 0} \end{subfigure} \hfill \begin{subfigure}[b]{0.45\textwidth} \centering \includegraphics[width=\textwidth]{scatter_cluster_1_spatial.jpeg} \caption{scRNA-seq cluster 1} \label{cluster 1} \end{subfigure}

\hfill \ \begin{subfigure}[b]{0.45\textwidth} \centering \includegraphics[width=\textwidth]{scatter_cluster_2_spatial.jpeg} \caption{scRNA-seq cluster 2} \label{cluster 2} \end{subfigure} \hfill \begin{subfigure}[b]{0.45\textwidth} \centering \includegraphics[width=\textwidth]{scatter_cluster_3_spatial.jpeg} \caption{scRNA-seq cluster 3} \label{cluster 3} \end{subfigure} \end{figure}

\begin{figure}[p] \ContinuedFloat
\centering
\begin{subfigure}[b]{0.45\textwidth} \centering \includegraphics[width=\textwidth]{scatter_cluster_4_spatial.jpeg} \caption{scRNA-seq cluster 4} \label{cluster 4} \end{subfigure} \hfill \begin{subfigure}[b]{0.45\textwidth} \centering \includegraphics[width=\textwidth]{scatter_cluster_5_spatial.jpeg} \caption{scRNA-seq cluster 5} \label{cluster 5} \end{subfigure}

\hfill \ \begin{subfigure}[b]{0.45\textwidth} \centering \includegraphics[width=\textwidth]{scatter_cluster_6_spatial.jpeg} \caption{scRNA-seq cluster 6} \label{cluster 6} \end{subfigure} \hfill \begin{subfigure}[b]{0.45\textwidth} \centering \includegraphics[width=\textwidth]{scatter_cluster_7_spatial.jpeg} \caption{scRNA-seq cluster 7} \label{cluster 7} \end{subfigure}

\hfill \ \begin{subfigure}[b]{0.45\textwidth} \centering \includegraphics[width=\textwidth]{scatter_cluster_8_spatial.jpeg} \caption{scRNA-seq cluster 8} \label{cluster 8} \end{subfigure} \hfill \begin{subfigure}[b]{0.45\textwidth} \centering \includegraphics[width=\textwidth]{scatter_cluster_9_spatial.jpeg} \caption{scRNA-seq cluster 9} \label{cluster 9} \end{subfigure} \caption{Scatter plots of gene read counts in Visium and scRNA-seq data (a). Read counts of genes expressed only in Visium data (b). Scatter plots for gene read counts in each cluster of scRNA-seq and in Visium data (c, d, e, f, g, h, i, j, k, l).} \label{scRNA clusters} \end{figure} \edef\specialpage{\the\numexpr \value{page}+1} \AddToHook{shipout/after}{\ifnum\value{page}=\specialpage\relax \thispagestyle{empty} \fi} }

MK Huda
  • 103