I find the trick is to add a lot of fiber to your diet. I had the same problem the first few months of metformin but now rarely have the problem. It think this comes from the way metformin works to block some carb absorption. Since it doesn't get absorped it ends up as gas.
I have had less and less gas from low-carbing. I think I must be getting sick if I fart! I never had trouble with metformin, thankfully, but some of my former culprits were: yogurt, tums (TUMS!!!), excessive onions. NOT BEANS, oddly.
I hope you adjust to met soon, it is no fun stinking out coworkers!!!