For a battery that stays in the 6V to 20V range, you can use the VIN pin and let the built-in regulators do the work. For any other battery, use a boost, buck, or boost-buck DC-DC converter to get 5V for the +5V pin.
If you need the battery to last a long time, the DC-DC converter option is likely to be more power-efficien than the built-in regulators, especially for voltages above 7V.