Tag Info

New answers tagged

1

A quick solution is to use \setcounter inside each algorithm. Moreover, to get the algorithms aligned in the list of algorithms you need to redefine \listof and \l@algocf commands and set \@dottedtocline with the desired horizontal spacing. Here is the code: \documentclass{article} \usepackage{algorithm} \usepackage{algorithmic} ...


0

Actually, you don't have to remove the ulem package, since it could be useful somewhere else. Use the \normalem and \ULforem commands provided by the ulem package. The conditions of algorithm2e package are emphasized, and ulem package by default replaces italics with underlining for all emphasized text, that's why underlines appear automatically when using ...


2

Regular line-breaks and associated indentation is discussed in Line-break in package algorithm2e. For conditional adjustments, perhaps the following might be of interest: \documentclass{article} \usepackage{algorithm2e} \SetKwIF{If}{ElseIf}{Else}{if~(\endgraf}{\endgraf)~then}{else if}{else}{end if}% \begin{document} \begin{algorithm}[H] \SetAlgoLined ...


4

This is all much easier if you use the algoritmicx package, it has a lot more functionality and works better with other packages: \documentclass[12pt]{report} \usepackage[a4paper,margin=1.25in]{geometry} \usepackage{algorithmicx} %Defines the \If command, ending in \EndIf \algblockdefx[If]{If}{EndIf}[0]{\textbf{if} $($}{$)$} %Defines the alternative ending ...


2

This stems from a redefinition of \@chapter by algorithm2e: \begingroup\expandafter\expandafter\expandafter\endgroup \expandafter\ifx\csname @chapter\endcsname\relax\else \let\algocf@original@chapter=\@chapter% \def\@chapter[#1]#2{\algocf@original@chapter[#1]{#2}\addtocontents{loa}{\protect\addvspace{10\p@}}}% \fi It stores \@chapter and then ...


2

From the algorithm2e documentation: The optional arguments [Hhtbp] works like those of figure environment. The H argument forces the algorithm to stay in place. If used, an algorithm is no more a floating object. Caution: algorithms cannot be cut, so if there is not enough place to put an algorithm with H option at a given spot, LaTeX will place a ...


1

The \Repeat command as defined by algorithm2e does not come with a complementary \Until command, it has the aborting condition built in: The syntax is \Repeat{<untilcond>}{<loop body>} In your example that would be \Repeat{$F_{k}=\emptyset$}{ $k = k + 1$\; }



Top 50 recent answers are included