
Quando escrevi o seguinte pseudocódigo no formato \documentclass{article}, recebo as frases "Input" e "Output" após a compilação, mas quando escrevo o mesmo código de látex no modelo IEEE Access, recebo as instruções "Require" e "Ensure" como está, após a compilação. Acho que no primeiro caso o formato do artigo de alguma forma converte as frases "Exigir" e "Garantir" em "Entrada" e "Saída", mas no formato IEEE Access essa conversão não é feita.
Alguém pode me explicar como posso resolver esse problema? Gostaria de ver "Entrada" e "Saída" em vez de "Exigir" e "Garantir" após a compilação.
\documentclass{ieeeaccess}
\usepackage{cite}
\usepackage{amsmath,amssymb,amsfonts}
\usepackage{graphicx}
\usepackage{textcomp}
\usepackage[section]{placeins}
\usepackage{algorithm}
\usepackage{algpseudocode}
\usepackage{algorithmicx}
\algdef{SE}[DOWHILE]{Do}{doWhile}{\algorithmicdo}[1]{\algorithmicwhile\ #1}%
\begin{document}
\begin{algorithm}[H]
\caption{Algorithm 1}\label{Alg-Decap}
\begin{algorithmic}[1]
\Require{$(C,S_k)$}
\Ensure{ HashSession$(1,\underbar r,C)$ or HashSession$(0,\rho,C))$ }
\State $c\leftarrow$ Decode$(\underbar c)$
\State $c.(3f)\in\mathcal{R}/q$
\State $e\leftarrow $ (Rounded$(c.(3f))$ mod 3) $\in \mathcal{R}/3$
\State $e.(1/g)\in\mathcal{R}/3$
\State $r'\leftarrow$ Lift($e.(1/g)$) $\in\mathcal{R}/q$
\State $h.r'\in\mathcal{R}/q$
\State $c'\leftarrow$ Round$(h.r')$
\State $\underbar c'\leftarrow$ Encode$(c')$
\State $C'\leftarrow(\underbar c',$ HashConfirm$(\underbar r',\underbar h))$
\If{$C'==C$}
\State \textbf{return} HashSession$(1,\underbar r,C)$
\Else
\State \textbf{ return} HashSession$(0,\rho,C))$
\EndIf
\end{algorithmic}
\end{algorithm}
\end{document}
Responder1
Você pode mapear "Exigir" para "Entrada" e "Garantir" para "Saída" usando as seguintes configurações:
\algrenewcommand\algorithmicrequire{\textbf{Input:}}
\algrenewcommand\algorithmicensure{\textbf{Output:}}
Então, no seu caso, o código completo seria:
\documentclass{ieeeaccess}
\usepackage{cite}
\usepackage{amsmath,amssymb,amsfonts}
\usepackage{graphicx}
\usepackage{textcomp}
\usepackage[section]{placeins}
\usepackage{algorithm}
\usepackage{algpseudocode}
\usepackage{algorithmicx}
\algdef{SE}[DOWHILE]{Do}{doWhile}{\algorithmicdo}[1]{\algorithmicwhile\ #1}%
\algrenewcommand\algorithmicrequire{\textbf{Input:}}
\algrenewcommand\algorithmicensure{\textbf{Output:}}
\begin{document}
\begin{algorithm}[H]
\caption{Algorithm 1}\label{Alg-Decap}
\begin{algorithmic}[1]
\Require{$(C,S_k)$}
\Ensure{ HashSession$(1,\underbar r,C)$ or HashSession$(0,\rho,C))$ }
\State $c\leftarrow$ Decode$(\underbar c)$
\State $c.(3f)\in\mathcal{R}/q$
\State $e\leftarrow $ (Rounded$(c.(3f))$ mod 3) $\in \mathcal{R}/3$
\State $e.(1/g)\in\mathcal{R}/3$
\State $r'\leftarrow$ Lift($e.(1/g)$) $\in\mathcal{R}/q$
\State $h.r'\in\mathcal{R}/q$
\State $c'\leftarrow$ Round$(h.r')$
\State $\underbar c'\leftarrow$ Encode$(c')$
\State $C'\leftarrow(\underbar c',$ HashConfirm$(\underbar r',\underbar h))$
\If{$C'==C$}
\State \textbf{return} HashSession$(1,\underbar r,C)$
\Else
\State \textbf{ return} HashSession$(0,\rho,C))$
\EndIf
\end{algorithmic}
\end{algorithm}
\end{document}