`algorithm2e` 패키지에 어떻게 주석을 추가할 수 있나요?

`algorithm2e` 패키지에 어떻게 주석을 추가할 수 있나요?

패키지를 사용하여 알고리즘을 작성하고 있으며 스크린샷의 코드에 3행과 4행을 seccuss 없이 algorithm2e주석으로 추가하려고 합니다 . \tcc{}패키지에 설명을 어떻게 추가할 수 있나요 algorithm2e?

여기에 이미지 설명을 입력하세요

암호:

\documentclass{article}
\usepackage[linesnumbered,ruled,vlined]{algorithm2e} 
\renewcommand{\baselinestretch}{1.5}
\usepackage{amsmath}

\begin{document}
\begin{algorithm}[H]
\SetAlgoLined
\KwData{2 graphs  $T$ and $\acute{T}$ with nodes V and $\acute{V}$.}
\KwResult{Find whether $T$ and $\acute{T}$ are isomorph.}

function($T$, $\acute{T}$) \\
 \Indp covert $T$ to $P_v$ and $\acute{T}$ to $\acute{P_v}$ ;\\
 $d=deg(P_T) \leq h(T)$ and $S=\{1,2,3,\dots,2h(T)\}$; \\
  $\acute{d} =deg(\acute{P_T}) \leq h(\acute{T})$ and $\acute{S}=\{1,2,3,\dots,2h(\acute{T})\}$; \\

 \eIf{$Pr[P_v = \acute{P_v}] = \frac{d}{S}=\frac{h(T)}{2h(T)} ==\frac{1}{2}$}{
    return true;
    }{
    return false;}

\end{algorithm}
\end{document}

답변1

나는 단순히 시도했다

\tcc{$d=deg(P_T) \leq h(T)$ and $S=\{1,2,3,\dots,2h(T)\}$}
\tcc{$\acute{d} =deg(\acute{P_T}) \leq h(\acute{T})$ and $\acute{S}=\{1,2,3,\dots,2h(\acute{T})\}$}

문제없이 작동했습니다. ; \\줄 끝에서 제거할 때 주의하세요 .

관련 정보