Heat about a quarter of the butter in a large pan, set over a medium heat. Sweat the onions with a little salt and the rosemary sprig. Slowly cook on a gentle heat with a lid on for about 20 mins. Remove rosemary and set aside.
Heat oven to 190C/170C fan/gas 5. Peel the potatoes and immediately cut into wafer-thin slices directly into a bowl containing the rest of the warm butter. Season with salt and pepper. The thinner the potatoes, the better the dish will be. Do not wash them once they are sliced, as you want all of the starch to stick the potatoes together.
Line an ovenproof, non-stick frying pan with a round of baking parchment. Layer potatoes neatly into the dish in a circle, slightly overlapping. The bottom of the pan will become the presentation side. Continue to pile in half of the potatoes, then add the melted onions. On top of the onions continue with the potatoes until all used up. Set the pan over a medium heat and gently begin to colour the bottom of the dish for 5 mins, then transfer to the oven and cook for 45-50 mins until the potatoes are soft.
Remove from the oven and leave to rest for 10 mins. Invert onto a serving plate, then slice into wedges with a very sharp knife.