Estoy usando la versión 2022 de TexLive al dorso para crear un algoritmo. Para eliminar todos los índices 0, ajusté el argumento opcional de \begin{algorithmic}[0]
a \begin{algorithmic}
.
Aquí está el código completo del preámbulo del dorso:
\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}
Aquí está la captura de pantalla del resultado.
¿Qué se debe corregir en el código para eliminar todos los índices 0 (resaltados en amarillo), por favor?
Respuesta1
¡Hay muchos conflictos de paquetes en su código que no se han resuelto!
Retire \usepackage{newtxtext,newtxmath}
, \usepackage[cmex10]{amsmath}
y \usepackage{algorithmic}
.
¡Tu preamble
es demasiado caótico! Si desea enviar a IEEE, no cargue el paquete de fuentes global, como newtxtext
y newtxmath
.