0

How to change the predetermined command "Require" in "algorithm package".

I want to write input instead of Require

this is my code:

\documentclass{article}
\usepackage{amsmath,amssymb}
\usepackage[utf8]{inputenc}
\usepackage{algorithm}
\usepackage{algpseudocode}

\begin{document}

\begin{algorithm}
\begin{algorithmic}
\Require Instead of write Require I want to write  \textbf{Input}
\While{$N \neq 0$}\
Output $ =$  Content
\EndWhile\\
\end{algorithmic}
\end{algorithm}
\end{document}

1 Answer 1

6

Please try this:

\documentclass{article}
\usepackage{amsmath,amssymb}
\usepackage[utf8]{inputenc}
\usepackage{algorithm}
\usepackage{algpseudocode}
\renewcommand{\algorithmicrequire}{\textbf{Input:}} %% <--                      
\begin{document}
\begin{algorithm}
\begin{algorithmic}
\Require Instead of write Require I want to write  \textbf{Input}
\While{$N \neq 0$}\
Output $=$  Content
\EndWhile
\end{algorithmic}
\end{algorithm}
\end{document}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .