President Barack Obama signed a sweeping overhaul of child nutrition standards Monday, enacting a law meant to encourage better eating habits in part by giving the federal government more authority to set standards for food sold in vending machines and elsewhere on school grounds.