奇怪的 wrapfig 行为

奇怪的 wrapfig 行为

我不知道如何用语言解释这一点,但希望这个 MWE 和附件就足够了。

基本上,我不明白为什么第二个\rule看起来不像第一个和第三个\rule。我想要它,但无论我尝试什么(在两个不同的 MacTeX 安装上),我都无法让第二个\rule看起来像其他的。

如果我做了一些非常愚蠢的事情那么我道歉,但是......

\documentclass[12pt,titlepage]{article}
\usepackage[autocite=superscript,sorting=none]{biblatex}
\usepackage{upgreek,lipsum,caption}
\usepackage{wrapfig}
\usepackage{doi}
\usepackage[greek,english]{babel}
\usepackage{fontspec}
\usepackage[margin=1in]{geometry}
\setmainfont{Arial}

\begin{document}
\raggedright
\setlength{\parindent}{1cm}

\begingroup
\setlength\intextsep{0pt}
\begin{wrapfigure}{l}[1cm]{2cm}\rule{2cm}{2.67cm}\end{wrapfigure}
\lipsum[1]
\endgroup

The word leukemia is from the Greek leukos meaning "white", and haima "blood." It represents a class of neoplastic diseases affecting the blood (eg. lymphoblastic) and/or blood-forming (eg. myeloid) tissues.

\begingroup
\setlength\intextsep{0pt}
\begin{wrapfigure}{l}[1cm]{2cm}\rule{2cm}{2.67cm}\end{wrapfigure}
Some of the so-called "liquid cancers," there are two main types of leukemia: myeloid (or myelogenous) and lymphoblastic (or lymphocytic). These two main types are further characterized in terms of their severity as either chronic (mild severity requiring months or years to progress) or acute (rapid increase in the number of malignant cells over weeks or months). There are also several less common subtypes of leukemia such as hairy-cell and promyelocytic (or progranulocytic).
\endgroup

In 2011, leukemia represented \textless 5\% of all cancer cases in the US. In 2012, approximately 47,150 Americans will probably be diagnosed with some form of leukemia, and about half of them are expected to die of it.

\begingroup
\setlength\intextsep{0pt}
\begin{wrapfigure}{l}[1cm]{2cm}\rule{2cm}{2.67cm}\end{wrapfigure}
\lipsum[1]
\endgroup

APL accounts for about 10\% of AML patients (\textasciitilde 1 in 250,000 Americans), and about 70\textendash 90\% of APL patients are cured with treatment.

\end{document}

enter image description here

答案1

\endgroup按照以下代码进行移位:

\documentclass[12pt,titlepage]{article}
\usepackage[autocite=superscript,sorting=none]{biblatex}
\usepackage{upgreek,lipsum,caption}
\usepackage{wrapfig}
\usepackage{doi}
\usepackage[greek,english]{babel}
\usepackage{fontspec}
\usepackage[margin=1in]{geometry}
\setmainfont{Arial}

\begin{document}
\raggedright
\setlength{\parindent}{1cm}

\begingroup
\setlength\intextsep{0pt}
\begin{wrapfigure}{l}[1cm]{2cm}\rule{2cm}{2.67cm}\end{wrapfigure}
\lipsum[1]
\endgroup

The word leukemia is from the Greek leukos meaning "white", and haima "blood." It represents a class of neoplastic diseases affecting the blood (eg. lymphoblastic) and/or blood-forming (eg. myeloid) tissues.

\begingroup
\setlength\intextsep{0pt}
\begin{wrapfigure}{l}[1cm]{2cm}\rule{2cm}{2.67cm}\end{wrapfigure}
Some of the so-called "liquid cancers," there are two main types of leukemia: myeloid (or myelogenous) and lymphoblastic (or lymphocytic). These two main types are further characterized in terms of their severity as either chronic (mild severity requiring months or years to progress) or acute (rapid increase in the number of malignant cells over weeks or months). There are also several less common subtypes of leukemia such as hairy-cell and promyelocytic (or progranulocytic).


In 2011, leukemia represented \textless 5\% of all cancer cases in the US. In 2012, approximately 47,150 Americans will probably be diagnosed with some form of leukemia, and about half of them are expected to die of it.
\endgroup %%<<<<<<<<<<<<<<<<<<<<<<<<<<<< shift to here.
\begingroup
\setlength\intextsep{0pt}
\begin{wrapfigure}{l}[1cm]{2cm}\rule{2cm}{2.67cm}\end{wrapfigure}
\lipsum[1]
\endgroup

APL accounts for about 10\% of AML patients (\textasciitilde 1 in 250,000 Americans), and about 70\textendash 90\% of APL patients are cured with treatment.

\end{document}

enter image description here

相关内容