
Я использую overleaf с TexLive версии 2022 для создания алгоритма. Чтобы удалить все индексы 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
.