Carbon is one of two main components of a successful compost pile. The other is nitrogen. Carbon comes from woody or dry substances like sawdust, corn stalks, egg cartons, shredded newspaper and brown paper bags. In the language of composting, those carbon-rich ingredients are called "brown" ingredients. According to Shawn Banks of the North Carolina Cooperative Extension, about one third to one half of your compost ingredients should be carbon-based and the remainder should be nitrogen based.
Air is an integral aspect of composting. Proper air circulation keeps all the microorganisms alive and doing their job, which keeps the decomposition process going and prevents bad odors. A compost pile that smells of vinegar needs a good turning with a strong pitchfork and additional carbon. Maybe you haven't been layering or turning the pile from the beginning--that's okay, until it starts to smell. Now is the time to get some air in there. Turn it about once a week and add some of those brown carbon-rich ingredients. Layering green and brown or just adding some dead leaves as you turn will create some nice air pockets and give the microorganisms a chance to breathe and get back to work.
A compost pile should smell like soil. A pile with the proper moisture level should feel like a wrung-out sponge. If you grab a handful, in other words, and squeeze it you shouldn't be able to extract any water at all. It should, however, feel moist and healthy, not dry and lifeless.
Avoid putting animal products in the compost pile. That means no meat, no dairy products and no animal bones. Stay away from oils, too. Leftover fry oil, for example, shouldn't go in the compost pile. These items are extremely difficult to compost. They attract animals and other pests, and they are another source of bad smells, although probably not vinegar smells.