仅从一个(浮动)页面删除页码?

仅从一个(浮动)页面删除页码?

基本上我有一些文字:

\section{Section 1}

TEXT TEXT TEXT

然后我有一张图片:

\begin{figure}
\centering
\includegraphics[scale=0.6]{images/rlexample.png}
\caption{---}
\label{rlexample}
\end{figure}

此图像占用一整页,因此会打印在新页面上。
我希望此页(有图像的地方)没有页码

我之后尝试过这个\end{figure}

\thispagestyle{empty}

但是带有文本的页面也没有页码。

如何才能在带有文本的页面上显示页码,而在带有图像的页面上不显示页码?

答案1

有两种方法:使用afterpage或放入环境\thispagestyle{empty}figure,正如 Peter 所评论的那样。

\documentclass{article}
\usepackage[demo]{graphicx}
\usepackage{afterpage}
\usepackage{lipsum}
\begin{document}
Here is some text with an equation in it: $f(x)=x^2+3x_0\cdot\sin x$
and the textual content continues into the second line. No other math
content is contained within this paragraph.

\afterpage{%
\thispagestyle{empty}
\begin{figure}
\centering
\includegraphics[width=\textwidth]{images/rlexample.png}
\caption{---}
\label{rlexample}
\end{figure}
}

Here is some text with an equation in it: $f(x)=x^2+3x_0\cdot\sin x$
and the textual content continues into the second line. No other math
content is contained within this paragraph.

\lipsum[1-10]

\begin{figure}
\thispagestyle{empty}
\centering
\includegraphics[width=\textwidth]{images/rlexample.png}
\caption{---}
\label{rlexample}
\end{figure}
\lipsum[11-20]
\end{document}

注意:将环境放入thispagestyle{empty}内部可能需要一些适当的位置,如果按照 Enrico 的说明使用,则可能无法正常工作。不过我建议使用。figure\clearpage[p]\begin{figure}[p]afterpage

评论中提供的代码:

\documentclass[a4paper,12pt,oneside]{article}
\usepackage[utf8]{inputenc}

\usepackage{enumerate}
\usepackage[demo]{graphicx}
\usepackage{afterpage}
\usepackage{lipsum}
\usepackage{filecontents}

\begin{filecontents}{\jobname.bib}
@misc{B02,
  author = {Buthor, B.},
  year = {2002},
  title = {Bravo},
}
\end{filecontents}

\title{42}
\author{Jane Doe}
\date{June 2011}

\begin{document}

\maketitle

\section{Introduction}

\subsection{text}

text text \cite{B02} texttext text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text

\afterpage{%
\thispagestyle{empty}
\begin{figure}[p]
\centering
\vspace*{-3cm}
\includegraphics[scale=0.4]{image.jpg}
\caption{caption}
\label{rlexample}
\end{figure}
\clearpage
}

\lipsum[1-10]


\bibliographystyle{plain}
\bibliography{\jobname}
\end{document}

答案2

首先添加包\usepackage{floatpag}

然后你就可以\thisfloatpagestyle{empty}在图形环境中使用了。这将提供一个空白页来放置图形。

相关内容