Preheat the oven to 220°C/425°F/gas 7. Peel the onions and halve across the middle. Place the butter in a 26cm non-stick ovenproof frying pan on a medium heat. Strip in the thyme leaves and add the bay, shake the pan around and get it bubbling, then add the sugar, vinegar and 100ml of water. Place the onion halves in the pan, cut side down. Peel and halve the garlic cloves and place in the gaps, then season generously with sea salt and black pepper. Cover, turn the heat down to low and leave to steam for 10 minutes to soften the onions slightly, then remove the lid and cook until – very importantly! – the liquid starts to caramelise, gently shaking the pan occasionally to stop it from sticking.
Place the pastry over the onions, using a wooden spoon to push it right into the edges of the pan. Bake for 35 minutes, or until golden brown and puffed up (it will look quite dark, but don’t worry!). Using oven gloves to protect your hands, pop a large plate over the pan and confidently but very carefully turn out.
Delicious served with goat’s cheese, a simple salad and a cold beer.
Shallots, leeks and spring onions all make wonderful tarts – just make sure they’re soft and caramelised before covering with pastry.