Preheat the oven to 190°C.
Cook the potatoes in a large saucepan of boiling, salted water until tender; usually 15-20 minutes. Drain and allow to cool to one side.
Line a 7 inch springform fluted tart tin with nonstick baking paper. Roll the pastry out on a lightly floured surface to 5mm thickness and use it to line tart tin pressing in well all over. Prick the base all over and chill.
Melt the butter and olive oil in a large frying pan over a moderate heat and add the onions, sweating with a little salt until soft; 6-7 minutes, stirring occasionally. Reduce the heat and let the onions slowly caramelise, stirring occasionally.
Remove the pastry from the fridge as the onions caramelise and line it with nonstick baking paper and baking beans. Blind bake for 15 minutes until the edges just start to colour. Remove from the oven and discard the paper and baking beans, then return to the oven for 5 minutes to brown the base a little. Remove from the oven and brush all over with the beaten egg yolk to create a seal. Leave to cool on a wire rack.
Once the onions have caramelised and are golden brown in colour, remove from the heat and set to one side. Reduce the oven to 170°C.
Slice the potatoes into even sized discs. Arrange the onions across the base of the pastry, then arrange the potato discs in concentric, overlapping circles so that they cover the entire surface. Sprinkle the comté on top and season well.
Bake for 15-20 minutes until the potatoes have browned a little and the cheese has melted. Remove and allow to cool in the tin before serving.