Warning. This is an awkward post. It's deep winter and many of us are trapped indoors without the flow of fresh air from open windows. I, personally, have become quite conscious lately of daily smelly moments both at home with guests and at work (the elevator is the worst) where I've been trapped by someone passing gas or simply wished the bathroom at home would air out quicker. I myself will plead guilty on occasion. That said, there is one really effective way to erase this smell immediately. Do you know it? I have found that many people do not.
Flatus gas or intestinal gas is produced by the breakdown of food in our intestines combining with bacteria, and is made from hydrogen, methane and carbon dioxide. The smell, however, comes from hydrogen sulfide (sulfur), and this is the secret to getting rid of the smell.
Light a match and then blow it out.
Knowing all this, and the fact that gasses will expand to fill any space, the best thing you can do (though it's not easy in an elevator) is to simply light a match. Lighting a match creates a phosphorus ignition event that will also ignite the sulfur in the air and totally remove (not mask) the smell.
"Smelly sulphur will ignite at around 250 degrees Celsius, which is around the same as the ignition temperature of phosphorus (the ingredient in a match head). When you light a match the hydrogen sulphide will decompose to form to form water (vapour) and sulphur dioxide. This means no more hydrogen sulphide, and no more smell!" (via WendyZuckerman.com)
Are there such things as smelly food? Yes, indeed, but beans are not one of them. Foods with more sulfur in them, like cauliflower, eggs and meat are typically responsible for more smelliness.
While this may seem like a silly or inconsequential post, I think it's totally worth posting once with this single bit of information. Of course, if you have any other solutions, please list them below (I've also found that Citrus Magic works really well in bathrooms, but it is only a mask), but in the meantime I would recommend keeping a pack of matches in your bathroom at home at the very least.