如何使一个句子分布均匀?

如何使一个句子分布均匀?
As shown in Listing \ref{lst:dummylocalxmega} and Listing \ref{lst:dummylocalstm}, in the case of an implementation where  dummy operations use local variables, it does not find a part corresponding to the dummy Sbox operations in the assembly code.
    It is presumed that the compiler (WinAVR 4.3.3) provided by ChipWhisperer-Lite(CW1173) judged as operations irrelevant to the output of SubBytes function in the optimization

    \setcounter{lstlisting}{0}
    \renewcommand{\thelstlisting}{2.\arabic{lstlisting}}
    \begin{minipage}[H]{.45\textwidth}
        \lstinputlisting[language=nasm, style=nasm, caption=Assembly code for real operation when dummy operations uses local variables on the XMEGA128D4 microprocessor., label=lst:reallocalxmega]{asm_local_rl_XMEGA.asm}
    \end{minipage}
    \hfill
    \begin{minipage}[H]{0.45\textwidth}
        \lstinputlisting[language=nasm, style=nasm, caption=Assembly code for dummy operation when dummy operations uses local variables on the XMEGA128D4 microprocessor., label=lst:dummylocalxmega]{asm_local_dm_XMEGA.asm}
    \end{minipage}

    \setcounter{lstlisting}{0}
    \renewcommand{\thelstlisting}{3.\arabic{lstlisting}}
    \begin{minipage}[H]{.45\textwidth}
        \lstinputlisting[language=nasm, style=nasm, caption=Assembly code for real operation when dummy operations uses local variables on the STM32F303 microprocessor., label=lst:reallocalstm]{asm_local_rl_STM.asm}
    \end{minipage}
    \hfill
    \begin{minipage}[H]{0.45\textwidth}
        \lstinputlisting[language=nasm, style=nasm, caption=Assembly code for dummy operation when dummy operations uses local variables on the STM32F303 microprocessor., label=lst:dummylocalstm]{asm_local_dm_STM.asm}
    \end{minipage}

    \hfill \break
    process.
    Nevertheless, the power consumption traces of the SubBytes function can be divided into 32 parts because the ord array referenced in the switch-case statement is not optimized.
    Operations using unoptimized array are also not optimization targets, so a loop consisting of switch-case statements is performed, even though internal operations are not performed.

以上乳胶代码

上述 Latex 代码创建了一个如上图所示的 pdf。

事实上,列表上方的段落和下方的段落是一个段落。

但我想强制分区以有效利用空间。

所以我想将其均匀分布到列表上方段落的最后一行。

我应该怎么办?

答案1

您通过包含空行来强制列表之前的段落结束,\break这是不需要的)但您希望以下文本成为同一段的一部分,因此请删除空行并使用[h]在正常换行后插入到行之间的浮点数。

由于您想将两个列表并排放置,因此不能使用lstistings浮动选项,您需要将它们放在周围的浮动中。您可以使用figure环境,但最好使用由包设置的浮动类型的环境,以确保它与其他浮动列表保持顺序。所以我 lstfloat在这里定义(浮动类型已由 listings 包设置,但仅通过关键字提供float,而不是作为环境提供)

在此处输入图片描述

\documentclass{article}
\usepackage{listings}
\makeatletter
\newenvironment{lstfloat}
               {\@float{lstlisting}}
               {\end@float}

\makeatother
\begin{document}

One two three four five. Red blue green black white.
One two three four five. Red blue green black white.
One two three four five. Red blue green black white.
One two three four five. Red blue green black white.
One two three four five. Red blue green black white.
One two three four five. Red blue green black white.
One two three four five. Red blue green black white.
One two three four five. Red blue green black white.
One two three four five. Red blue green black white.
One two three four five. Red blue green black white.
One two three four five. Red blue green black white.
One two three four five. Red blue green black white.
\begin{lstfloat}[htp]
\begin{minipage}[t]{.45\linewidth}
\begin{lstlisting}[caption=aaa aaa aaa]
a
  a
   a
\end{lstlisting}
\end{minipage}\hfill
\begin{minipage}[t]{.45\linewidth}
\begin{lstlisting}[caption=bbb bbb bbb]
bbbbb
bbbb
bbb
bb
b
\end{lstlisting}
\end{minipage}
\end{lstfloat}
One two three four five. Red blue green black white.
One two three four five. Red blue green black white.
One two three four five. Red blue green black white.
One two three four five. Red blue green black white.
One two three four five. Red blue green black white.
One two three four five. Red blue green black white.
One two three four five. Red blue green black white.
One two three four five. Red blue green black white.
One two three four five. Red blue green black white.
One two three four five. Red blue green black white.
One two three four five. Red blue green black white.
One two three four five. Red blue green black white.
One two three four five. Red blue green black white.
One two three four five. Red blue green black white.
One two three four five. Red blue green black white.
One two three four five. Red blue green black white.
\end{document}

Note I used `[htp]` here so if the construct does not fit on the page, it will float to the top of the next, as usual.

相关内容