To make the pastry, put the flour, butter and icing sugar in a food processor and pulse until it resembles breadcrumbs. With the motor running, slowly add the egg yolks. If the mixture looks too dry, drizzle in 1-2 tbsp cold water. Tip it out onto your work surface and gently knead together. Flatten the pastry into a disc, wrap in cling film and chill for 20 mins.
Meanwhile, make the filling. Pour the milk into a saucepan. Scrape the vanilla seeds from the split pod into the milk and add the pod as well. Heat the milk over
a medium heat until it just starts to bubble around the edges. Remove from the heat and leave to cool a little.
Beat the egg yolks, sugar and flour together with an electric whisk for 5-10 mins until pale and mousse-like. Remove the vanilla pod from the cooled milk and steadily pour over the beaten egg yolks, whisking constantly.
Pour the custard mixture into a clean saucepan. Heat over a medium-low heat, whisking all of the time. Cook the custard for 10 mins, still whisking, until it is very thick. Remove from the heat and push through a sieve into a wide dish. Cover the surface with cling film to prevent the custard from forming a skin. Set aside to cool while you prepare the pastry case.
Roll out the pastry between 2 pieces of baking parchment to line a 24cm loose bottomed, fluted tart tin. Cover with cling film and chill for 30 mins. Heat oven to 200C/180C fan/gas 6. Line the tart case with foil or baking parchment and fill with baking beans. Bake in the oven for 15 mins. Carefully remove the baking beans and foil, then return to the oven for 5-10 mins until the pastry is golden brown. Leave to cool in the tin on a wire rack while you finish the filling.
Reduce oven to 160C/140C fan/gas 3. Gently beat the custard with the ricotta, orange zest and grated chocolate until just combined, and spread evenly in the tart shell. Sprinkle over the pine nuts and bake for 35-40 mins – the filling will still be quite wobbly but it will firm up as it cools. Chill for at least 3 hrs, or overnight. Dust with icing sugar to serve.