Search code examples
latexalgorithm2e

LaTeX algorithm2e vlined parameter doesn't work


I've been trying to set a short LaTeX doc with an algorithm. The vertical block lines should have a horizontal line marking the end, like in this picture from the handbook: enter image description here

But I get this result instead: current result despite vlined

No idea what I'm doing wrong. The whole doc for the setup is as following:

\documentclass[12pt]{article}
\usepackage{amsmath}
\usepackage[vlined,linesnumbered,ruled,noend]{algorithm2e}

\begin{document}
     \NoCaptionOfAlgo
     \begin{algorithm}
     \SetKwInOut{Input}{Input}
     \SetKwInOut{Output}{Output}

     \If{true}
     {
         test
     }
     \caption{test}
     \end{algorithm}

\end{document} 

Solution

  • With noend you explicitly remove the horizontal end lines

    \documentclass[12pt]{article}
    \usepackage{amsmath}
    \usepackage[vlined,linesnumbered,ruled]{algorithm2e}
    
    \begin{document}
         \NoCaptionOfAlgo
         \begin{algorithm}
         \SetKwInOut{Input}{Input}
         \SetKwInOut{Output}{Output}
    
         \If{true}
         {
             test
         }
         \caption{test}
         \end{algorithm}
    
    \end{document} 
    

    enter image description here