Thus, the path of least resistance is to stop eating the offending foods. The same advice is good for those who complain of frequent or excessive flatus. If much of the excreted gas is composed of hydrogen and carbon dioxide, which originate in the body, not the air, the problem may be a general malabsorption disorder or difficulty with particular foods. A low carbohydrate diet will often turn down the flatus volume. In addition to the beans, mushrooms, onions, celery, and other foods containing complex carbohydrates and undigestible fiber, many patients with abdominal complaints also benefit from reducing their intake of lactose, the milk sugar in dairy products.
Most adults lack, to some degree, the enzyme needed to digest lactose.
If you go above your threshold, then you have gas, cramps, and diarrhea. Another culprit may be the sorbitol in diet foods like candy, chewing gum, and sugar-free lozenges. I like cheese, and onions are a necessity. Maybe I can take some medicinal pesticide to kill my intestinal flora and recultivate with a less obnoxious set.