两个数字换行问题

两个数字换行问题

我想修复下面的间距,并将文本环绕在左侧的长图和短图周围。在此处输入图片描述

这是 MWE:

\documentclass[a4paper,11pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[margin=3.0cm]{geometry}
\usepackage[backend=biber, bibstyle=ieee, citestyle=numeric, sorting=none]{biblatex} % style=numeric
\AtEveryBibitem{
    \clearfield{urlyear}
    \clearfield{urlmonth}
}
\addbibresource{references.bib}
\usepackage{hyperref} % for hyperlinks, citations
\hypersetup{
    citecolor=green,
    colorlinks=True,
    linkcolor=blue,
    filecolor=magenta,      
    urlcolor=blue,
    pdftitle={Thesis_organized},
    pdfpagemode=FullScreen,
    }
\urlstyle{same}
\usepackage{graphicx} %package to manage images
\graphicspath{{./Images/}} % 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[export, draft]{adjustbox}% for valign
\usepackage{enumerate}  
\usepackage{hyphenat}
\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{blindtext}
\usepackage{dirtytalk} % for quotes
\usepackage[
    textcolor=black,
    linecolor=red,
    bordercolor=red,
    % backgroundcolor=white,
        ]{todonotes}
\usepackage{tocloft} % to keep table on contents in a single page
% +---------------------------+
% |  for white space removal  |
% +---------------------------+
\usepackage{paracol}
% \usepackage{needspace} % to prevent wrapfigure going to the next page. 
\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}
% +------------------------+
% |   document starts      |
% +------------------------+
\begin{document}
% there are some other sections here... 

\section{Significance}
\input{Sections/03_Significance}
\label{sec:significance}
\addcontentsline{toc}{section}{References}
\printbibliography
% \bibliographystyle{ieee} %abbrv %apalike %ieeetr
% \bibliography{references}

% \addcontentsline{toc}{section}{Supplementary Information} 
% \section{Supplementary Information}
% \input{Sections/Supplementary_Information}

\end{document}
    \subsubsection{Ion image clustering and spectral classification}
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibulum ut,
placerat ac, adipiscing vitae, felis. Curabitur dictum gravida mauris. Nam arcu libero,
nonummy eget, consectetuer id, vulputate a, magna. Donec vehicula augue eu neque. Pel-
\savebox{\tempboxb}{\includegraphics[width=0.4\textwidth]{Images/meanionimageclusters.png}}% measure height
\savebox{\tempboxa}{\includegraphics[height=110mm, width=60mm]{Images/meanspecclusters.png}}%example-image-10x16}}% measure height
\setcolumnwidth{\dimexpr 0.64\textwidth-\columnsep}
\begin{paracol}{2}
\sloppy
\noindent \lipsum[2]
Nulla malesuada porttitor diam. Donec felis erat,
congue non, volutpat at, tincidunt tristique, libero. Vi-
vamus viverra fermentum felis. Donec nonummy pel-
lentesque ante. Phasellus adipiscing semper elit. Proin
fermentum massa ac quam. Sed diam turpis, molestie
vitae, placerat a, molestie nec, leo. Maecenas lacinia.
Nam ipsum ligula, eleifend at, accumsan nec, suscipit
a, ipsum. Morbi blandit ligula feugiat magna. Nunc
\switchcolumn
\rule{0pt}{\dimexpr \ht\tempboxa-\ht\tempboxb}% empty space
%\hrule% show bottom of empty space
\end{paracol}
\setcolumnwidth{\dimexpr 0.28\textwidth-2\columnsep}
\begin{paracol}{2}
\continuepar
\switchcolumn
\begin{figure}[h]
  \captionsetup[subfigure]{justification=centering}
        \begin{subfigure}{\wd\tempboxb}
            \usebox\tempboxb
            \caption{average of ion image clusters}
            \label{mean ion}
        \end{subfigure}%\hfill
        % \hspace*{-2mm}
        \begin{subfigure}{\wd\tempboxa}
            \raisebox{0pt}[\ht\tempboxb]{\usebox\tempboxa}
           %\includegraphics[width=\linewidth]{figures/meanspecclusters.png}
            \subcaption{mean spectral distribution}
            \label{mean spec}
        \end{subfigure}
  \caption{The number of the clusters highlight tissue and spectral patterns.}\label{mean ion spec}
\end{figure}
\switchcolumn
\sloppy
\vspace*{-2.1cm}
\splitpar{fermentum massa ac quam. Sed diam turpis, molestie
vitae, placerat a, molestie nec, leo. Maecenas lacinia.
Nam ipsum ligula, eleifend at, accumsan nec, suscipit
a, ipsum. Morbi blandit ligula feugiat magna. Nunc 
% Read more about the clustering method and sum of squared loadings (SSL) of PCA as a ranking metric in \hyperref[sec:SI]{supplementary informaiton} section.  
% \todo[color=yellow!]{fix spacing...}
}% write here for the next wrapped column.
\end{paracol}
\continuepar

答案1

简单的解决方案是使用 将图形顶部与较高的图像重叠\smash。您需要在右侧留出间隙,这可以使用 minipage 来完成,但使用带有空列的 paracol 更容易\parindent\strut关键是将 放在哪里\splitpar以使列的高度与较高图像的多余高度相匹配。(知道高度并没有真正的帮助。)

\documentclass[a4paper,11pt]{article}
\usepackage[margin=3.0cm]{geometry}
\usepackage{graphicx}
\usepackage{subcaption}
\usepackage{paracol}
\usepackage{lipsum}

\globalcounter*

\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}

\begin{document}
\lipsum[2]% normal width

\setcolumnwidth{\dimexpr \textwidth-60mm-\columnsep}% first width
\begin{paracol}{2}\sloppy
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibulum ut,
placerat ac, adipiscing vitae, felis. Curabitur dictum gravida mauris. Nam arcu libero,
nonummy eget, consectetuer id, vulputate a, magna. Donec vehicula augue eu neque. Pel-
Nulla malesuada porttitor diam. Donec felis erat,
congue non, volutpat at, tincidunt tristique, libero. Vi-
vamus viverra fermentum felis. Donec nonummy pel-
lentesque ante. Phasellus adipiscing semper elit. Proin
fermentum massa ac quam. Sed diam turpis, molestie
vitae, placerat a, molestie nec, leo. Maecenas lacinia.
Nam ipsum ligula, \splitpar[\dimexpr 0.6\textwidth-60mm-\columnsep-2pt]%
{eleifend at, accumsan nec, suscipit
a, ipsum. Morbi blan-dit ligula feugiat magna. Nunc}
\end{paracol}

\setcolumnwidth{\dimexpr 0.6\textwidth-60mm-\columnsep-2pt}
\begin{paracol}{2}
\sloppy
\continuepar

Nam dui ligula, fringilla a, euismod sodales, sollicitudin vel, wisi. Morbi auctor lorem
non justo. Nam lacus libero, \splitpar{pretium at, lobortis vitae, ultricies et, tellus. Donec aliquet,
tortor sed accumsan bibendum, erat ligula aliquet magna, vitae ornare odio metus a mi.
Morbi ac orci et nisl hendrerit mollis. Suspendisse ut massa. Cras nec ante. Pellentesque
a nulla. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus
mus. Aliquam tincidunt urna. Nulla ullamcorper vestibulum turpis. Pellentesque cursus
luctus mauris.}
\switchcolumn
\begin{figure}[h]
  \captionsetup[subfigure]{justification=centering}
        \begin{subfigure}[b]{0.4\textwidth}
            \includegraphics[width=\linewidth]{example-image}%{Images/meanionimageclusters.png}
            \caption{average of ion image clusters}
            \label{mean ion}
        \end{subfigure}%\hfill
        \hfill
        \smash{\begin{subfigure}[b]{60mm}
            \includegraphics[height=110mm, width=60mm]{example-image}%{Images/meanspecclusters.png}}%example-image-10x16}}
            \subcaption{mean spectral distribution}
            \label{mean spec}
        \end{subfigure}}
  \caption{The number of the clusters highlight tissue and spectral patterns.}\label{mean ion spec}
\end{figure}
\end{paracol}
\continuepar
\end{document}

相关内容