I'm trying to colorize the 3 horizontal lines appearing at the top and bottom of the algorithm below. I haven't been able to find similar issues in the internet. Could you please advise?
\documentclass[11pt,a4paper]{article}
\usepackage[no-math]{fontspec}
\usepackage[dvipsnames,svgnames,table,fixpdftex]{xcolor}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage[ruled,linesnumbered]{algorithm2e}
\begin{document}
\begin{algorithm}
\SetArgSty{textnormal}
\SetKwInOut{Input}{Input}
\SetKwInOut{Output}{Output}
\DontPrintSemicolon
\Input{A point $P$, an $n$-bit integer $k=\displaystyle\sum_{i=0}^{n-1} k_{(i)}2^i$}
\Output{$Q=[k]P$}
\Begin{
$Q \longleftarrow \mathcal{O}$\;
\For{$i=n-1$ to $0$}
{
$Q \longleftarrow [2]Q$\;
\If{$k_{(i)}=1$}{
$Q \longleftarrow Q+P$
}
}
\Return{$Q$}
}
\caption{Binary method for EC point multiplication} \label{alg1}
\end{algorithm}
\end{document}
Best Answer
The following setup allows you to adjust these colours to suit your needs via the provided macros:
The above code is specific to the
ruled
style ofalgorithm2e
.