Straight Line Drawing Mechanism

Input: green slider.
Blue pulley is fixed to blue bar of Lb length.
Yellow pulley is fixed to yellow bar of Ly length.
Distances between revolution joints of pink bar is Lp1 + Lp2
Lb/Ly = Lp1/Lp2
Belt drive on pink bar has transmission ratio of 1.
End point of yellow bar traces a straight line that intersects green slider pivot axis and fixed bearing axis.
It is necessary to set the blue bar parallel to yellow bar for getting the line straight.
The belt should be toothed. Using chain drive is possible.