Put the flour, icing sugar and salt in the bowl of a food processor and pulse a couple of times to combine
Scatter the pieces of butter over the dry ingredients and pulse until the butter is cut in coarsely - you'll have pieces the size of oatmeal flakes and pea-size pieces and that's just fine
Stir the egg, just to break it up, and add it a little at a time, pulsing after each addition
When the egg is in, process in long pulses - about 10 seconds each - until the dough, which will look granular soon after the egg is added, forms clumps and curds
Just before your pastry reaches this clumpy stage, the sound of the machine working the dough will change, so listen out
Turn the dough out onto a work surface. Very lightly and sparingly - make that very, very lightly and sparingly - knead the dough just to incorporate any dry ingredients that might have escaped mixing
Butter the tart tin and press the dough evenly along the bottom and up the sides of the tin. Don't be stingy - you want a crust with a little heft because you want to be able to both taste and feel it. Also, don't be too heavy-handed - you want to press the crust in so that the pieces cling to one another and knit together when baked, but you don't want to press so hard that the crust loses its crumbly shortbread-ish texture
Freeze the pastry for at least 30 minutes, preferably longer, before baking
Preheat the oven to 175ºC/375ºF/Gas mark 4
Butter the shiny side of a piece of aluminium foil and fit the foil tightly against the pastry
Bake the pastry for 25 minutes, then carefully remove the foil. If the pastry has puffed up, press it down gently with the back of a spoon
Bake for another 3 to 5 minutes, then transfer the pastry case to a cooling rack; keeping it in its tin
For the pears
Peel the pears, leaving them whole
Bring water, sugar and the juice of the lemon to a boil in a saucepan just large enough to hold the pears
Add the pears to the boiling syrup, lower the heat so the syrup simmers and gently poach the pears until they are tender when pierced with a knife - about 15 minutes
Cool the pears to room temperature in the syrup
For the filling
Put the butter and sugar in the bowl of a food processor and process until the mixture is smooth and satiny
Add the ground almonds and continue to process until well blended
Add the flour, cornflour and egg. Process until the almond cream is homogeneous
Add the rum or vanilla and process just enough to blend
To combine
Fill the baked pastry case with the almond cream, spreading it even with an offset metal icing spatula
Thinly slice each pear half crosswise, lift each half on a spatula and place carefully on to the almond cream to form an attractive pattern
Bake the tart for 50 to 60 minutes, or until the almond cream puffs up around the pears and browns
Transfer the tart to a wire rack to cool to just warm or to room temperature before removing it from its tin