![横向之前的空白(\afterpage 不起作用)](https://linux22.com/image/403720/%E6%A8%AA%E5%90%91%E4%B9%8B%E5%89%8D%E7%9A%84%E7%A9%BA%E7%99%BD%EF%BC%88%5Cafterpage%20%E4%B8%8D%E8%B5%B7%E4%BD%9C%E7%94%A8%EF%BC%89.png)
如何消除横向页面前的空白?如下所述:删除横向之前的空白,\afterpage 对我来说不起作用。请参阅下面的示例。
\documentclass[a4paper, 12pt]{article}
\DeclareUnicodeCharacter{FB01}{fi}
\DeclareUnicodeCharacter{FB02}{fl}
%\usepackage[space]{grffile}
\usepackage{apacite}
\usepackage{lipsum}
\usepackage{makecell}
\usepackage{afterpage}
\usepackage{dblfloatfix}
\usepackage[referable]{threeparttablex}
\usepackage[paper=portrait,pagesize]{typearea}
\usepackage{mleftright}
\usepackage{lscape}
\usepackage{a4wide}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[onehalfspacing]{setspace}
\usepackage{float, afterpage, rotating, graphicx}
\usepackage[dvipsnames]{xcolor}
\usepackage{tikz, epstopdf,pgfplots}
\usepackage{longtable, booktabs, tabularx}
\usepackage{fancyvrb, moreverb, relsize}
\usepackage{eurosym, calc, chngcntr}
\usepackage{amsmath, amssymb, amsfonts, amsthm, bm}
\usepackage{mathtools}
\DeclareMathOperator*{\argmin}{arg\,min}
\DeclareMathOperator*{\argmax}{arg\,max}
\usepackage[labelfont={bf}, skip=5pt]{caption}
\usepackage{mdwlist}
\usepackage{tabularx, booktabs}
\newcolumntype{C}{>{\centering\arraybackslash}X}
\usepackage{xfrac}
\usepackage{setspace,geometry}
\usepackage{xcolor}
\usepackage{lmodern}
\usepackage{upgreek}
\usepackage{afterpage}
\usepackage{wrapfig}
\usepackage{pdflscape}
\usepackage{multirow, booktabs, makecell, caption}
\usepackage{fancyhdr}
\usepackage[toc]{glossaries}
\usepackage{subcaption}
\usepackage{lipsum}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{eurosym}
\usepackage{amsfonts}
\usepackage{booktabs}
\usepackage{abstract}
\usepackage{dcolumn}
\usepackage{graphicx}
\usepackage[hyphens]{url}
\usepackage{acronym}
\usepackage[english]{babel}
\usepackage[round, sort&compress]{natbib} %sort&compress orders in text citation automatically
\usepackage{pgfplots}
\usepackage{threeparttable}
\usepackage{siunitx} %setze S in Tabelle, um nach dem Punkt auszurichten
\usepackage[export]{adjustbox}
\usepackage{etoolbox}
\usepackage[hyperfootnotes=false]{hyperref}
\usepackage{footnotebackref}
\usepackage{appendix}
\usepackage[bottom,hang,flushmargin]{footmisc} %footnotes always appear on bottom and not end of text on single page
\geometry{a4paper, top=30mm, left=30mm, right=30mm, bottom=30mm,headsep=10mm, footskip=12mm}
\begin{document}
\section{Empirical results}
\label{sec2:results}
\lipsum[3-5]
\newgeometry{top=30mm, left=5mm, right=10mm, bottom=30mm,headsep=10mm, footskip=12mm}
\afterpage{
\begin{landscape}
Test
\end{landscape}
}
\restoregeometry
\lipsum[3-5]
\end{document}
刚刚发现,使用该代码可以正常工作。因此,它一定是导致问题的软件包之一。
\documentclass[a4paper, 12pt]{article}
\DeclareUnicodeCharacter{FB01}{fi}
\DeclareUnicodeCharacter{FB02}{fl}
%\usepackage[space]{grffile}
\usepackage{apacite}
\usepackage{lipsum}
\usepackage{makecell}
\usepackage{afterpage}
\usepackage{lscape}
\begin{document}
\section{Empirical results}
\label{sec2:results}
\lipsum[3-5]
\afterpage{
\begin{landscape}
Test
\end{landscape}
}
\lipsum[3-5]
\end{document}
分页符来自 \newgeometry,它现在可以工作了:
\documentclass[a4paper, 12pt]{article}
\DeclareUnicodeCharacter{FB01}{fi}
\DeclareUnicodeCharacter{FB02}{fl}
%\usepackage[space]{grffile}
\usepackage{lipsum}
\usepackage{afterpage}
\usepackage{lscape}
\usepackage{setspace,geometry}
\usepackage{acronym}
\begin{document}
\section{Empirical results}
\label{sec2:results}
\lipsum[3-5]
\afterpage{
\newgeometry{top=30mm, left=5mm, right=10mm, bottom=30mm,headsep=10mm, footskip=12mm}
\begin{landscape}
Test
\end{landscape}
\restoregeometry
}
\lipsum[3-5]
\end{document}