Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.
\begin{algorithm}
\SetKwData{Candidates}{candidates}
\SetKwData{Links}{links}
\SetKwData{Visited}{visited}
\SetKwData{URL}{URL}
\SetKwData{TraversalDepth}{traversalDepth}
\SetKwFunction{RetrieveByTraversal}{retrieveByTraversal}
\SetKwInOut{Input}{input}
\SetKwInOut{Output}{output}
\Input{Starting page URL, Traversal parameter traversalDepth, Set of visited pages Visited, Already retrieved pages Candidates}
\Output{School list page candidates}
\BlankLine
\Candidates $= \emptyset$\;
\Visited $= \emptyset$\;
\Candidates = \Candidates $\cup$ \URL\;
\Links = Retrieve all but media type links from \URL\;
\Visited = \Visited $\cup$ \Links\;
\ForEach{link $link$ in \Links} {
   %\RetrieveByTraversal($link$, \TraversalDepth-1, \Visisted, \Candidates)\;
}
return \Candidates\;
\caption{Retrieving School List Page Candidates Using Traversal}
\label{algo_traversal_s}
\end{algorithm}

I got an undefined control sequence argument error at the commented-out line. When it is commented out, everything works fine. I'm not able to figure out what's wrong with that line.

Edit: as requested, I'm posting a minimum working example and the corresponding error message.

\documentclass[12pt,letterpaper]{report}

\usepackage{array}
\usepackage{graphicx}
\usepackage{cite}
\usepackage{subfigure}
\usepackage{amsmath}
\usepackage[indent,bf]{caption}
\usepackage{rotating}
\usepackage{setspace}
\usepackage{longtable}
\usepackage{rotating}
\usepackage[algochapter,linesnumbered,noend,ruled,oldcommands]{algorithm2e}
\usepackage{url}
\usepackage{float}
\usepackage{bookmark}

\begin{document}

\begin{algorithm}
\SetKwData{Candidates}{candidates}
\SetKwData{Links}{links}
\SetKwData{Visited}{visited}
\SetKwData{URL}{URL}
\SetKwData{TraversalDepth}{traversalDepth}
\SetKwFunction{Union}{Union}
\SetKwFunction{RetrieveByTraversal}{retrieveByTraversal}
\SetKwInOut{Input}{input}
\SetKwInOut{Output}{output}
\Input{Starting page URL, Traversal parameter traversalDepth, Set of visited pages Visited, Already retrieved pages Candidates}
\Output{School list page candidates}
\BlankLine
\Candidates $= \emptyset$\;
\Visited $= \emptyset$\;
\Candidates = \Candidates $\cup$ \URL\;
\Links = Retrieve all but media type links from \URL\;
\Visited = \Visited $\cup$ \Links\;
\ForEach{link $link$ in \Links} {
   \RetrieveByTraversal($link$, \TraversalDepth-1, \Visisted, \Candidates)\;
}
return \Candidates\;
\caption{Retrieving School List Page Candidates Using Traversal}
\label{algo_traversal_s}
\end{algorithm}

\end{document}

The corresponding error message is as follows:

! Undefined control sequence.
<argument> ...ink$, \TraversalDepth -1, \Visisted 
                                                  , \Candidates )\; 
l.45 }

? 
share|improve this question

closed as off-topic by egreg, Claudio Fiandrino, Qrrbrbirlbel, Heiko Oberdiek, karlkoeller Aug 29 '13 at 10:27

  • This question does not fall within the scope of TeX, LaTeX or related typesetting systems as defined in the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.

    
Please add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. — Class? Package? Algorithms? The error message also tells you which macro was found undefined (the last one on the line). –  Qrrbrbirlbel Aug 29 '13 at 9:07
    
@Qrrbrbirlbel Thanks for your advice. MWE added. –  Terry Li Aug 29 '13 at 9:19
    
I think you made a type: Visisted instead of visited. with two time s... –  CommuSoft Aug 29 '13 at 9:23
    
The code is still far from minimal; you load way too many packages! –  Svend Tveskæg Aug 29 '13 at 9:26
5  
This question appears to be off-topic because it is about a simple typing mistake –  egreg Aug 29 '13 at 9:48

1 Answer 1

up vote 2 down vote accepted

You simply made a typo:

It should be \Visited instead of \Visisted

share|improve this answer
    
Thanks. Problem fixed. –  Terry Li Aug 29 '13 at 9:25
1  
You made a typo. ;) –  Qrrbrbirlbel Aug 29 '13 at 9:32
    
One becomes hopeless when too enthusiastic ... :( –  CommuSoft Aug 29 '13 at 9:35

Not the answer you're looking for? Browse other questions tagged or ask your own question.