u will need a "ground" part to hold everything in place.
the rack should have 2 planar connection 1 in the direction of sliding on underside
the other to hold it up
the pinion.
1 pin connection to the ground part..
ground part
should be holding both rack and pinion in relatiively final position
mechanism
if you want real motion, you will need to make a cam connection ( many
of them, 1 per tooth, maybe u can get away with one every few teeth)
and you have to allow liftoff
driver..
just make a servo drive to drive the pinion via a join axis of the pinion and the groundpart
if you just it to look "kinda right" and can not be bothered playing
around with too many cam connections. you can just make the rack move
along a path. and then pinion driven by the servo motor. u just have to
synconoise it manually
hope it helps