The so called "cogen approach" to program specialisation, writing a compiler generator instead of a specialiser, has been used with considerable success in partial evaluation of both functional and imperative languages. This paper demonstrates that the cogen approach is also applicable to the specialisation of logic programs (called partial deduction) and leads to effective specialisers. Moreover, using good binding-time annotations, the speed-ups of the specialised programs are comparable to the speed-ups obtained with online specialisers. The paper first develops a generic approach to offline partial deduction and then a specific offline partial deduction method, leading to the offline system lix for pure logic programs. While this is a usable specialiser by itself, it is used to develop the cogen system logen. Given a program, a specification of what inputs will be static, and an annotation specifying which calls should be unfolded, logen generates a specialised specialis...