To make pastry: sift the flour and baking powder into a food processor, add the butter/margarine and process until well mixed. stir in the sugar, egg and lime zest and mix to a firm dough.
Knead dough until smooth. roll it out thinly and line a 25cm/10cm tart dish with it. keep the trimmings. chill for 30 minutes.
Preheat oven to 190°C.
To make filling: place sugar and butter/margarine in a bowl. beat until light and fluffy. add eggs a little at a time, beating well after each addition. fold in the pecan nuts, cornflour, chocolate and (if using) chocolate liqueur until evenly blended.
Pour mixture into the pastry case. place the whole pecan nuts on the top and use the trimmings to make a lattice across the top. bake for 40-45 minutes or until the filling has set.
Allow to cool in the dish then serve warm or cold, cut into wedges.