
私は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
。