KTUG 한국 텍 사용자 그룹

Menu

KTUG :: Q&A 마당

먼 CTAN에 있는 algorithmicx.pdf의 예제를 적으면 다음과 같습니다.

\usepackage{algpseudocode}

\begin{algorithm}
\caption{Euclid’s algorithm}\label{euclid}
\begin{algorithmic}[1]
\Procedure{Euclid}{$a,b$}\Comment{The g.c.d. of a and b}
\State $r\gets a\bmod b$
\While{$r\not=0$}\Comment{We have the answer if r is 0}
\State $a\gets b$
\State $b\gets r$
\State $r\gets a\bmod b$
\EndWhile\label{euclidendwhile}
\State \textbf{return} $b$\Comment{The gcd is b}
\EndProcedure
\end{algorithmic}
\end{algorithm}

 

위 코드를 첨부한 텍 파일에서 실행을 시켜보면 계속 에러가 납니다.

\begin{algorithm}에서 에러가 계속 잡히더라구요.

 

본문에서 질문드린것과 같이 usepackage{algorithm, algpseudocode}를 해야지만 된다는데

이러한 경우엔 algorithm.sty 패키지를 사용한게 아닌가 우려되어 문의를 남겼습니다.

 

다른 방법은 없는지 아니면 현재 방법이 algorithm.sty 패키지를 사용한게 아닌게 맞는지가 궁금합니다.

답변부탁드리겠습니다 ㅜㅜ

 

KTUG 한국 텍 사용자 그룹