0

i created the following algorithm but i am not satisfied with the output.So i was wondering is there a way to add vertical lines in my algorithm but also keep the same structure and be able to put it in a color box as well.
PS: i used this code in a separate file and included it in my main file.
This is my code:

\tcbset{
        enhanced,
        left=5mm,
        right=8mm,
        boxrule=0.4pt,
        colback=blue!5!white,
        boxrule=0.1pt,
        %colframe=red!75!black,
        colframe=blue!75!black,
        fonttitle=\bfseries
       }
       \setuldepth{Berlin}

\begin{tcolorbox}[
       lifted shadow={1mm}{-2mm}{3mm}{0.1mm}%
       {black!50!white}%,width=\textwidth 
       ]

    \centering

\begin{algorithmic}
\item Given an initiator agent A representing the Cloud Service Costumer(CSC), an agent B representing candidate cloud service provider (CSPs) among many others, a set of negotiable
parameters of Saas contract.
\begin{enumerate}
 \item[\textit{1.}]The initiator agent A sends a call for proposal (cfp) to the agent B.
\item[\textit{2.}]The agent B evaluates the call for proposal using an internal
function “evaluate proposal”.
\item[\textit{3.}]The previous evaluation allows agent B to make a decision, either
it responds by a \textit{proposal} or a \textit{rejection} (refuse).
\item[\textit{4.}]\ul{\textbf{If }} response(B) = rejection \ul{\textbf{Then}}The agent A eliminates the agent B from being selected for negotiation.
\item[       ]\ul{\textbf{ Else}}
\begin{description}
\item[       ] \ul{If } response(B) = proposal       \ul{\textbf{Then }}   The agent A evaluates the offer to select agents for negotiation using an internal function “ select for negotiation ” and either ,selects the agent B to start negotiation with, or eliminate agent B from being selected to 
start negotiation with .
\item[        ]\ul{\textbf{EndIf}}
\end{description}
\item[         ]\ul{\textbf{EndIf}}
\end{enumerate}


\end{algorithmic}
\end{tcolorbox}  

And this is the output:
enter image description here

  • where do you want the vertical lines? About the colorbox, this is already a colorbox, so could you explain it better. Does changing colback value to anothe color help? – Ignasi May 7 at 11:34
  • By the way, Welcome to TeX.SX! – Ignasi May 7 at 11:34
  • Thank you ! i want the vertical lines between If Else Endif , and about the colorbox , yes changing the value of colback would definitely help – lily May 7 at 12:23
  • As you are using algorithmic, but algorithm2e allow to easily draw vertical lines. If you insist in algorithmic take a look a this answer or similars – Ignasi May 7 at 17:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.