1

I'm new to Latex and currently writing pseudocode using algorithmic. I want to remove all "end if" lines from the code. I tried to use \usepackage[noend]{algpseudocode} but it does not work (see the image). Please help. Thank you!

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{algorithmic}
\usepackage{algorithm}
\usepackage[noend]{algpseudocode}
\algnewcommand\algorithmicinput{\textbf{Input:}}
\algnewcommand\algorithmicoutput{\textbf{Output:}}
\algnewcommand\Input{\item[\algorithmicinput]}%
\algnewcommand\Output{\item[\algorithmicoutput]}%
\algnewcommand{\Donnees}{\Statex \textbf{$x$}}

\begin{document}





\begin{algorithm}
\caption{The recommendation }
\begin{algorithmic}[1]
\Donnees: a scenario

\Input{$Stakeholder_x, Solutions_x, Architectures_x$}
\Output{$Issues_x, Measures_x, Attributes_x$}
\FORALL{$Solution$ in $Solutions_x$}
    \IF{$Solution$ in $Solutions_{Stakeholder_x}$}
        \IF{$Solution_{Components}$ not in $Components_x$}
            \STATE add $Solution_{Components}$ to $Components_x$
        \ENDIF
        \IF{$Issues_{Solution}$ not in $Issues_x$}
            \STATE add $Issues_{Solution}$ to $Issues_x$
        \ENDIF
        \FORALL{$Architecture$ in $Architectures_x$}
            \IF{$Architecture$ in $Solution_{Architectures}$}
                \IF{$Component_{Architecture}$ not in $Components_x$}
                    \STATE add $Component_{Architecture}$ to $Components_x$
                \IF{$Issues_{Architecture}$ not in $Issues_x$}
                    \STATE add $Issues_{Architecture}$ to $Issues_x$
                \ENDIF
                \ENDIF
            \ENDIF
        \ENDFOR
    \ENDIF
\ENDFOR

\end{algorithmic}
\end{algorithm}

enter image description here

fsfr23
  • 11

0 Answers0