I thought I would post a picture of what a good tooth pattern looks like. If you replace the ring and pinion, you need to check the set up with marking compound.
I replaced the entire gear set from another box, in this case a Cub Cadet, so I was starting from scratch. The goal was to keep the original casting date transmission with the tractor
To do this set up the ring and pinion with the as close to the original shims as possible and measure the backlash in the ring gear. Use your hand in the transmission to lock it in place as you don't want any slop when you rock the ring gear. You are looking for .002 to .005 so you need a dial indicator.
If the lash looks good, then mark the pattern by painting a few of the teeth on the ring gear and with one hand put some drag on the ring gear and then rotate the transmission for several revolutions. If the pattern is in the middle, like this you are good to go. If this pattern was on the top of the tooth, as this one was, then the pinion needs to move back, so a shim needs to come out of the pinion shaft at the front of the box. Then you need to re-set your lash. Assuming your preload was properly set up, you need to remove a shim from the right and put it in the left side to loosen the lash. Once the preload is set you can move shims from one side to the other but you can't remove