Trust me...gum does NOT cover either one. It just makes them smell like minty garlic and minty onion.
The reason is that garlic and onion, (especially garlic) is carried in your bloodstream, and you will sweat out the odors so that everyone around you gets an unforgettable dose when they inhale.
Ick. Better just shower and brush your teeth then.