For the cake, preheat the oven to 170C/325F/Gas 3. Grease the bottom and sides of a 20cm/8in square, shallow cake tin.
Cut out a piece of greaseproof paper that is 7.5cm/3in longer than the length of the tin. Fold the paper in half widthways. Open out the paper and push up the centre fold to make a 4cm/1½in pleat. Line the base of the tin with this, making any adjustments to ensure the pleat runs down the centre of the tin making in effect two rectangular 'tins' within the tin.
Beat the margarine, sugar, eggs, flour, baking powder and ground almonds in a large bowl for about 2-3 minutes, or until smooth, slightly lighter in colour and glossy looking. (If you put a damp cloth under the bowl, it stops it from moving around.)
Spoon slightly more than half the mixture into a separate bowl and stir in the vanilla extract and 1½ teaspoons of the milk. Set aside.
Mix the coffee in the remaining 1½ teaspoons of milk, stirring until it has dissolved (you don't need to heat the milk), then stir this into the other bowl of mixture along with the chopped walnuts. Spoon the vanilla mixture into one half of the tin and the coffee-walnut mixture into the other half. Level the surface of each half with a knife. Check the paper divider is still straight and in the middle.
Bake in the oven for 35-40 minutes or until the cake is well risen, springy to the touch and has shrunk slightly from the sides of the tin. Leave to cool in the tin for a few minutes, then loosen the cake from the sides with a round bladed knife, turn it out, peel off the parchment liner and finish cooling on a wire rack.
For the butter icing, sift the icing sugar into a medium bowl. Add the butter. Mix the coffee and milk together until the coffee has dissolved, and pour into the bowl. Beat everything together with a wooden spoon until soft and smooth. Set aside.
Trim the crispy outer edges off the cooled cake with a serrated knife, then cut and trim if necessary into 4 equal strips. Lay one vanilla and one coffee-walnut strip next to each other, then use a little of the butter icing to stick them together. Spread a bit more icing on the top. Stick the remaining two strips together with icing and place them on top to create a chequerboard effect.
Spread a little more icing over the top of the assembled cake.
Cut two pieces of string, one that is the length of the assembled cake and one that will wrap all around it.
Roll the marzipan out, on a work surface lightly dusted with sifted icing sugar, into an oblong the length of the cake and sufficiently wide to wrap around the cake, using the pieces of string as your measuring guide.
Lay the butter iced side of the cake on the marzipan, positioning it so that when you lift up one long side, it perfectly covers one side of the cake (this way the join will be neatly in the corner).
Reserve a teaspoonful of the icing and spread the rest over the remaining three sides of the cake (not the ends). Brush off any crumbs from the marzipan and work surface. Roll the cake over in the marzipan, pressing to neatly cover it, then brush the corner join lightly with water, pressing it to seal. (Try to avoid touching the marzipan with wet fingers as they will mark it.) Turn the cake over so that the join is underneath. Trim a slim slice from each end of the cake to neaten and show off the chequerboard effect. Smooth the marzipan over with your hands so their warmth will give it a smooth finish.
While the marzipan is still soft, crimp the edges by pinching the marzipan between your thumb and first finger at a slight angle and at regular intervals. Score the top of the cake with long diagonal lines using a sharp knife. Sift over some icing sugar to lightly dust the top, then lay the walnut pieces down the centre, securing with the reserved butter icing.