伪代码块编写(论文编写用) 您所在的位置:网站首页 并发代码怎么写好看 伪代码块编写(论文编写用)

伪代码块编写(论文编写用)

2024-07-09 23:33| 来源: 网络整理| 查看: 265

又到了写论文的季节,对于代码狗来说,写一手好看的伪代码,对于让老师高看一眼,就有了重要的意义,下面就是一个讨论的链接 如何在word文档里面插入漂亮的伪代码? 里面说用Auraro好,但找了半天只有32位,安起来又复杂,恶心,就权当这项目死了 那怎么写好看的伪代码,答案当然是latex,下面就是我从这里找到的好东西,再加上overleaf

首先上overleaf,创建个项目,然后贴代码,伪代码就出来了在这里插入图片描述 众所周知,latex恶心的在于其自由奔放的包,overleaf可以帮助我们省去这一糟心的过程 ,至于用法,这里只用了一个latex包, a l g o r i t h m 2 e algorithm2e algorithm2e手册链接 and 备用链接 下面就是上图中,自己编写好可行的latex码

\def\SetClass{article} \documentclass{\SetClass} \usepackage[linesnumbered,lined,boxed,commentsnumbered,ruled,vlined]{algorithm2e} \begin{document} \IncMargin{1em} \begin{algorithm} \SetKwData{Left}{left}\SetKwData{This}{this}\SetKwData{Up}{up} \SetKwFunction{Union}{Union}\SetKwFunction{FindCompress}{FindCompress} \SetKwInOut{Input}{input}\SetKwInOut{Output}{output} \Input{A bitmap $Im$ of size $w\times l$} \Output{A partition of the bitmap} \BlankLine \emph{special treatment of the first line}\; \For{$i\leftarrow 2$ \KwTo $l$}{ \emph{special treatment of the first element of line $i$}\; \For{$j\leftarrow 2$ \KwTo $w$}{\label{forins} \Left$\leftarrow$ \FindCompress{$Im[i,j-1]$}\; \Up$\leftarrow$ \FindCompress{$Im[i-1,]$}\; \This$\leftarrow$ \FindCompress{$Im[i,j]$}\; \If(\tcp*[h]{O(\Left,\This)==1}){\Left compatible with \This}{\label{lt} \lIf{\Left $


【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有