I've been trying to insert the code to my LaTeX document. I used this piece of code:
\begin{lstlisting}[label={lst:rws}, captionpos={bottom}, caption={Pseudo-code of RWS Selection}]
r = Random(); /* Uniformly distributed random number in [0,1] */
sum = 0;
for (i = 1; i < population.size; i++)
sum += individual(i).probabilityOfSelection;
if (sum >= r)
select(i)
\end{lstlisting}
However I get duplicated caption at the top of the listing and also at the bottom. If I don't use captionpos={bottom}
I get caption on top of the listing. Any idea what might be causing it?
Here's what I get:
Thanks
b
instead ofbottom
. This looks like a bug, apparently, bottom is interpreted both and leads totop
andbottom
caption