在撰写博士论文时,我遇到了一个不寻常的问题。我只想添加另一个wrapfigure
(之前没有问题),但这个问题只向我显示了一个空白区域,应该放置图表,而在下一页 - 直到新的部分 - 就像我有一篇两列文章,但第二列只有空白。
MWE 重现了该问题:
\documentclass[12pt,a4paper,twoside]{article}
\usepackage{geometry}
\geometry{hmargin=2cm}
\usepackage[utf8]{inputenc}
\usepackage[french]{babel}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{makeidx}
\usepackage{graphicx}
\usepackage{fancyhdr}
\usepackage{wrapfig}
\usepackage{titlesec}
\usepackage{lipsum}
\title{\parbox{\textwidth}
{\begin{center}
{\huge MyTitle}\medskip\\
{\Large Second title}
\end{center}
}}
\author{Name\\
function}
\date{\today}
\pagestyle{fancy}
\cfoot{-\thepage -}
\renewcommand{\headrulewidth}{0.5pt}
\renewcommand{\footrulewidth}{0.5pt}
\fancyhead[RO,LE]{Name}
\fancyhead[LO,RE]{}
\fancyfoot[RO,LE]{function 1}
\fancyfoot[LO,RE]{function 2}
\begin{document}
\maketitle
\tableofcontents
\thispagestyle{empty}
\newpage
\section{Section 1}
\subsection{SubSection 1.1}
\subsubsection{SubSubSection 1.1.1}
\begin{wrapfigure}{R}{6cm}
\centering
\includegraphics[width=6cm]{example-image}
\caption{My caption.}\label{MyLabel}
\end{wrapfigure}
\lipsum[1-4]
\begin{wrapfigure}{R}{6cm}
\centering
\includegraphics[width=6cm]{example-image}
\caption{My caption.}\label{MyLabel}
\end{wrapfigure}
\lipsum[1]
\begin{table}
\begin{tabular}{ll}
\hline
header 1 & header 2 \\
\hline
0 & random text random text random text random text random text random text \\
1 & random text random text random text random text random text \\
2 & random text random text random text random text random text \\
3 & random text random text random text random text random text \\
\hline
\end{tabular}
%\caption{Caption_Table}\label{tb:1}
\end{table}
\subsubsection{SubSubSection 1.1.2}
\lipsum[1]
\paragraph{my paragraph}
\begin{itemize}
\item random text random text random text random text random text random text
\item random text random text random text random text
\item random text random text random text random text random text random text
\item random text random text random text random text random text random text
\item random text random text random text random text
\item random text random text random text random text random text random text
\item random text random text random text
\end{itemize}
\end{document}
该图说明了我所拥有的:
答案1
wrapfigure
问题是,在和环境之间没有足够的“正常”文本itemize
可以放在图像旁边。已知所有类型的列表与wrapfigure
s 不兼容,例如参见在枚举环境中包裹图形。以及其中的链接。
要解决这个问题,您可以将wrapfigure
文本向上移动,或者在它和列表之间添加更多文本,例如参见下面的代码:
\documentclass[12pt,a4paper,twoside]{article}
\usepackage{geometry}
\geometry{hmargin=2cm}
\usepackage[utf8]{inputenc}
\usepackage[french]{babel}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{makeidx}
\usepackage{graphicx}
\usepackage{fancyhdr}
\usepackage{wrapfig}
\usepackage{titlesec}
\usepackage{lipsum}
\usepackage{xcolor}
\title{\parbox{\textwidth}
{\begin{center}
{\huge MyTitle}\medskip\\
{\Large Second title}
\end{center}
}}
\author{Name\\
function}
\date{\today}
\pagestyle{fancy}
\cfoot{-\thepage -}
\renewcommand{\headrulewidth}{0.5pt}
\renewcommand{\footrulewidth}{0.5pt}
\fancyhead[RO,LE]{Name}
\fancyhead[LO,RE]{}
\fancyfoot[RO,LE]{function 1}
\fancyfoot[LO,RE]{function 2}
\begin{document}
\maketitle
\tableofcontents
\thispagestyle{empty}
\newpage
\section{Section 1}
\subsection{SubSection 1.1}
\subsubsection{SubSubSection 1.1.1}
\begin{wrapfigure}{R}{6cm}
\centering
\includegraphics[width=6cm]{example-image}
\caption{My caption.}\label{MyLabel}
\end{wrapfigure}
\lipsum[1-2]
\begin{wrapfigure}{R}{6cm}
\centering
\includegraphics[width=6cm]{example-image}
\caption{My caption.}\label{MyLabela}
\end{wrapfigure}
\lipsum[1-4]
\begin{table}
\begin{tabular}{ll}
\hline
header 1 & header 2 \\
\hline
0 & random text random text random text random text random text random text \\
1 & random text random text random text random text random text \\
2 & random text random text random text random text random text \\
3 & random text random text random text random text random text \\
\hline
\end{tabular}
%\caption{Caption_Table}\label{tb:1}
\end{table}
%
%
\subsubsection{SubSubSection 1.1.2}
\lipsum[1]
\paragraph{my paragraph}
\begin{itemize}
\item random text random text random text random text random text random text
\item random text random text random text random text
\item random text random text random text random text random text random text
\item random text random text random text random text random text random text
\item random text random text random text random text
\item random text random text random text random text random text random text
\item random text random text random text
\end{itemize}
\end{document}