This question already has an answer here:

enter image description here

i want to write Algorithm code in IET journal latex format. I am getting error as it is occured in the attached picture...Please solve this issue .. thanks in advance

this is the Algorithm code...

\caption{Saqib Qamar} 
\textbf{Function} ADDING(M,W,c,k)\; 
 $i \leftarrow Mod(logM,c)$\;
\If { $j \textgreater 2^i$ $\times$
 $\lceil{\frac{k-0.5}{2}}\rceil$ }
 { $ i \leftarrow i-2^k$\;
 \textbf{end if}\; \textbf{return} $Add(c^k , c^j)$\;

\textbf{end Function}\;


marked as duplicate by Henri Menke, TeXnician, Stefan Pinnow, CarLaTeX, Troy Jul 3 '17 at 6:20

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


This error message indicates that you have loaded a package with options more than once. Look for two instances of \usepackage[someopt]{algorithm2e} in your preamble (where someopt obviously stands in for whatever options you passed). See http://www.tex.ac.uk/FAQ-optionclash.html, which says:

The error is a complaint about loading a package with options, more than once. LaTeX complains because it has no means of examining the options, rather than because it knows there is a problem. (You may load a package any number of times in a document’s preamble, with no options, and LaTeX will ignore every loading request after the first; but you may only supply options when you first load the package.)

If you type h at the error prompt, you should see more info about the clash.

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