I have an object (shown in green) that I want to pull out distance X and then I want another object (shown in red) to move 2X. What would be the best way to achieve this? I thought that gear racks connected to each and then linked by a gear train might work, but I can't quite figure out the best way to lay that out (or if there is a simpler way to do this).
An alternative to gears is to use a parallelogram mechanism, much like a Pantograph. All you need to do is have 2 parallelograms on top of each other the other with 2 times as long edges while sharing the 2 of the edges.
Note if you allready have an vertical slider then you can simplify the mechanism to 2 cranks essentially eliminating 3 of 6 parts. Though the gear has less parts
Image 1: A conceptual sketch of a parallelogram methanism
You have quite a leeway on designing a longer vs wider parallelogram. Even vary the relative speed profile if you so wish. Even though image 1 shows the front most item moving more you can shift the link down wherever you want. Or you can hinge the thing upside down or search a inversion alternate config of this mechanism.
You can also do similar things with a Peaucellier–Lipkin linkage or a Chebyshev's Lambda Mechanism if you wish. But tehy are more involved.