누락된 \item 오류가 계속 발생합니다.

누락된 \item 오류가 계속 발생합니다.

LaTeX 코드에 문제가 있습니다. 계속 오류가 발생합니다.

Underfull \vbox (badness 10000) has occurred while \output is active [13]

! LaTeX Error: Something's wrong--perhaps a missing \item.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.461 \end{algorithmic}

LaTeX 코드:

\documentclass{article}
\usepackage{algorithm}
\usepackage{algpseudocode}
\usepackage{pifont}

\begin{document}
\begin{algorithm}
\caption{ glavna\_zanka }%function 
\begin{algorithmic}[1]
\While{ končaj $\not=$ false } 
\State $ rotiraj\_robota()$
 \State obrobje o = $izberi\_raziskovalni\_cilj()$
\If { o $\neq$ null } 
    \State $ premakni\_do\_cilja(o)$
\Else
    \State  končaj = true
\EndIf
\EndWhile
\end{algorithmic}
\end{algorithm}

\begin{algorithm}
\caption{ izberi\_raziskovalni\_cilj() }
\begin{algorithmic}[1]
\end{algorithmic}
\end{algorithm}

\end{document} 

문제에 대한 통찰력을 주시면 감사하겠습니다.

답변1

예상 본문에 몇 줄의 코드가 있습니다 algorithmic. 컴파일 가능한 예제를 비교해 보세요:

\documentclass{article}
\usepackage{algorithm}
\usepackage{algpseudocode}
\usepackage{pifont}

\begin{document}
\begin{algorithm}
\caption{ glavna\_zanka }%function 
\begin{algorithmic}[1]
\While{ končaj $\not=$ false } 
\State $ rotiraj\_robota()$
 \State obrobje o = $izberi\_raziskovalni\_cilj()$
\If { o $\neq$ null } 
    \State $ premakni\_do\_cilja(o)$
\Else
    \State  končaj = true
\EndIf
\EndWhile
\end{algorithmic}
\end{algorithm}



\begin{algorithm}
\caption{ izberi\_raziskovalni\_cilj() }
\begin{algorithmic}[1]
\While
\EndWhile
\end{algorithmic}
\end{algorithm}

\end{document} 

그런데: LaTeX Error: Something's wrong--perhaps a missing \item.누락된 항목이 있다는 의미는 거의 없습니다. 적어도 내 경험에 따르면. :-)

답변2

알고리즘 환경에는 다음과 같은 콘텐츠가 필요한 것 같습니다.

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{algorithm}
\usepackage{algpseudocode}
\usepackage{pifont}

\begin{document}
%
\begin{algorithm}
  \caption{ glavna\_zanka }%function
  \begin{algorithmic}[1]
    \While{ končaj $\not=$ false }
    \State $ rotiraj\_robota()$
    \State obrobje o = $izberi\_raziskovalni\_cilj()$
    \If { o $\neq$ null }
    \State $ premakni\_do\_cilja(o)$
    \Else
    \State končaj = true
    \EndIf
    \EndWhile
  \end{algorithmic}
\end{algorithm}

\begin{algorithm}
  \caption{izberi\_raziskovalni\_cilj()}
  \begin{algorithmic}[1]
    \State Lalala…
  \end{algorithmic}
\end{algorithm}

\end{document} 

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

관련 정보