Battle Tactic: Canalised Skirmish
Unless you have many wide open courts or vacant sections in your city toward which all the enemy are obligingly moving, it is unlikely you will be able to use Heavy legions effectively in formation to catch and defeat all the enemy detachments rampaging throughout your streets. Squares loose their formation integrity when broken up by buildings and a united formation can pursue only one enemy detachment at a time.
Urban warfare is one case where skirmish/pursuit mode is often best. Even here however, you can impose some order. Release your legions into skirmish order, in a heavily built up area with roads running out in various directions, toward approaching enemy detachments. The roads will tend to channel your troops into concentrated columns, along various roads toward the nearest enemies who are using the same roads. The enemy tend to follow these paths of least resistance until they get well into the city. This will enable you to divide your units into small detachments, but the roads themselves will confine these detachments, and keep them from dispersing too much to be effective. The roads will also tend to direct your troops right toward the enemy moving along the same roads but in the opposite direction. Basically, road networks in built up areas, impose concentration and direction on the skirmish order, giving it more punch and directional targeting on specific opponents than it would have in the open field, where your soldiers scatter in all directions.
HINT: Do this with Heavy Legions or cavalry only. When you put your javelins troops in skirmish order, they tend to engage in hand to hand combat, rather than hurling their javelins, (What a waste!)so keep them in formation.
See also: Death Row