latex 伪代码 algorithm2e方式

在这里插入图片描述

 在这里插入图片描述

一、怎么用:

【paper】latex使用algorithm工具包实现伪代码排版_妈妈咪咦的博客-CSDN博客_algorithm包 latex

二、Latex 中伪代码编译通过,但是在pdf文档中不显示

引入\usepackage{float}

,添加[H]来产生没有浮动效果的环境。

\begin{algorithm}[H] 

xxx

\end{algorithm}

\beign{figuire}[H]

xxx
\end{figuire}

\begin{table}[H]

xxx

 \end{table}

三、设置字体大小、capiton字体大小

latex调整caption字体大小_JasmineHah的博客-CSDN博客_caption标签设置字体大小

\begin{algorithm}[H]
    \footnotesize
    \renewcommand{\algorithmicrequire}{\textbf{Input:}}
    \renewcommand{\algorithmicensure}{\textbf{Output:}}
    \captionsetup{font=footnotesize}
    \caption{xxxxxx}  
    \label{alg:xxxxxx}  
    \begin{algorithmic}[1]  
      \REQUIRE  
        $Tx$: The transaction;  
      \ENSURE  
        $\emptyset$;
      
      
    \end{algorithmic}  
  \end{algorithm}

猜你喜欢

转载自blog.csdn.net/u013288190/article/details/126571169