我遇到了不必要的空白页的问题(特别是在附录中)。
我尝试重现一个最小的例子。
%------------------------------------------------------------
\documentclass[headings=standardclasses]{scrartcl}
\usepackage{geometry}
\geometry{a4paper,left=25mm,right=25mm, top=20mm, bottom=25mm}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{bm}
\usepackage[pdftex]{graphicx}
\usepackage{rotating}
\usepackage{pdfpages}
\usepackage{pdflscape}
\usepackage{float}
\usepackage[title]{appendix}
% to fit large table (change geometry of single page)
\usepackage{afterpage}
\usepackage{lipsum}
\usepackage[utf8]{inputenc}
\usepackage{subcaption}
\captionsetup{compatibility=false}
\begin{document}
\thispagestyle{empty}
\begin{flushleft}
\huge \textbf{Report} \\
\vspace{\baselineskip}
\normalsize
June 2021 \\
\vspace{\baselineskip}
\textsc{Author}
\vspace{\baselineskip}
\end{flushleft}
\section{Introduction}
\lipsum[2-3]
% ...
% ...
% ...
\begin{landscape}
\begin{appendices}
\section{Results}
\begin{tabular}{c|c}
523 & 532 \\
532 & 123
\end{tabular}
\newpage \begin{tabular}{c|c}
523 & 532 \\
532 & 123
\end{tabular}
\newpage
\section{Histograms}
\begin{figure}[ht]
\begin{subfigure}{\textwidth}
\includegraphics[scale=0.5]{example-image-a}
\end{subfigure} \\
\begin{subfigure}{\textwidth}
\includegraphics[scale=0.5]{example-image-a}
\end{subfigure}
\begin{subfigure}{\textwidth}
\includegraphics[scale=0.5]{example-image-a}
\end{subfigure} \\
\begin{subfigure}{\textwidth}
\includegraphics[scale=0.5]{example-image-a}
\end{subfigure}
\begin{subfigure}{\textwidth}
\includegraphics[scale=0.5]{example-image-a}
\end{subfigure}
\caption{Histograms}
\end{figure}
\end{appendices}
\end{landscape}
\end{document}
以下是我所遇到的问题的两张图片(来自我的原始文件)。
第一个空白页(在我的最小示例中无法重现这一点):
我怀疑空白页的出现是因为内容无法放在同一页中。如果可以解决问题,我愿意缩小尺寸。我尝试了多种方法,但就是无法解决问题。
任何帮助都将不胜感激;谢谢阅读!
答案1
改为[ht]
似乎[ht!]
可以解决问题:
%------------------------------------------------------------
\documentclass[headings=standardclasses]{scrartcl}
\usepackage{geometry}
\geometry{a4paper,left=25mm,right=25mm, top=20mm, bottom=25mm}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{bm}
\usepackage[pdftex]{graphicx}
\usepackage{rotating}
\usepackage{pdfpages}
\usepackage{pdflscape}
\usepackage{float}
\usepackage[title]{appendix}
% to fit large table (change geometry of single page)
\usepackage{afterpage}
\usepackage{lipsum}
\usepackage[utf8]{inputenc}
\usepackage{subcaption}
\captionsetup{compatibility=false}
\begin{document}
\thispagestyle{empty}
\begin{flushleft}
\huge \textbf{Report} \\
\vspace{\baselineskip}
\normalsize
June 2021 \\
\vspace{\baselineskip}
\textsc{Author}
\vspace{\baselineskip}
\end{flushleft}
\section{Introduction}
\lipsum[2-3]
% ...
% ...
% ...
\begin{landscape}
\begin{appendices}
\section{Results}
\begin{tabular}{c|c}
523 & 532 \\
532 & 123
\end{tabular}
\newpage \begin{tabular}{c|c}
523 & 532 \\
532 & 123
\end{tabular}
\newpage
\section{Histograms}
\begin{figure}[ht!]
\begin{subfigure}{\textwidth}
\includegraphics[scale=0.5]{example-image-a}
\end{subfigure} \\
\begin{subfigure}{\textwidth}
\includegraphics[scale=0.5]{example-image-a}
\end{subfigure}
\begin{subfigure}{\textwidth}
\includegraphics[scale=0.5]{example-image-a}
\end{subfigure} \\
\begin{subfigure}{\textwidth}
\includegraphics[scale=0.5]{example-image-a}
\end{subfigure}
\begin{subfigure}{\textwidth}
\includegraphics[scale=0.5]{example-image-a}
\end{subfigure}
\caption{Histograms}
\end{figure}
\end{appendices}
\end{landscape}
\end{document}