Of course the CO2 is directly related to the fuel used, that's where the carbon comes from. The amount of C emitted in any form other than CO2 is absolutely minimal (HC and CO are strictly controlled and are very small compared to CO2).
Due to the way official calculations are done (rounding etc) there can be a small range of proportionality in quoted figures, but essentially CO2 produced is proportional to fuel mass used.
The ratios given in the link by Colin are different for petrol and diesel because the carbon/hydrogen ratio is different for the two fuels, thus the ratio of H2O/CO2/N in the exhaust is different, the amount of CO2 produced per kg fuel used is different. This will also apply to different ethanol (E10/E5 etc) content in petrol since it also carries some oxygen as well as the H and C, but the numbers are still pretty close for most everyday purposes, the effect of E5 or E10 is only a couple of percent or so.
The big issue with diesel engines is the NOx and particulates, and that's a whole different discussion.