LaTex演算法排版

2021-10-16 20:59:48 字數 685 閱讀 3597

需要包含的巨集包:

\usepackage[noend]

\usepackage

示例:
\begin

[t]\caption

%演算法的名字

\hspace*

%演算法的輸入, \hspace*

用來控制位置,同時利用 \\ 進行換行

input parameters a, b, c\\

\hspace*

%演算法的結果輸出

output result

\begin[1

]\state some description % \state 後寫一般語句

\for

% for 語句,需要和endfor對應

\state ...

\if% if 語句,需要和endif對應

\state ...

\else

\state ...

\endif

\endfor

\while

% while語句,需要和endwhile對應

\state ...

\endwhile

\state \return result

\end

\end

效果:

LaTex 演算法排版

排版可能需要的包 usepackage format of the algorithm usepackage format of the algorithm usepackage multirow for format of table usepackage usepackage declarema...

LaTeX演算法排版 筆記

usepackage noend usepackage begin t caption 演算法的名字 hspace 演算法的輸入,hspace 用來控制位置,同時利用 進行換行 input parameters a,b,c hspace 演算法的結果輸出 output result begin 1 ...

LaTex 文字排版

一 對齊段落 or newline 另起一行,而不是另起一段 在強制斷行後,還禁止分頁 newpage 另起一頁 linebreak n nolinebreak n pagebreak n nopagebreak n sloppy 降低一點兒標準 fussy 恢復為預設狀態 二 斷詞 hyphena...