\documentclass{article}
\usepackage{amsmath}
\usepackage{algorithm}
\usepackage[noend]{algpseudocode}
\makeatletter
\def\BState{\State\hskip-\ALG@thistlm}
\makeatother
\begin{document}
\begin{algorithm}
\caption{ROI}\label{euclid}
\begin{algorithmic}[1]
\Procedure{MyProcedure Region of interest (ROI_1)}{}
\State $\textit{Image_1} \gets \text{camera }\textit{image}$
\State $i \textit{ROI_1} \gets \text{trimmed}\textit{scale image}$
\BState \emph{image_1}
\State $i \textit{ROi_2} \gets \text{trimmed image}\textit{from ROI_1}$
\State $i \textit{image_2} \gets \text{ROI_2}$
\EndProcedure
\end{algorithmic}
\end{algorithm}
\end{document}
我写了这篇文章在 latex 中编写伪代码。我包括了以下列出的包:
有人能帮我纠正这个问题吗?
答案1
你喜欢获得以下结果吗?
这姆韦(最小工作示例)上述结果是:
\documentclass{article}
\usepackage{amsmath}
\usepackage{algorithm}
\usepackage[noend]{algpseudocode}
\begin{document}
\begin{algorithm}
\caption{ROI}\label{euclid}
\begin{algorithmic}
\Procedure{MyProcedure Region of interest (ROI$_1$)}{}
\State Image$_1$ $\gets$ Camera Image
\State ROI$_1$ $\gets$ Trimmed Scale Image
\If {ROI$_1$ is Found}
\State {Draw Rectangle around Image$_1$}
\EndIf
\State ROI$_2$ $\gets$ Trimmed Image from ROI$_1$
\State Image$_2$ $\gets$ ROI$_2$
\EndProcedure
\end{algorithmic}
\end{algorithm}
\end{document}
algorithm
关于和的基本信息algorithmic
您可以找到维基百科