알고리즘에서 인덱스 0 삭제

알고리즘에서 인덱스 0 삭제

알고리즘을 생성하기 위해 TexLive 버전 2022와 함께 overleaf를 사용하고 있습니다. 모든 인덱스 0을 삭제하기 위해 선택적 인수를 에서 로 조정 \begin{algorithmic}[0]했습니다 \begin{algorithmic}.

다음은 뒷면 서문의 전체 코드입니다.

\documentclass[journal]{IEEEtran}
\usepackage{mathtools}   
\usepackage{newtxtext,newtxmath} 
\usepackage{lipsum} 
\ifCLASSINFOpdf
\else
\fi

\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{cite}

% \includegraphics 사용을 위해서 필수적으로 import 하는 패키지
\usepackage{graphicx}
% subfigure를 사용하기 위해서 필요한 패키지
\usepackage{subfig}

% 수식 사용을 위해 필수적으로 import 하는 패키지
\usepackage[cmex10]{amsmath}

% 텍스트 색을 바꾸려면 필요한 패키지
\usepackage{color}


\usepackage{algorithm}
\usepackage{algorithmic}
%\usepackage{algpseudocode}

\usepackage{caption}
\usepackage{mathtools}

\usepackage{relsize}
\usepackage{amsthm}
\usepackage{amssymb}
\usepackage{amsmath}
\let\labelindent\relax
\usepackage{enumitem}


\theoremstyle{definition}

\newtheorem{theorem}{Theorem}
\newtheorem{lemma}{Lemma}
\newtheorem{proposition}{Proposition}
\newtheorem{corollary}{Corollary}
\newtheorem{property}{Property}
\newtheorem{dominance property}{Dominance Property}
\newtheorem{example}{Example}
\newtheorem{condition}{Condition}
\newtheorem{remark}{Remark}

\newtheorem{schedulingrule}{Scheduling Rule}
\newtheorem{MIP}{MIP Model}
\newtheorem{assumption}{Assumption}

\newtheorem{definition}{Definition}


\DeclareUnicodeCharacter{2061}{}

\renewcommand{\qedsymbol}{$\blacksquare$}


\usepackage{tabularx}
\usepackage{booktabs}
\usepackage[commentColor=black, indLines=false]{algpseudocodex}

\hyphenation{op-tical net-works semi-conduc-tor}

\let\oldhat\hat
\renewcommand{\vec}[1]{\mathbf{#1}}
\renewcommand{\hat}[1]{\oldhat{\mathbf{#1}}}

\newcommand{\qvec}[1]{\textbf{\textit{#1}}}

\begin{document}

\floatplacement{algorithm}{tbp}
\makeatletter
\newcommand{\algorithmname}{\ALG@name}
\renewcommand{\floatc@ruled}[2]{{\@fs@cfont #1} #2\par}
\makeatother
\tikzset{algpxIndentLine/.style={draw=black}}
\algrenewcommand{\alglinenumber}[1]{\bfseries\footnotesize #1}
\algrenewcommand{\textproc}{\bfseries}

\begin{algorithm}
\caption{Sequence}
\begin{algorithmic}
\Statex \textbf{Step I}
\State Do $U_{LL}$
\If{$n$ is odd number}
\State Do $U_n$
\Else
\State Do $L_n$
\EndIf
\Statex \textbf{Step II}
\For{$i=1,\ldots,n$}
\If{$i\bmod{2}==1$}
\State Do $L_i$
\Else
\State Do $U_i$
\EndIf
\EndFor
\Statex \textbf{Step III}
\For{$i=1,\ldots,n-1$}
\If{$i\bmod{2}==1$}
\State Do $U_i$
\Else
\State Do $L_i$
\EndIf
\EndFor
\State Do $L_{LL}$
\end{algorithmic}
\end{algorithm}

\end{document}

다음은 결과의 스크린샷입니다.

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

모든 인덱스 0(노란색으로 강조 표시)을 삭제하려면 코드에서 무엇을 수정해야 합니까?

답변1

코드에 해결되지 않은 패키지 충돌이 많이 있습니다!

\usepackage{newtxtext,newtxmath}, \usepackage[cmex10]{amsmath}및 을 제거합니다 \usepackage{algorithmic}.

당신은 preamble너무 혼란스러워요! IEEE에 제출하려면 및 와 같은 전역 글꼴 패키지를 로드하지 newtxtext마십시오 newtxmath.

관련 정보