Lightly grease an 11.5cm x 35cm rectangular tart tin.
To make the pastry, combine the flour, almonds, sugar and butter in a food processor. Process until it resembles fine breadcrumbs. Add milk and process until pastry just comes together. Turn on to a lightly floured surface and shape into a rectangle.
Roll the pastry out between two sheets of baking paper to a 20cm x 40cm rectangle (about 7mm thick). Lift into tin, pressing over the base and up the sides. Trim the edge. Pinch the pastry against the side of the tin to extend slightly above the edge. Refrigerate for 30 minutes.
Meanwhile, whisk egg yolks, caster sugar and vanilla together until pale and creamy. Add custard powder and cornflour, whisk to combine. Pour in milk, 1/4 cup at a time, whisking well between each addition. Transfer to a large saucepan. Cook, stirring constantly, over medium heat for 6 minutes, or until custard comes to the boil and is very thick. Pour into a large heatproof bowl and cover the surface with plastic wrap. Refrigerate until cold.
Preheat oven and a large flat tray to 180°C fan forced. Cover pastry with a sheet of baking paper. Half fill with baking beans or raw rice. Place onto the hot tray. Bake for 20 minutes, or until light golden around the edges. Remove paper and beans. Bake for a further 15-20 minutes until light golden all over. Set aside to cool.
To serve, beat custard with hand beaters until smooth. Spoon into the pastry case and smooth the top. Top with raspberries, dust with icing sugar and serve.