AFAIK the gaps are due to entries in descr_formations.txt. there are some basic outlines for different formations; each of them contains a line reading

inter_unit_spacing 2.0

with the 2.0 being the gap between units. reduce the number to 0 and you should be fine.