Remove the old gate, latch and hinges. Measure opening between posts (here, 810mm) and subtract 20mm for 10mm clearance ...