First thoughts:
Rack and pinion must both have an integer number of teeth (a partial tooth won’t mesh…).
Rack and pinion must have the same tooth module.
Module = Pitch Circle Diameter (PCD) divided by No. of Teeth (T)
So if the rack is r and the pinion is p:
M = PCDr / Tr = PCDp / Tp
and therefore:
Tp = Tr * PCDp / PCDr
or:
PCDp = PCDr * Tp / Tr
And this, combined with the integer teeth requirement, means that the distance between centres has to be “sympathetic” - only certain values will give a solution and you may have to settle for an approximation to your target distance. Increasing the number of teeth will allow a closer approximation, but that may be mechanically undesirable.
Regards
Jeremy