Mix margarine, sugar, vanilla sugar, egg yolks, baking powder and flour in a bowl to form the dough.
Spread the dough on a tray (with a high edge), press firmly and brush with jam. Bring the butter, sugar and water to the boil, fold in the nuts, spread on the dough. Press the nut mass firmly with a piece of baking paper.
Bake for approx. 45 minutes (175 °)
Cut into triangles, squares or rhombuses as you like (works best when fresh out of the oven) and coat with glaze after getting cold.