For the creme patissiere: Put the egg and yolks in a large heatproof bowl and whisk in the sugar and cornflour until smooth. Then set aside. Place the milk and vanilla extract into a medium saucepan and bring to the boil over a medium-high heat.
Pour the boiling vanilla milk over the egg mixture, whisking constantly to combine. Pour this mixture back into the pan and return to a medium heat. Whisk constantly until thickened, cooking for a minute or so extra to cook out the cornflour. Then pour the cooked crème patissiere into a heat-proof bowl and press a sheet of clingfilm onto the surface to stop it forming a skin. Set aside to cool a little, then place into the fridge to chill overnight.
For the pastry: Mix the flour, caster sugar and salt together into a bowl. Add the diced butter, rubbing in with your hands until it resembles breadcrumbs. Add the water a little at a time until the dough starts to come together. Then tip out onto a lightly floured worktop, and knead until it comes together to form a uniform dough. Try not to handle it too much. Press the dough into a fat disc, wrap in clingfilm and put in the fridge for at least 45 minutes.
Once chilled, roll the pastry out on a floured work surface into a rectangle about 2-3mm thick. Line the tin with the pastry and place back in the fridge for 30 minutes until firm. Meanwhile, pre-heat the oven to 180C/160C Fan/Gas Mark 4. Once the pastry is firm, line it with baking paper and fill with baking beans. Then blind bake for 20 minutes. Then remove the beans and baking paper and bake for another 5 minutes until the pastry is dry. Leave to cool completely.
Optional: Cut out leaf shapes from the pastry offcuts and place into the fridge to chill until assembly of tart.
For the pistachio frangipane: Cream the butter and sugar together in a large bowl, until well combined. Then beat in the ground pistachios, almonds and the flour. Finally, beat in the eggs until well combined. Set aside until ready to use.
To assemble: Preheat the oven to 180C/160C Fan/Gas Mark 4. Remove the crème patissiere from the fridge and beat lightly to loosen. Then spread evenly in the base of the cooled and baked pastry case (still in the tin). Then spread the raspberries over the top. Place the pistachio frangipane in a piping bag, and pipe lines over the top of the raspberries. Use a palette knife to spread the frangipane gently if any of the raspberries or crème patissiere are showing. If you are adding the pastry leaves, add these on top of the frangipane - using a remaining egg white to stick and as an egg wash to glaze.
Bake in the oven for 25minutes, until lightly golden on top. Leave to cool on a cooling rack completely before dusting with icing sugar and slicing.