我尝试了之前发布的一些解决方案,但在这种情况下似乎没有任何效果。MWE 在这里:
\documentclass[a4paper,11pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[margin=3.0cm]{geometry}
\usepackage{hyphenat}
% \usepackage{bbding} %
\usepackage{MnSymbol}
\usepackage{siunitx} % for micro meter
\usepackage{amsmath} % for math fraction symbol
\usepackage{relsize} % for large summation
\usepackage[euler]{textgreek} % greek letters within text
\usepackage{bm} % bold math symbols
\usepackage{verbatim} % for commenting
\usepackage{lipsum} % for MWE
\usepackage[colorinlistoftodos]{todonotes} % for inline/margin comments that are visible in the pdf
% \usepackage{fixltx2e} % not needed anymore for subscript
% \usepackage{ulem} % for strikethrough: \sout{text}
% the ulem package gives reference sections underlines so remove it if not used. Didn't research why...
\usepackage{dirtytalk} % for quotes
% \usepackage{indentfirst} %indents beginning of the paragraph
\usepackage{hyperref} % for hyperlinks, citations
\hypersetup{
citecolor=green,
colorlinks=True,
linkcolor=blue,
filecolor=magenta,
urlcolor=blue,
pdftitle={banikr_phd_thesis_proposal},
pdfpagemode=FullScreen,
}
\urlstyle{same}
\usepackage{graphicx} %package to manage images
\graphicspath{ {./figures/} } % folder where the images or figures are
\usepackage{subcaption}
\usepackage[labelfont=bf]{caption} % make Figure 1 bold
\usepackage{wrapfig} % for wrapping a figure with words
\usepackage{enumerate}
% +---------------------------+
% | for white space removal |
% +---------------------------+
\usepackage{paracol}
\globalcounter*
\newsavebox{\tempboxa}
\newsavebox{\tempboxb}
\newsavebox{\textbox}
\newcommand{\splitpar}[2][\textwidth]{% #1 = width of column (optional), #2 = rest of paragraph after split
\unskip\strut{\parfillskip=0pt\parskip=0pt\par}%
\global\setbox\textbox=\vbox{\hsize=#1\relax\noindent\strut #2\strut}}
\newcommand{\continuepar}{\unvbox\textbox}
% +---------------------------+
% | writing starts here |
% +---------------------------+
\begin{document}
% \usepackage[innercaption]{sidecap}
\section{Specific Aim 3}
\lipsum[5]\cite{carreira2015large}.
atlases\cite{verbeeck2017connecting}.\lipsum[2].\\
\lipsum[2]
\begin{wrapfigure}[19]{r}{0.6\textwidth}
\centering %8cm, height=6cm
\includegraphics[width=9cm, height=6cm]{figures/blockface_screenshot.PNG} % scale=0.2 % width=\textwidth % this makes the figure same as caption width
% \vspace*{-8mm}
\caption{Duis eget orci sit amet orci dignissim rutrum. Nam dui
ligula, fringilla a, euismod sodales, sollicitudin vel, wisi. Morbi auctor lorem non justo.
Nam lacus libero}
\label{blockface}
% \setlength{\abovecaptionskip}{15pt plus 3pt minus 2pt}
\end{wrapfigure}
\lipsum[2]\cite{attia2012monitoring}. \lipsum[2]\cite{MIRT} \lipsum[5]
\begin{wrapfigure}[25]{r}{0.4\textwidth}
\centering
\includegraphics[width=4cm, height=9cm]{figures/MR_MS.png}
\caption{demo caption.}
\label{mrms}
\end{wrapfigure}
\lipsum[1]
\lipsum[2]
\lipsum[3]
\newpage
\addcontentsline{toc}{section}{References} % this includes the reference section in the contents
\bibliographystyle{ieeetr} %abbrv %apalike %ieeetr
\bibliography{references}
\newpage
\section*{Supplementary information}
\label{sec:SI}
\todo[color=cyan!]{transfer all the materials to the corresponding sections. No need for SI}
\addcontentsline{toc}{section}{Supplementary information}
\subsection{Demo pca}
The low-dimensional space acquired by PCA transformation can be visualized where all the pixels from different tissues are labeled by simple clustering method(i.e.
\begin{wrapfigure}{r}[10]{0.55\textwidth}
\centering
\captionsetup{justification=centering}%,margin=2cm}
\includegraphics[width=8.0 cm, height=4.5 cm]{figures/PCA_agglomerative_clustering.png}
\vspace*{-3mm}
\caption{Duis eget orci sit amet orci dignissim rutrum. Nam dui
ligula, fringilla a, euismod sodales, sollicitudin vel, wisi. Morbi auctor lorem non justo. Nam lacus libero.}
\label{pca agglom}
\end{wrapfigure}
\lipsum[1]. See \hyperref[pca agglom]{\textbf{Figure 11}}
\lipsum[4]
\subsection{Demo demo}
\lipsum[2] \hyperref[peptide umap]{\textbf{Figure 12}},
\lipsum[9]
\begin{wrapfigure}{l!}[10]{0.55\textwidth}
\centering
\captionsetup{justification=centering}%,margin=2cm}
\includegraphics[width=8 cm, height=5.5 cm]{figures/peptide_UMAP_HDBSCAN.png}
\vspace*{-3mm}
\caption{Duis eget orci sit amet orci dignissim rutrum. Nam dui
ligula, fringilla a, euismod sodales, sollicitudin vel, wisi. Morbi auctor lorem non justo. Nam lacus libero.}
\label{peptide umap}
\end{wrapfigure}
\subsection{this is also demo}
\end{document}
在需要的情况下,图像的垂直高度要大于宽度。
答案1
这很奇怪...如果我在 \begin{minipage} 中使用 \lipsum,它似乎在 MWE 中起作用......
\begin{wrapfigure}[25]{r}{0.4\textwidth}
\centering
\includegraphics[width=4cm, height=9cm]{figures/MR_MS.png}
\caption{demo caption.}
\label{mrms}
\end{wrapfigure}
\begin{minipage}
\lipsum[2]
\end{minipage}
但是当我使用我自己的文本或在这种情况下复制和粘贴 lipsum 文本时......它不再起作用。
\begin{wrapfigure}[25]{r}{0.4\textwidth}
\centering
\includegraphics[width=4cm, height=9cm]{figures/MR_MS.png}
\caption{demo caption.}
\label{mrms}
\end{wrapfigure}
\begin{minipage}
% \lipsum[2]
Fusce mauris. Vestibulum luctus nibh at lectus. Sed bibendum, nulla a faucibus
semper, leo velit ultricies tellus, ac venenatis arcu wisi vel nisl. Vestibulum diam. Aliquam pellentesque, augue quis sagittis posuere, turpis lacus congue quam, in hendrerit risus eros eget felis. Maecenas eget erat in sapien mattis porttitor. Vestibulum porttitor. Nulla facilisi. Sed a turpis eu lacus commodo facilisis. Morbi fringilla, wisi in dignissim interdum,
justo lectus sagittis dui, et vehicula libero dui cursus dui. Mauris tempor ligula sed lacus.
Duis cursus enim ut augue. Cras ac magna. Cras nulla. Nulla egestas. Curabitur a leo.
Quisque egestas wisi eget nunc. Nam feugiat lacus vel est. Curabitur consectetuer.
Suspendisse vel felis. Ut lorem lorem, interdum eu, tincidunt sit amet, laoreet vi-
tae, arcu. Aenean faucibus pede eu ante. Praesent enim elit, rutrum at, molestie non,
nonummy vel, nisl. Ut lectus eros, malesuada sit amet, fermentum eu, sodales cursus,
magna. Donec eu purus. Quisque vehicula, urna sed ultricies auctor, pede lorem
\end{minipage}
我非常讨厌乳胶......