Just starting to play around with the algorithm2e
package and I have difficulties to figure out the things I need.
Here is my minimal working example:
\documentclass[10pt,a4paper]{article}
\usepackage[lined,boxed,commentsnumbered,german]{algorithm2e}
\begin{document}
\begin{algorithm}
\ForAll{$i\in \left[n\right]$ in parallel}{
$a\leftarrow b$\;
}
\textbf{repeat} $\left\lceil\log n \right\rceil$ \textbf{times}\;\Indp{
\If{$b > 1$}{
$b\leftarrow c$
}}
\end{algorithm}
\end{document}
- Instead of 'forall the' I would prefer to have just 'for all'. Instead of 'in parallel do' I would prefer to have it together as 'in parallel do'. How do I achieve that?
- How do I define my own macro 'repeat', so that is has an 'end'-statement, 'times' is inserted and a working vertical line at the left border?
- Is it possible to remove the 'end' of the 'if'-statement? 'lIf' is neat, but not really what I am looking for..
I tried to understand the documentation and the threads here on stackexchange, but the examples are quite complicated for a beginner, so I would be grateful for any advice.
Thanks in advance!
[not a native english speaker]
\SetKwFor{ForAll}{for all}{do}{end forall}
for the first question