How do I prevent the Mac from sleeping while on display sleep on battery power?

Solution 1:

‎Amphetamine is a free application that will give you a lot of power and flexibility about keeping your Mac awake under various conditions.

It has been around for a number of years and considered very trustworthy. I would recommend it without reservation.

‎Amphetamine even has an option to disable itself when the battery reaches a certain percentage, which will reduce the chance that you will unwittingly run the battery to 0% (it is not generally advisable to run the battery fully empty). Obviously, the final choice is up to you.