I am writing a book where I put source code in algorithm floats. I want to place the listing number in the outer margin besides the float. I also want figure numbers placed in the same manner. This makes it easier for the reader, who may scan the margins quickly looking for the right figure/algorithm number.
Is this possible at all? I have written some latex macros to get the kind of listings I want, but \marginpar fails inside a float. Is there another way of achieving something similiar? All I can think of myself is some ugly hack with a picture box and \put'ting something way outside the picture so it ends up in the margin. But I can't see how to line that properly up with real margin notes in the text. And the outer margin depends on wether the page is odd or even. Has someone done something similiar? Helge Hafting