如何删除部分页面,同时保留右上角的部分文本?
删除\section*{Figure A}%
会导致
\documentclass[12pt,landscape,titlepage]{article}%
\usepackage[T1]{fontenc}%
\usepackage[utf8]{inputenc}%
\usepackage{lmodern}%
\usepackage{textcomp}%
\usepackage{lastpage}%
\usepackage[a4paper,left=1cm,right=1cm,top=3cm,bottom=3cm,headheight=3em]{geometry}%
\usepackage{xcolor}%
\usepackage{graphicx}%
\usepackage[english]{babel}%
\usepackage{blindtext}%
\usepackage{xpatch}%
\usepackage{floatrow}%
\usepackage{caption}%
\usepackage{fancyhdr}%
\usepackage{titlesec}%
%
\xpretocmd{\section}{\thispagestyle{plain}}{}{}%
\pagecolor{darkgray}%
\pagecolor{white}%
\color{darkgray}%
\pagestyle{fancy}%
\title{Jane Q}%
\author{Subtitle | 2022}%
\date{}%
\rhead{Jane Q}%
\fancyhf{}%
\fancyhead{}%
\renewcommand{\headrulewidth}{0pt}%
\fancyhead[RO]{{Jane Q}\\\vspace{0.5em}\underline{\leftmark}\\\vspace{0.05em}\rightmark}%
\renewcommand\sectionmark[1]{\markboth{#1}{\mysubtitle}}%
\titleclass{\section}{page}%
\assignpagestyle{\section}{empty}%
\titleformat{\section}[display]{\centering\Huge\bfseries}{\sectionname}{0pt}{\huge}[\clearpage]%
\newcommand{\subtitle}[1]{\gdef\mysubtitle{#1}\ignorespaces}%
%
\begin{document}%
\normalsize%
\maketitle%
\subtitle{2022}%
\section*{Figure A}%
\pagebreak%
\begin{figure}%
\includegraphics[width=\textwidth]{example-image-a}
}%
\end{figure}%
\pagebreak%
\begin{figure}%
\floatbox[{\capbeside\thisfloatsetup{capbesideposition={right,top},capbesidewidth=8cm}}]{figure}[\FBwidth]{\caption*{2022\\10 x 10 cm\\Pencil on paper\\~\\}}{\includegraphics[width=\linewidth,height=\textheight,keepaspectratio]{example-image-a}}%
\end{figure}%
\pagebreak%
\subtitle{2022}%
\section*{Figure B}%
\pagebreak%
\begin{figure}%
\includegraphics[width=\linewidth,height=\textheight,keepaspectratio]{example-image-b}%
\end{figure}%
\pagebreak%
\begin{figure}%
\floatbox[{\capbeside\thisfloatsetup{capbesideposition={right,top},capbesidewidth=8cm}}]{figure}[\FBwidth]{\caption*{2022\\10 x 10 cm\\Pencil on paper\\~\\}}{\includegraphics[width=\linewidth,height=\textheight,keepaspectratio]{example-image-b}}%
\end{figure}%
\pagebreak%
\end{document}
答案1
将 替换\section*
为仅设置 的某个东西(我称之为\fakesection*
)\sectionmark
。我还添加了一个\clearpage
,这样图形就不会移动到下一个\fakesection
,但出于这个原因,也许您应该将部分或所有\pagebreak
命令更改为 `\clearpage。
\documentclass[12pt,landscape,titlepage]{article}%
\usepackage[T1]{fontenc}%
\usepackage[utf8]{inputenc}%
\usepackage{lmodern}%
\usepackage{textcomp}%
\usepackage{lastpage}%
\usepackage[a4paper,left=1cm,right=1cm,top=3cm,bottom=3cm,headheight=3em]{geometry}%
\usepackage{xcolor}%
\usepackage{graphicx}%
\usepackage[english]{babel}%
\usepackage{blindtext}%
\usepackage{xpatch}%
\usepackage{floatrow}%
\usepackage{caption}%
\usepackage{fancyhdr}%
\usepackage{titlesec}%
%
\xpretocmd{\section}{\thispagestyle{plain}}{}{}%
\pagecolor{darkgray}%
\pagecolor{white}%
\color{darkgray}%
\pagestyle{fancy}%
\title{Jane Q}%
\author{Subtitle | 2022}%
\date{}%
\rhead{Jane Q}%
\fancyhf{}%
\fancyhead{}%
\renewcommand{\headrulewidth}{0pt}%
\fancyhead[RO]{{Jane Q}\\\vspace{0.5em}\underline{\leftmark}\\\vspace{0.05em}\rightmark}%
\renewcommand\sectionmark[1]{\markboth{#1}{\mysubtitle}}%
\titleclass{\section}{page}%
\assignpagestyle{\section}{empty}%
\titleformat{\section}[display]{\centering\Huge\bfseries}{\sectionname}{0pt}{\huge}[\clearpage]%
\newcommand{\subtitle}[1]{\gdef\mysubtitle{#1}\ignorespaces}%
%
\newcommand{\fakesection}[2]{\clearpage\sectionmark{#2}} % #1 is to absorb the *
\begin{document}%
\normalsize%
\maketitle%
\subtitle{2022}%
\fakesection*{Figure A}%
\pagebreak%
\begin{figure}%
\includegraphics[width=\textwidth]{example-image-a}
%}% <<<<<<<<<<<<< Spurious } removed
\end{figure}%
\pagebreak%
\begin{figure}%
\floatbox[{\capbeside\thisfloatsetup{capbesideposition={right,top},capbesidewidth=8cm}}]{figure}[\FBwidth]{\caption*{2022\\10 x 10 cm\\Pencil on paper\\~\\}}{\includegraphics[width=\linewidth,height=\textheight,keepaspectratio]{example-image-a}}%
\end{figure}%
\pagebreak%
\subtitle{2022}%
\fakesection*{Figure B}%
\pagebreak%
\begin{figure}%
\includegraphics[width=\linewidth,height=\textheight,keepaspectratio]{example-image-b}%
\end{figure}%
\pagebreak%
\begin{figure}%
\floatbox[{\capbeside\thisfloatsetup{capbesideposition={right,top},capbesidewidth=8cm}}]{figure}[\FBwidth]{\caption*{2022\\10 x 10 cm\\Pencil on paper\\~\\}}{\includegraphics[width=\linewidth,height=\textheight,keepaspectratio]{example-image-b}}%
\end{figure}%
\pagebreak%
\end{document}